On 21 Mar 2021, at 12:54, Steve Dondley wrote:

I'd like to configure postfix so the configuration settings in the per-user configuration file at ~/.spamassassin/user_prefs get applied.

This user_prefs config file is used with the spamassassin command as evidenced with spamassassin -D < spam.txt. But as far as I can tell, the user_prefs file is ignored when used with postfix. I've got these lines line in my master.cf file:

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

This is due to the fact that when you run the 'spamassassin' script you are running the SpamAssassin perl code directly, but when you use 'spamc' you are running a tiny client program that passes the message to the 'spamd' daemon over a socket, and that daemon is where the SpamAssassin perl code is actually run. To make SpamAssassin per-user configuration (and Bayesian filtering) work with the spamc/spamd mechanism, you need to specify the recipient in the spamc arguments with "-u ${recipient}" so that it can tell spamd what user config to load. Also, the '-f' argument is obsolete in SA 3.x (the "safe-failback" mode is now the default) so you can remove that. To make per-recipient config work with virtual addresses you would also need additional configuration of spamd.

You can get a more complete explanation from the spamc and spamd documentation and by asking on the [email protected] mailing list, as this is really a SpamAssassin question, not a Postfix issue.

--
Bill Cole
[email protected] or [email protected]
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Not Currently Available For Hire

Reply via email to