2

Given an email transaction to multiple recipients on two different domains bar1 and bar2:

  • RCPT TO:a@bar1.com
  • RCPT TO:b@bar1.com
  • RCPT TO:c@bar2.com
  • RCPT TO:d@bar2.com

This email is sent to a relay. I wonder how does it relay the email to the 4 recipients on 2 different domains.

  • Does it groups the recipient per domain and initiates an email transaction per group ?
  • Does it create a transaction per recipient ?

What is the most common behaviour?

Thanks.

3 Answers3

3
  • Does it groups the recipient per domain and initiates an email transaction per group ?

This is the most common behavior. The exact behavior is implementation specific.

longneck
  • 23,202
  • @Craig-Watson answers is different from yours. Have you more information to support your answer ? – Nicolas Labrot Mar 28 '17 at 14:37
  • @NicolasLabrot as I said in my reply on my own answer, technically both answers are correct. Theoretically it's possible but in practice an MTA is rarely that intelligent and will treat the messages as separate emails. – Craig Watson Mar 28 '17 at 14:42
  • By chance, my sysadmin was up for a test. I have test with this relay chains postfix => exchange => ironport => internet. An email with 4 recipients/2 domains leads to 2 transactions on Ironport, one per domain and whatever the recipient order. I'm not sure yet if it is Exchange or Ironport which split the email. – Nicolas Labrot Mar 28 '17 at 15:19
  • Contrary to Criag's experience, my experience is that modern MTA's will group messages by domain. Modern MTA's will also send multiple messages in the same connection. So if you and your co-worker both send an email to the same domain, both will be delivered in the same TCP connection. – longneck Mar 28 '17 at 15:44
2

Upon receipt of an email with multiple RCPT TO addresses, an MTA will most likely break the message into separate emails, and will treat each as a new message.

For four different recipients, the relay will receive one and forwards four different emails. Grouping/batching is beyond the scope of a mail relay.

If you are writing an MTA, it is possible to introduced some grouping/batching of emails with the same domain (so emails 1+2 and 3+4), but in practice MTAs such as Postfix or Exim will not do this.

Craig Watson
  • 9,670
  • 3
  • 33
  • 47
  • Your answer is different from the @longneck one. Does it apply to a specific MTA? – Nicolas Labrot Mar 28 '17 at 14:23
  • @NicolasLabrot the SMTP protocol does allow the same connection to be used for multiple messages, so theoretically it is possible. However most (if not all) MTAs will close the connection after each message, so in reality it won't be used like this. – Craig Watson Mar 28 '17 at 14:24
  • Do you agree my question is not about grouping/batching different email but an email with multiple RCPT TO with different domain? – Nicolas Labrot Mar 28 '17 at 14:31
  • @NicolasLabrot Upon receipt of the email, the relay breaks the message up into four messages, and will treat them as individual messages. – Craig Watson Mar 28 '17 at 14:32
  • Using this relays chain postfix => exchange => ironport => internet the email recipients are split by domain. It could be different with postfix at the end of the chain. Thanks for your help – Nicolas Labrot Mar 28 '17 at 15:26
1

SMTP protocol allows for multiple messages to be sent using the same SMTP connection. Each message can be sent using the well-known commands:

MAIL FROM: sender@domain1.com
RCPT TO: recipient@domain2.com
DATA
Message body goes here
.

You can keep the same connection open and re-issue these commands for another message.

How it is implemented may be a different story and there is no obligation to re-use the same connection.

Khaled
  • 36,903
  • 1
    My qestion is about a message with multiple RCPT TO with different domain. What is the relay behaviour? – Nicolas Labrot Mar 28 '17 at 14:29
  • @NicolasLabrot: Different domains most likely means different destinations and so different connections. Grouping messages per connection/transaction can be good when connection establishment/teardown is costly. Is this your case? – Khaled Mar 28 '17 at 14:40