I have a headless server (rpi1.example.com) with two active accounts: pi and root. I would like all the emails sent to these accounts to be redirected to an external address: [email protected].
Right now I use nullmailer with the following setup:
# /etc/nullmailer/adminaddr
[email protected]
# /etc/nullmailer/defaultdomain
example.com
# /etc/nullmailer/defaulthost
rpi1
# /etc/nullmailer/remotes
smtp.somewhere.net smtp
This setup works, except for addresses like [email protected]:
- an email to that address is generated on
rpi1.example.com - ... which sends it out via
smtp.somewhere.net - ... which then tries to resend it to the
MXofrpi1.example.com - ... which does not exist as no email is expected to arrive there
How to setup this "outbound-only" MTA which would redirect/forward all internal emails to a single address?