What I want to do is set up a sendmail server that accepts mail from everyone to a particular domain (say, example.com
), then for a list of defined recipients sends that mail onto specified third-party addresses, and relays everything else onto a specific IP address.
I've tried this:
[root@splitter mail]# cat relay-domains
example.com
[root@splitter mail]# cat virtusertable
[email protected] [email protected]
and forwarding of most of the domain works fine - it's delivered to the host specified by example.com
's MX - but the exception ([email protected]
) is ignored
I've tried this:
[root@splitter mail]# cat local-host-names
example.com
[root@splitter mail]# cat mailertable
example.com esmtp:[1.2.3.4]
[root@splitter mail]# cat virtusertable
[email protected] [email protected]
and then the exception mail is correctly split off, but any other user is bounced locally (User unknown
). I've tried adding this to virtusertable
:
@example.com %[email protected]
but (probably unsurprisingly) this results in rewrite: excessive recursion (max 50), ruleset canonify
errors.
I'd prefer sendmail-based solutions, because I can try those quickly. If I don't get any luck with that, I'll open this up to other MTAs. If anyone has any ideas about how to do this, I'd really appreciate them.
Let's try this:
Naturally this does not scale well if you want to make it workable for more than 10 users and you need to make it work with a map, but I've stopped being a Postmaster since 5/2014 and I am a little rusty. I can make it work with an external map if you like though.
As always remember that in your
sendmail.mc
the left hand side of a rule is separated from right hand side with tabs and not spaces, so do not copy-paste. Also remember to rebuild yoursendmail.cf
afterwards and test usingsendmail -bt
:If all works as expected restart sendmail.