I have a mailserver running postfix and spamassassin. I have a user 'user1' and 
an alias 'alias1', like this in /etc/aliases:

    alias1: user1

I have spamassassin configured with bayes filtering enabled, but when I receive 
mail at ali...@mydomain.com, spamassassin appears to not be able to find the 
user 'alias1' (when it should be looking for the user 'user1'). This makes the 
suid fail which makes the per-user bayes database for 'user1' not useable when 
receiving mail sent to 'alias1'. The log lines look like:

    Mar 14 21:39:23 mydomain spamd[2552]: spamd: connection from localhost 
[127.0.0.1] at port 35315
    Mar 14 21:39:23 mydomain spamd[2552]: spamd: handle_user unable to find 
user: 'alias1'
    Mar 14 21:39:23 mydomain spamd[2552]: spamd: still running as root: user 
not specified with -u, not found, or set to root, falling back to nobody
    Mar 14 21:39:23 mydomain spamd[2552]: spamd: processing message 
<5630197031309924...@anotherdomain.com> for alias1:65534
    Mar 14 21:39:24 mydomain spamd[2552]: plugin: eval failed: bayes: (in 
learn) locker: safe_lock: cannot create tmp lockfile 
/nonexistent/.spamassassin/bayes.lock.mydomain.com.2552 for 
/nonexistent/.spamassassin/bayes.lock: No such file or directory
    Mar 14 21:39:24 mydomain postfix/local[11388]: A59D61BABAC: 
to=<us...@mydomain.com>, orig_to=<ali...@mydomain.com>, relay=local, delay=4.2, 
delays=4.2/0/0/0.01, dsn=2.0.0, status=sent (delivered to command: 
/usr/bin/procmail -t -a "$EXTENSION")

How do people normally work around this? Is there some way to indicate to 
spamassassin that it should check /etc/aliases for the user-mapping if the user 
isn't found?

Relevant configuration follows. In /etc/spamassassin/local.cf:

    use_bayes 1
    bayes_auto_learn 1
    skip_rbl_checks 0
    use_razor2 1
    razor_config /etc/razor/razor-agent.conf

spamassassin's cmdline looks like this:

    /usr/sbin/spamd --create-prefs --max-children 2 --helper-home-dir -d 
--pidfile=/var/run/spamd.pid
    /usr/sbin/spamass-milter -P /var/run/spamass/spamass.pid -f -p 
/var/spool/postfix/spamass/spamass.sock -u spamass-milter -i 127.0.0.1 -I -r 14 
-m

And in /etc/postfix.conf:

    smtpd_milters = unix:/spamass/spamass.sock

Reply via email to