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: real@somewhere.net.

Right now I use nullmailer with the following setup:

# /etc/nullmailer/adminaddr

# /etc/nullmailer/defaultdomain

# /etc/nullmailer/defaulthost

# /etc/nullmailer/remotes
smtp.somewhere.net smtp

This setup works, except for addresses like pi@rpi1.example.com:

  • 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 MX of rpi1.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?

  • fwiw you can usually use /etc/aliases to specify a full email address for destination but only using the local username for the source. If you use postfix you would then set relayhost and myorigin as appropriate to send the emails to the upstream SMTP server. – Bratchley Apr 8 '15 at 10:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.