With Postfix
Simple Aliases
Edit /etc/aliases:
# Redirect mail for specific users
info: admin@example.com
support: admin@example.com, backup@example.com
webmaster: adminsudo newaliases # Rebuild alias database
sudo systemctl reload postfixVirtual Aliases
For domain-based forwarding, edit /etc/postfix/virtual:
# Forward any address at a domain
sales@example.com john@gmail.com
billing@example.com jane@gmail.com, accounting@company.com
@oldomain.com admin@example.comsudo postmap /etc/postfix/virtualAdd to /etc/postfix/main.cf:
virtual_alias_maps = hash:/etc/postfix/virtualCatch-All Address
# In /etc/postfix/virtual
@example.com catchall@example.comWarning: catch-all addresses receive all spam sent to random addresses at your domain.
SRS (Sender Rewriting Scheme)
When forwarding, SPF checks may fail because the forwarding server is not authorized to send for the original sender. SRS rewrites the envelope sender to fix this:
sudo apt install -y postsrsd
# Automatically integrates with Postfix