-2

Reading https://ccm.net/contents/116-how-email-works-mta-mda-mua and https://en.wikipedia.org/wiki/Email_agent_(infrastructure), I wonder why the email sending process is not symmetric with the receiving process? The sending process has no something similar to MDA, and MUA contacts MTA directly for sending emails. (Imagine when mailing a letter, we go to the nearest public mailbox on streets, and mailmen collect mails from them twice a day.)

  • How does MUA know what emails have been sent? (How does MUA get the emails in the "Sent" folder?)
  • Are sent emails stored in the same place as received mails in MDA in a server?
Tim
  • 101,790
  • 1
    Hello Tim welcome back haven't seen you around for quite a while – Chris Davies Sep 11 '20 at 21:37
  • Thanks. I am never away. I am just lost. I think my question might be better suited somewhere else. – Tim Sep 11 '20 at 21:38
  • Quick answer then. 1. MUA doesn't remember what's been sent, but the action of sending a message usually means it gets put into the Sent folder. Later on, you know what's been sent because such messages are typically in the Sent folder. 2. For IMAP (and Exchange, Gmail) where the messages are stored on the server, yes. For POP mailboxes where the messages get downloaded to the single client, that's up to the MUA to decide – Chris Davies Sep 11 '20 at 21:40
  • Is the sent folder a directory in the local host as MUA or in a remote server which runs MTA or MDA? If I use another MUA later, how can it retrieve the previously sent emails, if it can? – Tim Sep 11 '20 at 21:42
  • With IMAP it can be implemented internally in any way that the server wants. (Database, flat file, lots of files one per message, whatever.) The user sees the Sent folder as just another folder. The IMAP server probably treats it as just another folder, and it's up to the MUA to ensure a copy of your sent messages are put into it. – Chris Davies Sep 11 '20 at 21:47
  • So does the IMAP server (which is a MDA) responsible of both sending a email to a MTA and receiving an email from a MTA? – Tim Sep 11 '20 at 21:52
  • 1
    Things don't have to be implemented the way they are described in wikipedia. But if you want to send mail from your program, it's much easier to just call sendmail (via well-known command line interface) instead of re-implenting yourself the SMTP (where S stands for simple, but it's everything but simple). It makes no sense to put another layer between them just for the sake of "symmetry" (i.e. for completing the acronym soup) –  Sep 11 '20 at 21:53
  • @Tim, IMAP is the protocol for managing messages stored in a server. SMTP is the protocol for sending messages to another place or person. They do different things (from the technology perspective), so an MUA needs to handle both in order for it to be an effective application – Chris Davies Sep 11 '20 at 22:24
  • The MTA handles mail transmission. The IMAP server handles mail storage. The MUA presents an interface between these and the User – Chris Davies Sep 11 '20 at 22:26

1 Answers1

2

https://unix.stackexchange.com/a/492794/:

@Tim, why do you think the sending and receiving need to be symmetric? The MTAs are responsible for the inter-server communication. This one is symmetric in some sense but you only see one side of it (during sending mails to others). The reception is done by your provider's servers. The mail transmission itself is very quck (matter of msecs).

So, you do not need somethink like a MDA on the sending side. You can simply give it a go and put the mail on its way. Think of it as a postal service. You just drop the parcel at the post office, they take care of any further setps.

The MUA just puts the mail on its way. As soon as it has been accepted by the first MTA the MUA assumes it to be sent. Again the postal analogue: As soon as you put a parcel at the post office for sending, you assume it is going to be delivered. If anything goes wrong on the route, you will get the parcel retourned. Exactly this is what happens when the mail causes issues on its way. The MTA will send a returning information to you (so called bounce) if the message could not be delivered to the next station.

Now the receiving side once more. I first go with the postal analgue again. If you were always reachable all the time and also always in teh same location, the post officer could directly come to you to deliver your mail. That would mean a MTA delivers a mail directly to you.

Unfortunately, you have a non-static IP (you are not always in the same location) and you are definitively not always there (not always at home). As a result, the MTA coudl try to deliver the mails but as you are not available, the mail would have been bounced (see above).

To avoid this, you have your post box. This is true both in email as well as normal mail. The post officer/MTA puts the mails in the box on his terms (timing). Whenever a message needs to be delivered he can do so. In case of the MTA this means nothing more than saving a file in a dedicated folder.

The postbox represents a synchronization elenment between you and the post officer. You can go to the post box anytime you find it suitable and look for your post. As the MTA saved the mail on the server, you do not have direct access. Here the MDA comes into play. The MDA allows access to the postbox on your behalf and according to your timing.

Tim
  • 101,790