Some weeks ago, I was trying to explain the eMail flow and how protocols are involved. I am not very good at explaining, so I took now my time and I have done this little description. I hope it is useful for everyone.
When you send an email, you use the SMTP protocol to interact with servers. This protocol is the one that usually runs in the so popular port 25/tcp, 465/tcp or 587/tcp. Port 25 is used for server-to-server interaction while 465/tcp or 587/tcp is used for client-to-server interaction.
IMAP or POP are protocols responsible for delivering email messages from the server to the end user's computer. IMAP usually runs on 143/tcp and 993/tcp; POP usually runs on 110/tcp and 995/tcp.
So, here is my little explanation:
- Diego is writing an email to Fernanda. He writes from
This email address is being protected from spambots. You need JavaScript enabled to view it. toThis email address is being protected from spambots. You need JavaScript enabled to view it. . - The eMail is pushed into the mail server using the SMTP protocol; usually, this connection would take place using ports 465/tcp or 587/tcp.
- The mail server will query the DNS server to know where to send the message. DNS will return the MX record, if the MX record is missing, the Mail server will use the A or AAAA record.
- The message will be sent to the pointed server.
- The message will arrive in the server pointed by DNS answer and it will be stored in Fernanda's mailbox.
- Fernanda will query her mail server for any new messages. This transfer will be done using IMAP or POP protocols.
- Fernanda got a new e-mail!
Enjoy!