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.