Abdu Taviq

Emails and Protocols

Email technology consists of many interacting protocols and standards that work together to send and receive messages.

Architecture of Email consists of:

MTAs communicate between each other using port 25 and use the Simple Mail Transfer Protocol (SMTP). Port 25 is used for sending emails between servers and it’s usually blocked by ISPs and cloud providers to prevent spam. You will have to manually request removing the limit on this port. Most of the time, you will use port 587 for sending emails from your MUA to the MSA. Meanwhile port 25 is used by the MTA to relay emails to the MDA.

There are few configurations needed when setting up an email server to prevent being marked as spam:

There are two famous protocols used to retrieve emails from the MDA:

File attachments are usually sent using the Multipurpose Internet Mail Extensions (MIME) which is just encoding the binary data into a base64 string and adding it to the email body. The email client will decode the base64 string and display the attachment. Usually the maximum size of an email is 25MB, and for bigger files they will be uploaded to a cloud storage and send a link to the file instead.

For testing email servers, you can use one of the following tools to test them:

For fighting spam, there is DNSBL or DNS Blocklist, which is a list of IP addresses that are known to be malicious. You can use a tool like DNSBL Info to check if an IP address is on the list.

DNS records that need to be set for emails to be delivered correctly:

For encryption, SMTP is by default unencrypted but it can use the STARTTLS command to upgrade from unsecure to a secure communication. This is called Opportunistic TLS which is different from Implicit TLS which assumes TLS is already used from the start.