How To Redirect One Users Mail To Another User with Postfix MTA

Postfix is an open source mail transfer agent (MTA), for the routing and delivery of email. This post examples how to forward an email to another local or remote email user using Postfix MTA.

It provides a method of redirect mail to another user for both local and remote users. You need to configure /etc/postfix/aliases (or use /etc/aliases) file. The aliases file (read as table) provides a system-wide mechanism to redirect mail for local recipients. The redirections are processed by the Postfix local delivery agent.

Normally, the aliases table is specified as a text file that serves as input to the postalias command. The result, an indexed file in dbm or db format, is used for fast lookup by the mail system. Execute the command newaliases in order to rebuild the indexed file after changing the Postfix alias database.

Open file /etc/postfix/aliases using vi text editor:
# vi /etc/postfix/aliases

Now add line as follows:
abuse:,,, postmaster

Save and close the file. The abuse name is the local address which be receiving the mail on the local machine. is the email address on another domain to forward to (the value can be a username on the local machine or the email address). This can be a single or multiple values separated by commas.

To redirect root email to tom user:
root: tom

Type newaliases command to build new database:
# newaliases
To troublshoot problem further see postfix server log file:
# tail -f /var/log/maillog
## OR Debian/Ubuntu ##
# tail -f /var/log/mail.log

Sample outputs

Jan  8 03:56:33 www330 postfix[13209]: p089uXvh013209: from=root, size=29, class=0, nrcpts=1, msgid=<>, relay=root@localhost
Jan  8 03:56:33 www330 postfix[13210]: p089uXZH013210: from=, size=337, class=0, nrcpts=1, msgid=<>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain []
Jan  8 03:56:33 www330 postfix[13209]: p089uXvh013209: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30029, relay=[] [], dsn=2.0.0, stat=Sent (p089uXZH013210 Message accepted for delivery)
Jan  8 03:56:34 www330 postfix[13211]: STARTTLS=client,, version=TLSv1/SSLv3, verify=FAIL, cipher=AES256-SHA, bits=256/256
Jan  8 03:56:36 www330 postfix[13211]: p089uXZH013210:, ctladdr= (0/0), delay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=30576, [], dsn=2.0.0, stat=Sent (Thanks)

The above output indicates that mail sent to local root account is forwarded to via smtp server called If you do not have admin access to the mail server, use the .forward file from your own home directory to forward an email to another account.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 9 comments so far... add one
CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
9 comments… add one
  • Tim Jan 8, 2011 @ 8:56

    Hi Vivek !
    Nice article! That’s what i’m looking for!
    But the last link … .forward … is broken. Could you fix it, please?

  • nader Jul 6, 2012 @ 8:28

    Thanks for the article.

    What about if I want to forward one single email from one managed smtp to another?
    For example to
    or to user2(local user)

    Thanks in advance

  • nader Jul 9, 2012 @ 9:36

    OK, I answering my own question!
    I can achive this behaviour by using virtual(5).

    see man 5 virtual

  • Mike Newman Sep 22, 2012 @ 6:24

    What’s wrong:
    bleach:postfix mnewman$ cat aliases
    root: mnewman
    postmaster: root
    bleach:postfix mnewman$ sudo postconf -n | grep ^alias
    alias_database = hash:/etc/postfix/aliases
    alias_maps = hash:/etc/postfix/aliases
    bleach:postfix mnewman$ sudo postmap -q root hash:/etc/postfix/aliases
    bleach:postfix mnewman$ sudo postmap -q mnewman@bleach.local hash:/etc/postfix/generic

    But, it doesn’t happen. Mail sent to mnewman just ends up in the local mailbox:

    Sep 22 13:23:24 bleach postfix/pickup[2899]: A19BF350A52B: uid=502 from=
    Sep 22 13:23:24 bleach postfix/cleanup[2995]: A19BF350A52B: message-id=
    Sep 22 13:23:24 bleach postfix/qmgr[2898]: A19BF350A52B: from=, size=301, nrcpt=1 (queue active)
    Sep 22 13:23:24 bleach postfix/local[2997]: A19BF350A52B: to=, orig_to=, relay=local, delay=0.1, delays=0.09/0/0/0.01, dsn=2.0.0, status=sent (delivered to mailbox)

    What have I done wrong?

  • Brad May 5, 2013 @ 14:10

    Is there a way to redirect email sent from a user to a manager for review and acceptance?

  • Recipient address rejected: User unknown in virtual mailbox table Oct 1, 2013 @ 20:15

    Recipient address rejected: User unknown in virtual mailbox table

  • Randy Crump Aug 14, 2020 @ 17:12

    Sweet info. Thanks
    /var/log/mailog is spelled with two l’s

    • 🐧 Vivek Gite Aug 15, 2020 @ 8:25

      Thanks for heads up. The post has been updated.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum