2

I'm trying to get spamassassin working on Ubuntu 16.04 with postfix.

When receiving mail, I get messages similar to the following in my logs:

Jun 11 14:29:47 myhost postfix/smtpd[2387]: connect from mail-oi0-f54.google.com[209.85.218.54]
Jun 11 14:29:47 myhost spamd[2349]: spamd: got connection over /var/spool/postfix/spamassassin/spamd.sock
Jun  11 14:30:17 myhost postfix/smtpd[2387]: warning: milter unix:/spamassassin/spamd.sock: unreasonable packet length: 1397768525 > 1073741823
Jun 11 14:30:17 myhost postfix/smtpd[2387]: warning: milter unix:/spamassassin/spamd.sock: read error in initial handshake
Jun 11 14:30:17 myhost spamd[2349]: spamd: timeout: (30 second socket timeout reading input from client)

I'm seeing that as two issues:

  1. Unreasonable packet length issue
  2. Timeout reading form socket when reading input

I have the following relevant packages installed:

  • postfix 3.1.0-3
  • spamassassin 3.4.1-3
  • spamass-milter 0.3.2-1

My /etc/default/spamass-milter just contains

OPTIONS="-u spamass-milter -i 127.0.0.1 -m -I -- --socket=/var/spool/postfix/spamassassin/spamd.sock"

/etc/default/spamassassin contains

SAHOME="/var/lib/spamassassin"
SAGLOBALCFGPATH="/etc/spamassassin"
ENABLED=1
OPTIONS="-x --max-children 5 --helper-home-dir /var/lib/spamassassin -u  debian-spamd -g debian-spamd --siteconfigpath /etc/spamassassin --socketpath=/var/spool/postfix/spamassassin/spamd.sock --socketowner=debian-spamd --socketgroup=debian-spamd --socketmode=0660"
PIDFILE="/var/run/spamd.pid"
CRON=1

In /etc/postfix/main.cf, I have the following milter related lines:

milter_default_action = accept
milter_connect_macros = j {daemon_name} v {if_name} _
non_smtpd_milters = $smtpd_milters
smtpd_milters = unix:/spamassassin/spamd.sock unix:/opendkim/opendkim.sock

Permissions on the sockets are good and they're where they need to be for postfix in chroot, and the postfix user is in the debian-spamd group.

$ ls -l /var/spool/postfix/spamassassin/spamd.sock
srw-rw----  1 debian-spamd debian-spamd    0 Jun 11 14:21 spamd.sock

Any help would be much appreciated:

Anonymouslemming
  • 801
  • 2
  • 14
  • 25

2 Answers2

2

TLDR: Your postfix is connecting to socket of spamd, but should connect to socket of spamass-milter, which stands in between. Look for definition of second socket in your spamass-milter configuration/startup (/etc/init.d/spamass-milter) scripts.

Explanation (based on my Gentoo config, /etc/conf.d/ is similar to /etc/default/): Chain looks like this:

POSTFIX >spamass-milter.sock> MILTER >spamd.sock> SPAMD

  • /etc/postfix/main.cf

    unix:/var/run/milter/spamass-milter.sock

  • /etc/conf.d/spamass-milter

    SOCKET=/var/run/milter/spamass-milter.sock OPTIONS="-i 127.0.0.1 -m -I -- --socket=/var/spool/postfix/spamassassin/spamd.sock"

  • /etc/conf.d/spamd

    --socketpath=/var/spool/postfix/spamassassin/spamd.sock

P.S. Thanks goes to Debugging spamassassin with postfix

  • 1
    I am having the somewhat similar problem. This is what I get warning: connect to Milter service unix:/spamass/spamass.sock: No such file or directory – Gacci Mar 10 '19 at 11:04
-1

I have read this article and found that it is for Debian, but may also be applied for Ubuntu. http://www.stefan-seelmann.de/wiki/mailserver-postfix-dovecot

K-ICT
  • 1
  • Welcome to ServerFault. https://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links-elsewhere-really-good-answers Can you expand this so your answer can stand on its own? – chicks Apr 26 '17 at 18:57
  • 1
    Keep the link, but summarize the part of the page that applies to the question. In 5 years this q&a may still exist, but the link may be dead. Use this to guide you in how much to include in your answer. – Jeter-work May 11 '17 at 16:08