How to forward root mail to another account

An alias allows to redirect mail sent to a given address.

Mail alias database is usually kept in flat-text format in the file /etc/aliases

# /etc/aliases
mailer-daemon: postmaster
postmaster: root

This aliases postmaster to root, so that any mail sent to postmaster will instead be delivered to root.

So to redirect root mail to a real email account just add this line:

# /etc/aliases
mailer-daemon: postmaster
postmaster: root
root: real@email.com

or if you do not want to see any of that mail change it to:

root          : /dev/null

Every time you make changes to /etc/aliases, you must run newaliases to update the database.

dovecot: lmtp(): Fatal: Error reading configuration: Invalid settings: postmaster_address setting not given

I was reconfiguring Postfix to include SpamAssassin, ClamAV and Sieve and somehow I managed to break something 🙂
Emails began to stuck up in queue and /var/log/mail.err was showing:

dovecot: lmtp(5680): Fatal: Error reading configuration: Invalid settings: postmaster_address setting not given

After some research on DuckDuckGo I found the fix:

 nano /etc/dovecot/conf.d/20-lmtp.conf

and add

 protocol lmtp {
 postmaster_address = postmaster@domainname # required
 mail_plugins = quota sieve
 }

then restart postfix and dovecat and we are back in action again.

Some reference here