Articles September 22, 2005 at 9:26 pm

Setting up a catch-all e-mail address in Tiger Server

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].

No Comments

  • I can’t seem to get this to work. I’ve added all of the email addresses and
    shortnames as instructed to but I still get messages bounced back when
    they’re sent to a non-existant user:

    <[email protected]>: host /var/imap/socket/lmtp[/var/imap/socket/
    lmtp]
    said: 550-Mailbox unknown. Either there is no mailbox associated with this
    550-name or you do not have authorization to see it. 550 5.1.1 User
    unknown
    (in reply to RCPT TO command)
    Reporting-MTA: dns; homestar.example.com
    X-Postfix-Queue-ID: 1B88315BF06
    X-Postfix-Sender: rfc822; [email protected]
    Arrival-Date: Sat, 24 Sep 2005 13:26:36 +0100 (BST)

    any ideas?

    Cheers

    Stu

  • The ‘catchall’ address on Settings page is (I presume) applicable to ALL mail
    which goes through the server. If you have different domains with different
    users (virtual domains), you need to set up an individual catchall for each
    virtual domain.

    I have not tried it but I presume this is the reason for doing it as per the tip.

Leave a reply

You must be logged in to post a comment.