With Postfix
Simple Aliases
Edit /etc/aliases:
# Redirect mail for specific users
info: [email protected]
support: [email protected], [email protected]
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
[email protected] [email protected]
[email protected] [email protected], [email protected]
@oldomain.com [email protected]sudo postmap /etc/postfix/virtualAdd to /etc/postfix/main.cf:
virtual_alias_maps = hash:/etc/postfix/virtualCatch-All Address
# In /etc/postfix/virtual
@example.com [email protected]Warning: 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