Catch-All email account is used to collect all emails sent to any email of a domain. It helps us to avoid losing emails due to misspelled addresses. While using the catch-all address you may receive spam messages and many other bounce messages that sent to
any-email (at) your-domain.com.
This tutorial will help you to set up a catch-all email address with a postfix server.
Step 1 – Setup Catch-All Account
A catch-all account can be created by adding a virtual aliases to the postfix server. To add an alias edit /etc/postfix/virtual configuration file:
Then add a catch-all address like below:
You may also have some actual email accounts on your domain and you need to forward emails of that accounts to the correct mailbox. Then you can also create virtual alias for that email address and forward it to specific user’s mailboxes. Use the below configuration, which will send all emails to user “myuser” except emails of [email protected] and [email protected]
myuser[email protected] info[email protected] support
Save and close configuration file, then execute the following command to create or update hash file.
The above command will create
/etc/postfix/virtual.db file in your system. Which will be used by the Postfix server.
Step 2 – Update Postfix Configuration File
Now, you need to add virtual_alias_maps to the Postfix main configuration file. Just edit Postfix configuration file /etc/postfix/main.cf in your favorite text editor:
Add the following entry to the end of the file
virtual_alias_maps = hash:
Save the file and close it.
Step 3 – Reload Postfix Server
After making all the changes, reload the postfix service to apply all settings. Use the following command to reload the postfix configuration.
systemctl reload postfix
You have completed postfix catch-all email setting configuration. Click here to read more about catch all account.