1

I implemented spamassassin mailfiltering in my postfix setup using the -o content_filter=spamassassin and a transport like this:

spamassassin   unix  -       n       n       -       -       pipe
   user=spamassassin argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

Next, I would like to implement user-based spamassassin preferences by sql using the user_prefs option as described here.

  • How is this setup going to handle aliases?
  • Is spamassassin going to be called BEFORE alias expansion?
  • If this is the case, the whole user based preferences configuration is pretty much ruined. Are there any ways to implement complete user based preferences even with aliases?

1 Answer 1

1

I investigated this by creating a wrapper script around sendmail (as it got ${recipient} as argument anyway).

#!/bin/bash
echo "$@" >> /var/log/sendmail-test.log
/usr/sbin/sendmail-orig "$@"

This little piece of code actually revealed that aliases seem to be processed before being handed over to spamassassin. Thats great.

Another important thing I noticed while doing this is, that it's important to include a line like this in your main.cf:

spamassassin_destination_recipient_limit = 1

If you don't, ${recipient} is going to contain multiple users which is going to crash the user based preferences as well.

When having a setup like this, spamc might get called many many times with the same mail but just different user over and over again. This leads to another question: How does spamassassin handle mails with the same content, but just a different recipient?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .