This past weekend, I had my first request to set up a catch-all address for a domain in Tiger server. It’s fairly simple, and it requires some command line interaction.
The idea of a catch-all address for a domain is to have all e-mail intended for recipients that are unknown or don’t exist delivered to a certain user or users. Since Tiger uses Postfix as the mail transfer agent, we follow the usual directions for setting up this feature in Postfix.
The first step is to edit or create a file named /etc/postfix/virtual.cf. That file didn’t exist on my server, but it may exist on yours. Use this command to create or edit an existing copy as root:
<code>sudo nano /etc/postfix/virtual.cf</code>
The next step is to add the existing e-mail addresses in that domain to the file. This might be tedious, but its necessary. If you don’t include these addresses, all e-mail sent to any user in the domain will be delivered to everyone in the domain. That’s usually bad.
The format is the e-mail address followed by the user’s short name on one line. The final line catches all the e-mail sent to the domain for unknown or non-existent users and sends it to the short name you specify. Lines beginning with # are comments.
<code># Catch-all address for example.com domain [email protected] bob [email protected] jim [email protected] fred @example.com bob</code>
Add new domains and users as necessary. Press control-x to exit from nano and save the changes.
Now we need to map the new addresses so Postfix recognizes them.
<code>sudo postmap /etc/postfix/virtual.cf</code>
The next step is an either-or kind of thing. The Postfix MTA has to be restarted. Probably the safest way to do it is to stop and start the mail service in Server Admin. Alternately, you can restart Postfix from the command line.
<code>sudo postfix reload</code>
Now all e-mail sent to example.com that is destined for unknown users will be delivered to [email protected]