"the site for those who crave disappointment"

Sponsored Links

Mailing Lists in Postfix with Virtual Domains

5th May 2006, 11:07:15

By James Stocks

The 'official' way of creating mailing lists with postfix doesn't work with virtual domains, here's the trick...

Normally, you'd just create an /etc/aliases file like this:

allstaff: lister3@blah.blah

My mailing list is called 'allstaff'. It doesn't work with virtual domains with no local mail, because it results in postfix trying to deliver the message back to itself:

May  5 08:37:45 localhost postfix/smtp[3196]: 7C2143F427: to=<>, relay=none, delay=1, status=bounced (mail for loops back to myself)

I needed to create some virtual aliases to specify that the list was really on this server:

allstaff: allstaff@localhost
owner-allstaff: owner-allstaff@localhost
allstaff-request: allstaff-request@localhost

I store my aliases in a mysql database. If you need them in a flat file, put them in /etc/postfix/virtual and edit /etc/postfix/

virtual_alias_maps = hash:/etc/postfix/virtual

Now, you can create the aliases in /etc/aliases:

allstaff: lister3@blah.blah

Now run newaliases. If you have a lot of recipients, it's not that great having to have them all on one line in /etc/aliases. If you like, you could create /etc/postfix/allstaff, put all the addresses on one per line, and replace the allstaff: line in /etc/aliases with:

allstaff: :include:/etc/postfix/allstaff

New Comments

Some Rights Reserved