spamassassin broken error control on bad UNIX socket parameter

Bug #1178826 reported by Kip Warner
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SpamAssassin
Unknown
Unknown
spamassassin (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

For each attempt to scan an email for junk via spamassassin, the following is noted in /var/log/mail.err:
    spamc[7611]: connect(AF_UNIX) to spamd failed: Connection refused

I am using evolution 3.6.4.

My SpamAssassin appears to be configured correctly from what I can see as well:

$ cat /etc/default/spamassassin
# /etc/default/spamassassin
# Duncan Findlay

# WARNING: please read README.spamd before using.
# There may be security risks.

# Change to one to enable spamd
ENABLED=1

# Options
# See man spamd for possible options. The -d option is automatically added.

# SpamAssassin uses a preforking model, so be careful! You need to
# make sure --max-children is not set to anything higher than 5,
# unless you know what you're doing.

OPTIONS="--create-prefs --max-children 5 --helper-home-dir"

# Pid file
# Where should spamd write its PID to file? If you use the -u or
# --username option above, this needs to be writable by that user.
# Otherwise, the init script will not be able to shut spamd down.
PIDFILE="/var/run/spamd.pid"

# Set nice level of spamd
#NICE="--nicelevel 15"

# Cronjob
# Set to anything but 0 to enable the cron job to automatically update
# spamassassin's rules on a nightly basis
CRON=1

The process appears to be running as well:

$ ps aux | grep spam
kip 2789 0.0 0.8 131616 32988 ? S May09 0:09 /usr/bin/perl -T -w /usr/sbin/spamd --socketpath /run/user/kip/spamd-socket-path-2WUQWW --max-children=1 --pidfile /run/user/kip/spamd-pid-file-JWUQWW
kip 2805 0.0 1.3 141548 52784 ? S May09 0:08 spamd child
root 18498 0.0 1.4 155436 57264 ? Ss 13:47 0:01 /usr/sbin/spamd --create-prefs --max-children 5 --helper-home-dir -d --pidfile=/var/run/spamd.pid
root 18551 0.0 1.4 159100 60480 ? S 13:48 0:00 spamd child
root 18552 0.0 1.3 155436 54692 ? S 13:48 0:00 spamd child
kip 23006 0.0 0.0 16632 944 pts/10 S+ 14:28 0:00 grep --color=auto spam

This was working fine in 12.04, but stopped working upon a fresh install to 13.04.

Tags: patch
Revision history for this message
Kip Warner (kip) wrote :

This is still driving me nuts. Any help appreciated.

Kip Warner (kip)
no longer affects: evolution
no longer affects: evolution (Ubuntu)
Revision history for this message
Kip Warner (kip) wrote :

So the problem turns out to be two in number. The first is Evolution appears to be invoking spamc incorrectly. The second is spamc is not handling some error control properly. I've provided a patch to address the latter.

Kip Warner (kip)
summary: - Evolution spamassassin integration not working 13.04
+ spamassassin broken error control on bad UNIX socket parameter
Revision history for this message
C de-Avillez (hggdh2) wrote :

Patch has been refused upstream. Why isn't there a task against an Ubuntu package?

Revision history for this message
Kip Warner (kip) wrote :

It actually looks like its being modified. As for a task against an Ubuntu package, I'm not sure how to do that. Thanks for your help.

Revision history for this message
James Page (james-page) wrote :

Raising a distro task.

Kip - it looks like at least part of a fix has been committed upstream - please could you re-work the merge proposal.

I'll make some comments on the merge proposal directly re how to make the branch look right.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Written against r17546 of branch bzr+ssh://bazaar.launchpad.net/+branch/spamassassin." seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Kip Warner (kip) wrote :

Hey James. I just replied to your comment on the merge proposal. Thanks.

Changed in spamassassin (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

As commented in the merge request, since upstream fixed this in a different way, I don't think we should be carrying a distro patch just to get some more debugging information.

NACK.

Revision history for this message
Kip Warner (kip) wrote :

Hey Marc. Sadly I haven't had time to properly prepare the merge request as Dmitry had requested. It's up to you if you'd like to merge it or not. The patch merely addresses a symptom of larger architectural problem which cannot be fixed without a major overhaul. Namely, a migration to a DBus system and session service interfaces for MUAs so that they need not rely on cumbersome, problematic, and archaic searching for running processes, using direct UNIX sockets, unreliable getopt interfaces, etc.

Revision history for this message
Tim Day (timday) wrote :

I came across this same issue recently on Debian/Wheezy while trying to enable Evolution's built-in spamassassin checking.

As noted at some length in the upstream Spamassassin issue, it's not really a spamassassin issue at all (beyond quibbling over error message helpfulness) and seems more to do with a bad invokation of spamc by Evolution.

As far as I was concerned, the fundamental issue was actually why wasn't Evolution using my perfectly good system spamd instead of creating per-user ones and trying to use some complicated socket mechanism to communicate with it.

Anyway, I fixed that issue by a handful of mods to the sources to change upstream source's mentions of /usr/bin/spamd to the correct /usr/sbin/spamd (and also one mention of /usr/sbin/spamc to the correct /usr/bin/spamc but I'm not sure if that was important as Evolution seems to find spamc just fine anyway ) and now I have Evolution using my system spamd as expected just fine. More details at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=724884

Revision history for this message
Bryce Harrington (bryce) wrote :

Closing as expired, it looks like upstream addressed the main part of the problem. In the intervening years it's likely other changes have addressed other aspects. If there are remaining issues, it'd be better to open fresh bug reports on them.

Changed in spamassassin (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.