Sunday, 11 March 2012

Two gotchas with Postfix, Dovecot, Amavis and Clamav on Debian Squeeze

1. The first problem was when this error appeared in /var/log/mail.log:


Mar 10 16:56:39 mailhost amavis[2877]: (02877-01) (!)ClamAV-clamd av-scanner FAILED: CODE(0x358cef8) unexpected , output="/var/lib/amavis/tmp/amavis-20120310T165639-02877/parts: lstat() failed: Permission denied. ERROR\n" at (eval 103) line 594.


The problem is that clamav requires access to files created by amavis. We fix this by putting amavis and clamav in each other's group.



usermod -a -G clamav amavis
usermod -a -G amavis clamav

Then restart amavis and clamav-daemon.

2. The second problem was when postfix could not authenticate incoming SMTP connections by chaining to dovecot's auth process, resulting in this message in /var/log/mail.log:

Mar 10 18:28:14 mailhost postfix/smtpd[7217]: warning: SASL: Connect to /var/run/dovecot/auth-client failed: No such file or directory

The problem is that postfix runs chrooted by default in Squeeze and this named pipe is outside of the chroot tree. To fix it we tell dovecot to use this path instead:



/var/spool/postfix/private/auth-client


Then in /etc/postfix/main.cf we specify the path to the named pipe with:



smtpd_sasl_path = private/auth-client


It's a path relative to $queue_directory which is /var/spool/postfix.

1 comment:

  1. Hi,

    Thank you for your page.
    Recently I setup a homemade e-mail server and wrote a full detailed tutorial that you can find in

    http://cosmolinux.no-ip.org/raconetlinux2/mail.html

    using Debian Squeeze, Postfix, Dovecot, SASL, Spamassassin and Squirrel (and a Google account for SMTP relay).

    I wish it is helpful to someone.

    ReplyDelete