configuring sympa with postfix

Tagged:  

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 [at] sympa [dot] xxxx [dot] org>: Recipi ent address rejected: User unknown in local recipient table; from=<me@ ex.org> to=<test123 [at] sympa [dot] xxxx [dot] org> proto=ESMTP helo=<xxxxxxxxxxxxxxxx>

Thanks for this comment, it helped me out. I didn't really use your solution, because of the batch process, but "local_recipient_maps =" in main.cf turned out to be useful.
Do you really think it could be such a big security issue?

It can be used to run a DoS attach to your mail server. If you accept everything and the
you delegate sympa to reject the un-existent domains, you can easily take sympa to its
knees. Sympa has this stupid design where it want to be a bit MTA and a bit MDA.

I don't have a choice here, but I'd advice you to trow away sympa and use mailman that
has much better architecture.

pietro