Im administering a bunch of development and staging debian (v.6-8) servers. The current exim4 setup looks like this:
- There are no incoming mails on the servers (no wan connection)
- Outgoing mails are send via a smarthost (this is currently working)
Since the stage and dev servers email functionality will be tested through web apps and there are real world scenario email addresses set up in our web applications,
The setup that I want to achive is:
- All outgoing mails should be forwarded by a catchall statement to one
single email address, for example devmail@1234oursmarthost.com - All outgoing mails, that contain our companies domains, like *@example.com and *@foo.com should bypass the catchall rule.
The tutorial, that is closest to my goal is this, even if it uses the opposite
strategy: Allow all senders and deny one sender.
https://serverfault.com/a/577007/322673
Any help is really appreciated, since I'm going to be nuts on exim config syntax.
I'd been through a whole lot a configuration samples for days now, but none of them are matching my use case.
Best Answer
As Exim processes mail in the order specified in the routers section, I guess it can be achieved with the following rules. Be sure to put rule for the special domains first and then the catch all rules.
According to Exim documentation:
The first rule above tells exim to send all emails with a sender domain example.com to be sent without doing anything special. The second rule is a catch all for all emails. You can give it a try.
Here is the relevant discussion: http://www.gossamer-threads.com/lists/exim/users/97056