Docs / Email Servers / How to Configure Email Forwarding with Postfix

How to Configure Email Forwarding with Postfix

By Admin · Mar 2, 2026 · Updated Apr 23, 2026 · 29 views · 3 min read

How to Configure Email Forwarding with Postfix

Email forwarding allows you to redirect messages from one address to another without requiring the sender to know the final destination. On a Breeze server with Postfix, you can set up both individual forwards and domain-wide forwarding rules using virtual alias maps.

Prerequisites

  • Postfix installed and operational on your Breeze instance
  • Valid DNS MX records for your domain
  • Root or sudo access to edit Postfix configuration

Simple Forwarding with Virtual Aliases

The most common approach uses Postfix virtual alias maps. Edit the main configuration:

sudo nano /etc/postfix/main.cf

Ensure the virtual alias maps line is present:

virtual_alias_maps = hash:/etc/postfix/virtual

Adding Forward Rules

Open the virtual alias file and add your forwarding entries:

sudo nano /etc/postfix/virtual

Each line maps a source address to one or more destinations:

# Forward a single address
sales@yourdomain.com       john@example.com

# Forward to multiple recipients
info@yourdomain.com        alice@example.com, bob@example.com

# Forward an entire domain to another
@olddomain.com             @newdomain.com

# Keep a local copy while forwarding
support@yourdomain.com     support@yourdomain.com, backup@example.com

Applying the Changes

sudo postmap /etc/postfix/virtual
sudo systemctl reload postfix

Forwarding with SRS (Sender Rewriting Scheme)

When forwarding mail, SPF checks can fail because the original sender did not authorize your server. SRS rewrites the envelope sender to preserve SPF alignment:

sudo apt install -y postsrsd

Edit /etc/default/postsrsd:

SRS_DOMAIN=yourdomain.com
SRS_EXCLUDE_DOMAINS=yourdomain.com

Then add to main.cf:

sender_canonical_maps = tcp:localhost:10001
sender_canonical_classes = envelope_sender
recipient_canonical_maps = tcp:localhost:10002
recipient_canonical_classes = envelope_recipient
sudo systemctl enable postsrsd
sudo systemctl restart postsrsd
sudo systemctl reload postfix

Using .forward Files

For local system users, you can create a .forward file in their home directory instead of editing Postfix maps:

echo "destination@example.com" > /home/username/.forward
chown username:username /home/username/.forward
chmod 644 /home/username/.forward

This approach is simpler for individual users but does not scale well for many addresses.

Verifying Your Forwards

Use the postmap query command to confirm your mappings:

postmap -q "sales@yourdomain.com" hash:/etc/postfix/virtual

Send a test message and monitor the mail log:

sudo tail -f /var/log/mail.log

Look for status=sent entries showing the forwarded destination to confirm everything is working correctly.

Best Practices

  • Always configure SRS — prevents forwarded messages from failing SPF at the final destination
  • Avoid open relays — only forward for domains you control in virtual_alias_domains
  • Log and monitor — track forward volumes to detect abuse or loops
  • Test with external senders — internal tests may not reveal SPF or DKIM issues

Was this article helpful?