Last week I took over the task of migrating sympa from a vserver machine to a xen vm. In the process I upgraded the sympa version and changed the MTA, from sendmail (ahhhhhhhhhh) to postfix. In my opinion sympa is designed to do far too many things just to be a mailing list manager. In particular, it has its own mail spool, it organizes mail delivering (via the MTA) and bounces.

Because of this design, the easiest way to configure it to work with postfix is to use it as a transport and let it do whatever … The problem with this configuration is that postfix doesn’t have any mean to know, for a give domain, which user (mailing list) is legal and which one is not. To get around this problem, one solution is to remove the local recipient check setting local_recipient_maps to empty. However this way, postfix will accept all emails, and subsequently generate a bounce if the local user doesn’t really exists. This can be used my spammers and it’s a very bad idea. The postfix manual explains this very well is bold.

To get around this problem, my simple solution then is to generate a postfix map to give back to postifx a bit more of control over this business.

Now, my local_recipient_maps looks like:

local_recipient_maps = $alias_maps, hash:/etc/postfix/sympa-recipients

and this is a small script I run every now and then to re-generate the hash table.

#!/bin/sh

for i in `ls /var/lib/sympa/expl/sympa.pps.jussieu.fr`; do 
    echo "$i unsed"; 
done > /etc/postfix/sympa-recipients
postmap /etc/postfix/sympa-recipients

/etc/init.d/postfix reload

for reference, this is the error you would get without local_recipient_maps.

sympa postfix / smtpd [12345]: NOQUEUE: reject: RCPT from xxxxxxxxxxx[xxx.xxx.xxx.xxx]: 550 5.1.1 test123@sympa.xxxx.org: Recipi ent address rejected: User unknown in local recipient table; from=me@ ex.org to=test123@sympa.xxxx.org proto=ESMTP helo=