C
Let's say we wrote a letter from our drawer. user@gmail.com for test@mail.ru♪ The letter is transmitted from the web form to MTA (Mail Transfer Agent - Postal Agent) Google, which is beginning to process it. MTA may be any - sendmail, postfix, MS Exchange, etc., the procedure is uniform everywhere.At the beginning, the MTA gives out the name of the consignor (in our case - mail.ruAnd sends the DNS request "what MX records are on this dome?" The thing is, for the mail, there are their own records in DNS, so-called MX-MX-Mail Exchanger, which contain names. IP addressI mean, Names Domen's mail servers! DNS sends a list of mail servers. MTA takes one of the names he received and sends the DNS request "to this name IP?" DNS server sends an address (possibly not one) for name, followed by MTA joining the address and SMTP stationary protocol (or ESMTP) transmits a letter to the recipient ' s mail server. The recipient's server puts a letter in his internal letter repository. test@mail.ru and waiting for the user to connect and read his mail.The user may not use a web interface, but contact MTA by means of a separate postal client programme (Mozilla Thunderbird, The Bat, etc.). But the thing is, the SMTP protocol doesn't fit for this, it's designed to exchange data between servers. There are two other protocols here. POP3 and IMAP♪ For the client, the difference between them is almost non-existent, but they're completely different. IMAP more modern and smart, POP3 More old and stupid. (If there's a chance, show IMAP.) These protocols are responsible for the transfer of mail between the client programme and the MTA. If SMTP is single-directed (only shipment), the customer records are double-tracked (receipt and receipt).There's another interesting piece. MX records may have a few. So the domen may have several mail servers. Why would you want that? Any DNS names have a few IP addresses, so why make the painting difficult? And then that MX records have something that A's missing-- priority♪ All IPs for a single name are even-priority, but for MX records, they can be labelled "weight." "weight" is an intact whole number and the smaller it is, the higher the priority of this recording. MTA always tries at the outset to connect with a server with a higher priority and only if it fails to do so will move to a lower priority server.