A brief view into a few of the inner workings of email. This is the first part in a three-part blog post about the (e-) mails and the way to create, encode and send them using the email crate (a library). In this part I am going to bring in mails in general, list lots of the standards involved in creating/sending email and gives an introduction as to how mails are organized internally. The next part will present the email crate, its general structure, and what it supports. The last part shall, step-by-step, give a good example where handlebars templates are accustomed to generate mails based on some user input.
It also includes sending the generated mails to an MSA over SMTP (both terms described below). 1. This content is created by A consumer they want to send. 3. The mail is sent to a Message Submission Agent (MSA). Usually do not confuse this with the MX entrance in the domain name registry. This likely will use the Simple Mail Transfer Protocol (SMTP).
- What are the most crucial skills to have to do well in this job
- Do you genuinely believe in love? Why or why not? ____
- Use relevant hashtags on different platforms
- Highlight milestones and reviews from influencers
- Interact with your application to see and feel the experience it provides
The MSA might slightly modify the email, such as adding some personal to make it verifiable that the mail is actually sent by you. 4. The mail is transferred to the receiver’s Mail Exchanger (MX), which passes it to a note Delivery Agent (MDA). This may be done by a separate Mail Transfer Agent (MTA) which gets the mail from the MSA you delivered it to. The transfer from MTA to MX might be achieved by SMTP also, although there are other protocols. Before the mail may have been through multiple hops, but that’s not a really thing anymore so it’s not covered here.
5. The user retrieves the mail from the MDA. This is often done by POP3 or IMAP if you use a mail program. 6. The mail program shows the mail. This is anything but simple, as many parts of email are underspecified as to how to exactly display certain parts or even just semantically interpret them.
The email crate is mainly centered on creating and encoding mails in order that they then can be delivered, though it also provides bindings to new-tokio-smtp to make it simple to send mails for an MSA. In the future it could also support parsing mails, but features such as exhibiting them or retrieving them from an MDA using IMAP/POP3 is outside of the scope of the crate.
TL; DR: There are numerous interconnected standards, standards replacing standards and standards updating standards making it easy to overlook some right parts or misinterpret others. Mail is pretty old and there are a large variety of standards which have to be considered when implementing an application to produce and send mails. Many of the standards also have one or multiple new specifications which “replace” /obsolete the previous standard.
For example email was first specified by the IETF in RFC 822, which on itself actually replaces RFC 733 which really is a standard for a few pre-mail texts. The issue of RFC 822 (and IMHO many email related standards) is that many parts where either rather vague or allowed many more options than originally designed.
For example RFC 822 allows using control personas like XON, XOFF in text message in (some) headers. While often it’s enough to use the latest standard in a string of criteria obsoleting each other, it’s often much less simple as there are a great many other standards extending the existing standards. These standards always refer to the standard which had been the “newest” when they were released, but weren’t up to date when that standard have been obsoleted and replaced by a more recent one.
Furthermore they still connect with the newer standard, which is always meant to be backwards appropriate for the old standard (regarding email at least). This may need you to track some feature or grammatical build through the criteria to discover what it actually means in the framework of the most recent standard.