Take the 2-minute tour ×

I was wondering how to distinguish inbound from outbound SMTP transactions.

Normally this would be a straightforward question, however my SMTP server has to handle a special case:

  • Other domains might point to my MX domain (mail address aliases)

What outbound criteria should I check for? Is it as simple as checking if the transaction is authenticated (via the AUTH command), or do any other rules apply (derived from the FROM/RCPT addresses)? I guess alias addresses can be detected by resolving their MX?

share|improve this question
The side that sends the first TCP packet with the SYN flag set is who determines if it is inbound or outbound. Some more context here would have made this a better question. –  Zoredache Dec 6 '12 at 23:36
What are you talking about? I'm talking about SMTP not TCP. A SMTP connection can be inbound or outbound (relay) regardless of your SYN flags. –  Erik Aigner Dec 7 '12 at 5:05

1 Answer 1

up vote 3 down vote accepted

If the sender is in your domain, it's outbound.

If the recipient is in your domain, it's inbound.

If neither are in your domain, it's relay, and drop it like a hot potato.

share|improve this answer
What if both are in my domain? –  Erik Aigner Dec 7 '12 at 5:23
Then it's entirely local. –  Michael Hampton Dec 7 '12 at 5:24
I guess I'm just over-thinking this... –  Erik Aigner Dec 7 '12 at 5:36

Your Answer


