Linux – Redirect mail from system user account to real email account

emaillinuxpostfixusers

First, I would like to thank you for your time.

I've come to the following situation:

  • I've got a mail server named mx1.domain.com

  • This mail server is virtual hosting some domains mail accounts like user1@somedomain.org, user1@someotherdomain.net

  • As long as the hostname for the server is (and should be so the SMTP Banner is the same hostname as the IP rdl to) mx1.domain.com the default Postfix accounts and server accounts postmaster@mx1.domain.com hostmaster@mx1.domain.com ... are binded to the real hostname, not virtuals.

  • I've got a simple user for login through ssh, and I've set up my /etc/aliases so the email for all those 'default' addresses go to root user and then I set up root mail to get into my login user instead.

How can I get all those emails, that my system and users send to those default addresses on a real email account? Like one of those that I virtual host.

Best Answer

I assume, that POSTFIX is your local MTA. Thus the following should solve your problem:

echo "yourdestination@domain.com" > $HOME/.forward

(http://www.postfix.org/local.8.html)

Related Topic