How to Set Up a Catch-All Email Address with Postfix
A catch-all email address receives every message sent to your domain that does not match an existing mailbox. This is useful for capturing mistyped addresses, handling legacy aliases, and ensuring no customer correspondence is lost. On your Breeze server running Postfix, setting this up takes just a few configuration changes.
Prerequisites
- A Breeze instance with Postfix installed and configured for your domain
- DNS MX records pointing to your Breeze server
- A dedicated user account to receive the catch-all mail
Step 1: Configure Virtual Alias Maps
Edit the Postfix main configuration file:
sudo nano /etc/postfix/main.cf
Add or update the virtual alias maps directive:
virtual_alias_maps = hash:/etc/postfix/virtual
Step 2: Create the Catch-All Entry
Open the virtual alias file and add the catch-all rule. The @ symbol followed by your domain name matches any address at that domain:
sudo nano /etc/postfix/virtual
Add the following line:
@yourdomain.com catchall@yourdomain.com
If you want to forward to a local system user instead:
@yourdomain.com localuser
Step 3: Build the Hash Map and Reload
Postfix uses hashed lookup tables for performance. Rebuild the map and reload the service:
sudo postmap /etc/postfix/virtual
sudo systemctl reload postfix
Step 4: Test the Configuration
Send a test email to a non-existent address at your domain and verify it arrives in the catch-all mailbox:
echo "Catch-all test" | mail -s "Test catch-all" randomname@yourdomain.com
Check the mail log to confirm delivery:
sudo tail -f /var/log/mail.log
Filtering and Managing Catch-All Mail
Catch-all addresses can attract a large volume of spam. Consider these best practices:
- Use Sieve filters — automatically sort catch-all mail into a separate folder for review
- Enable SpamAssassin — score and tag incoming messages before they reach the catch-all mailbox
- Monitor volume — set up a cron job to alert you if the catch-all volume exceeds a threshold
- Create explicit aliases — once you identify recurring addresses, add them as proper aliases so they bypass the catch-all
- Review periodically — check the catch-all folder weekly to discover addresses that need dedicated mailboxes
Important Considerations
If you are using virtual mailbox domains (with virtual_mailbox_maps), you need to add the catch-all to /etc/postfix/vmailbox instead of the virtual alias file. The entry format differs slightly:
@yourdomain.com yourdomain.com/catchall/
After editing, rebuild and reload:
sudo postmap /etc/postfix/vmailbox
sudo systemctl reload postfix
A catch-all is a practical safety net, but always pair it with proper spam filtering to keep your mailbox manageable.