Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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


By posting your answer, you agree to the privacy policy and terms of service.

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