Postfix - Redirecting email to address

After starting fresh with a clean installation of Debian 6 on my Linode, following this great guide on the Linode library, I went to the sometimes daunting task of setting up mail. With some time and effort I managed to get Postfix/amavisd-new/clamav/SpamAssassin and dovecot working wonderfully.

What I'd like to do now, however, is work out a way that mail coming to certain addresses can be redirected to me. For example, I want mail addressed to postmaster@example.com to be redirected to me@example.com, if that makes sense. I tried Googling and all the suggestions pointed towards /etc/aliases, but according to the man pages that file is just for local accounts and not for virtual domains.

If someone could let me know how I would be able to accomplish this, I would really appreciate it.

EDIT: Okay, so I found that /etc/aliases is actually the solution, but I figured out that it only correctly redirects mail sent to postmaster@host.example.com and not postmaster@example.com. How can I make Postfix redirect that mail?

EDIT 2: I poked around some more and found that adding an entry in the forwardings table in the MySQL database pointing from postmaster@example.com to me@example.com, it does work! Is this the correct method of doing this? It just feels a little redundant since I already have /etc/aliases pointing to correct addresses.

2 Replies

If you are using virtual domains, you should stick with that and do your configuration of mailboxes there and leave /etc/aliases alone.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct