[exim] routing logic based on sender and recipient

Top Page
Delete this message
Reply to this message
Author: Florin Andrei
Date:  
To: exim-users
Subject: [exim] routing logic based on sender and recipient
I am banging my head against the wall trying to solve a routing problem
with a different MTA, and I'm getting nowhere.

I know Exim is very configurable, but I've never actually used it. I'd
like to setup a test instance and try to achieve the desired routing
algorithm. This is for a QA site which is a copy of the production site,
with some exceptions: e.g., emails generated during testing must be
routed locally, as opposed to blasting the Internet with bogus messages.
There are some extra twists as well.

The mail server is receiving email from several QA machines via SMTP,
and then delivers it according to various rules.

The logic is this:

1. All emails with a sender @boringdomain.com will be routed to the
Internet as if this was a plain relay, no exceptions, no special rules.
Basically, I need to punch a clean relay hole through the system for
these senders. If there's no match here, go to next rule:

2. All emails with a recipient within a very short list
(jim@???, joe@???) are delivered locally, and
will typically be processed by various scripts specified in ~/.forward.
If there's no match here, then next:

3. All emails with the recipient @fancydomain.com are to be delivered
via SMTP to relay1.fancydomain.com. If no match here, then:

4. All other emails will be delivered locally (and then will bounce with
user not found, and sent to a local account which is the sender for
these emails, and will get caught by other scripts).

I have rules 2-4 already implemented in a different MTA software for a
long time now and everything works great, I just can't do sender-based
routing before recipient-based for the new rule #1.

Could someone sketch an Exim config example that would achieve the logic
described above? Thank you.

--
Florin Andrei
http://florin.myip.org/