FS#20936 - [spamassassin] 3.3.1 + perl 5.1 + claws-mail, Claws cannot see spamd running & fails to filter

Attached to Project: Arch Linux
Opened by Jeff Meldrum (jspaces) - Friday, 24 September 2010, 23:43 GMT
Last edited by Florian Pritz (bluewind) - Monday, 16 January 2012, 08:57 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Paul Mattal (paul)
Florian Pritz (bluewind)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description: Spamassassin does not follow the latest perl folder structure. When I would start Claws-mail, the spamassassin plugin would state that the spamd daemon was not running when in fact it was. I recompiled spamassassin and changed the /etc/rc.d/spamd script (attached) to reflect the new perl path the compiled abs spamassassin (nothing was changed in the PKGBUILD file) with the latest perl. Afterwards, claws-mail spamassassin plugin would no long complain and would filter the mail.


Additional info: I did not have any problems before perl 5.1 with spamassassin, everything just worked. After perl 5.1, spamd complains from claws-mail-spamassassin plugin would appear. Now it works as before perl 5.1 was introduced.

* package version(s)
spamassassin 3.3.1-2
perl 5.12.1-2
claws-mail 3.7.6-1
claws-mail-extra-plugins 3.7.6-4

* config and/or log files etc.


Steps to reproduce: Just start up claws-mail and the spamassassin plugin would complain that spamd was not running. Even if I #/etc/rc.d/spamd restart, the issue remained.
   spamd (1 KiB)
This task depends upon

Closed by  Florian Pritz (bluewind)
Monday, 16 January 2012, 08:57 GMT
Reason for closing:  Fixed
Additional comments about closing:  spamassassin 3.3.2-3
Comment by kang (kang) - Friday, 23 September 2011, 23:06 GMT
I don't think this is "very low", it breaks spamd which is commonly used on mail servers.
Anyhow, spamd will fail to restart regardless of the setup, because pidof will always fail to get the PID.

Here's a decent way to fix that "IMO":

- enforce -r /var/run/spamd.pid argument
- use that pid for stopping spamd.

Eg:

File: /etc/rc.d/spamd
[...]
PIDFILE=/var/run/spamd.pid
if [ -f $PIDFILE]; then
PID=$(cat $PIDFILE)
else
PID=$(pidof -o %PPID /usr/bin/vendor_perl/spamd) #backward compat
fi
[...]
start)
stat_busy "Starting spamd"
[ -z "$PID" ] && /usr/bin/vendor_perl/spamd -d -r $PIDFILE ${SPAMD_OPTS}
[...]
stop)
stat_busy "Stopping spamd"
rm $PIDFILE
[ ! -z "$PID" ] && kill $PID &> /dev/null
[...]

And that's it, fixed.
I'm using that on my box because it annoyed me. Since every time you update rules with sa-update you need to restart spamd.
Comment by kang (kang) - Friday, 23 September 2011, 23:08 GMT
Note (and sorry for the double comment):
I added this because it's going to work no matter what happens with perl in the future, aka a fix that'll work probably forever.

Loading...