I am wondering why SMTP is designed in a way which allows intermediate MTA on the path of a message. According to RFC 5321,

The objective of the Simple Mail Transfer Protocol (SMTP) is to transfer mail reliably and efficiently.

Although I don't completely understand what are the benefits in terms of efficiency nor reliability here. For example, when a user agent submits a message into a mail system, as far as I know, there is no guarantee that the message finally gets into the destination mailbox. According to RFC mentioned above, MTA may reply to originator with an email message reporting the delivery error (DSN). However, server may be unable to deliver this report error either. So which reliability is RFC speaking about? IMO, much more reliable approach would be connecting to the end server and submit message directly. If the connection failed, or the server rejected the message, the sender knows for sure that the delivery failed.

I've been digging for the rationale of such mail transport scheme in SMTP RFC, A. Tanenbaum's "Computer networks", and many resources on the net. None of them gave me clear understanding of the e-mail routing purpose. However, I can think of the following explanations:

1) Less connections required to send messages. Imagine we are in a company network with it's own MTA acting as a relay. Many people can send messages to, say, gmail.com SMTP server. If everyone would connect to gmail.com directly, the number of connections on the server would grow. Instead, our company's relay server can open a single TCP connection to gmail.com and transmit all the messages over a single connection. Thus the load of the destination server is lowered.

2) There could be some traffic/antispam control configured on an intermediate MTA, thus reducing the load of the destination server as well.

3) In case of multiple destinations, multiple intermediate MTAs can be used to deduplicate messages. For example, single instance of a message is passed to top.com, then it is split to two servers mid1.top.com and mid2.top.com and so on. Otherwise we would have to open distinct TCP connections to every destination and copy message to each of them.

All of the above is my guess. The question is whether this is true, and if there are any other reasons of e-mail routing in SMTP design.

  • Please keep questions on this site to actual problems that you are solving not open ended discussion questions. – Catherine MacInnes Feb 2 '16 at 19:00
  • @CatherineMacInnes Thank you. Are you aware of any StackExchange site where the discussion on this subject wouldn't be off-topic? – Oleg Andriyanov Feb 2 '16 at 20:31

A common use case is if the target destination is temporarily offline, the sender may attempt to deliver to an intermediate host (typically the service provider of the target destination) with a higher MX record number. The intermediate host would periodically attempt delivery, and when the target destination host comes back online, the messages are delivered.

Reliable in this context simply means "do not lose or discard the message without attempting to notify the sender". Sure, with an application or message queue that you control, it is normal to want to know about errors right away (fail fast). And others have observed here before that the queuing of SMTP messages at intermediate hosts may produce undesirable results, due to you often learn days later that the message was not delivered. But this is the system we have, and it is up to the receiving system and the intermediaries they choose to use to make the judgement call on how long the message should be queued, not the sender.

You are correct on #2, services like MessageLabs do precisely this. If junk/malware can be intercepted before they arrive at the target destination, that is less work for the destination. In that scenario, the intermediate host would have the MX record number that is lower than the actual target.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.