[Dovecot Antispam] Can't seem to load plugin
Hello list,
I'm hoping there is a user of the antispam plugin out there who might be able to lend a pointer or two.
I am running dovecot 2.2.18 on FreeBSD 10 (doveconf -n attached), where I have installed the binary dovecot2-antispam-plugin package. I have put together what should, in my estimation, be a working configuration for the plugin. I have reviewed the man page and the online documentation, and I think at the *very least* I should be seeing errors for something not working correctly. However, what I have is a great deal more troubling.
There is no sign on the plugin even attempting to load. No log entries, no errors, nothing. The plugin is definitely in the right place with the right name, since I let the package manager handle all of that for me
root@zerolag:~ # ls -l /usr/local/lib/dovecot/lib90_antispam_plugin.so -rwxr-xr-x 1 root wheel 32488 Jul 2 09:41 /usr/local/lib/dovecot/lib90_antispam_plugin.so
I am unable to make any sense of this. Thanks in advance for any pointers :)
-- James Lott
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
James Lott wrote:
There is no sign on the plugin even attempting to load. No log entries, no errors, nothing. The plugin is definitely in the right place with the right name, since I let the package manager handle all of that for me
first, enabled logging: http://wiki2.dovecot.org/Logging
mail_debug=yes
Steffen -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin)
iQEVAwUBVawFmHz1H7kL/d9rAQLKBAgAmELgzEkoejk3myXxpW7DQIBroRI05lSo RtL/MWm2rMtSuY+97cVgnX/8c6V/m6Ea5KgGyhMm4I/ZBfEHW2RsEeLQ4qEUzs+m d8dESDFjyB/3ILmTctjaVecHBAn0UXZOHouiCuq7lROKwT4/XVZ7kO+Sjm30mtlw yxw0+E41RDbS3pzDjrrKpkE968DtqWo3wM7mCq49zqcyEZClF/EIwmqRVEVAD7BT ZspsI74iU0ZdDQiAMi26boc96Gz1IJRFl0g2TxVtKard02p1fNkGxm6JER5onxgz 2VgTP7hUJy54PFhyxQQ4Mmo+gXwxokmJ+icFVsBFv7Rqsf93ps/ZXQ== =tpQW -----END PGP SIGNATURE-----
Thanks for the pointer! Thanks to the enabled debug logging, I can now see that the plugin is at least loading
root@zerolag:/usr/local/etc/dovecot # grep antispam /var/log/debug.log Jul 19 20:02:30 zerolag dovecot: imap(james.lott): Debug: Module loaded: /usr/local/lib/dovecot/lib90_antispam_plugin.so Jul 19 20:02:35 zerolag dovecot: imap(james.lott): Debug: Module loaded: /usr/local/lib/dovecot/lib90_antispam_plugin.so Jul 19 20:02:46 zerolag dovecot: imap(james.lott): Debug: Module loaded: /usr/local/lib/dovecot/lib90_antispam_plugin.so Jul 19 20:04:20 zerolag dovecot: imap(james.lott): Debug: Module loaded: /usr/local/lib/dovecot/lib90_antispam_plugin.so
That seems to be about all I get though. Still nothing to indicate errors, and nothing to indicate that anything is being done when I move messages into spam. I suppose that probably means I've configured the folder paths incorrectly. I'll have to keep beating my head against it and see where it takes me.
On Sunday, July 19, 2015 22:16:25 Steffen wrote:
James Lott wrote:
There is no sign on the plugin even attempting to load. No log entries, no errors, nothing. The plugin is definitely in the right place with the right name, since I let the package manager handle all of that for me
first, enabled logging: http://wiki2.dovecot.org/Logging
mail_debug=yes
-- Steffen
-- James Lott
That seems to be about all I get though. Still nothing to indicate errors, and nothing to indicate that anything is being done when I move messages into spam. I suppose that probably means I've configured the folder paths incorrectly. I'll have to keep beating my head against it and see where it takes me.
it would help to see your dovecot -n output here.
- christian
On 2015-07-20 08:20, Christian Kivalo wrote:
That seems to be about all I get though. Still nothing to indicate errors, and nothing to indicate that anything is being done when I move messages into spam. I suppose that probably means I've configured the folder paths incorrectly. I'll have to keep beating my head against it and see where it takes me.
it would help to see your dovecot -n output here.
Ok, found it in the first mail...
Do these folders exist in the filesystem? The case matches? I use antispam_{spam,trash}_pattern_ignorecase and don't care about the case of the folders...
plugin { antispam_backend = crm114 antispam_crm_args = --fileprefix=/home/%u/spamdb/ antispam_crm_binary = /usr/local/etc/dovecot/filter/mailreaver.crm antispam_debug_target = syslog antispam_signature = X-CRM114-CacheID antispam_spam = Spam antispam_trash = Trash antispam_unsure = INBOX/Suspect
i don't know crm114 but this looks ok to me.
you could try
antispam_verbose_debug = 1
to get more verbose logging from the antispam plugin
regards
- christian
So I modified my configuration a couple times just to try and get any results from the plugin. I commented out my backend configuration, and finally got the plugin to log something.
root@zerolag:/usr/local/etc/dovecot # grep antispam /var/log/maillog Jul 20 05:27:50 zerolag dovecot: imap(james.lott): Error: antispam plugin backend is not selected for this user
At this point, I'll take it.
After that I modified my antispam configuration and changed up my directory hierarchy a bit
root@zerolag:/home/james.lott/mail # ls -1 .Archive .Drafts .Notes .Sent .Spam .Suspect .Trash cur dovecot-uidlist dovecot-uidvalidity dovecot-uidvalidity.55a4236f dovecot.index dovecot.index.cache dovecot.index.log dovecot.index.log.2 dovecot.index.thread dovecot.mailbox.log new subscriptions tmp
plugin { antispam_debug_target = syslog antispam_verbose_debug = 1 antispam_trash_pattern_ignorecase = Trash antispam_spam_pattern_ignorecase = Spam antispam_unsure_pattern_ignorecase = Suspect antispam_backend = spool2dir antispam_spool2dir_spam = /home/%u/unprocessed/spam-%%lu-%%lu antispam_spool2dir_notspam = /home/%u/unprocessed/ham-%%lu-%%lu }
After reloading with this configuration and moving a piece of spam into the spam folder...
root@zerolag:/home/james.lott/mail # ls -lah ../unprocessed/ total 12 drwxr-xr-x 2 james.lott mail 512B Jul 20 05:50 . drwxr-xr-x 9 james.lott mail 1.0K Jul 20 05:44 .. -rw------- 1 james.lott mail 2.1K Jul 20 05:50 spam-1437396653-1
Success! Unfortunately, though, I also noticed that action was not logged. So it seems that logging in this plugin is just completely bunk.
Still no dice after switching to the crm backend though, so something about the way I've set that up must not be working. This is mega progress though. Thanks for the tips everyone!
On Monday, July 20, 2015 08:39:54 Christian Kivalo wrote:
On 2015-07-20 08:20, Christian Kivalo wrote:
That seems to be about all I get though. Still nothing to indicate errors, and nothing to indicate that anything is being done when I move messages into spam. I suppose that probably means I've configured the folder paths incorrectly. I'll have to keep beating my head against it and see where it takes me.
it would help to see your dovecot -n output here.
Ok, found it in the first mail...
Do these folders exist in the filesystem? The case matches? I use antispam_{spam,trash}_pattern_ignorecase and don't care about the case of the folders...
plugin { antispam_backend = crm114 antispam_crm_args = --fileprefix=/home/%u/spamdb/ antispam_crm_binary = /usr/local/etc/dovecot/filter/mailreaver.crm antispam_debug_target = syslog antispam_signature = X-CRM114-CacheID antispam_spam = Spam antispam_trash = Trash antispam_unsure = INBOX/Suspect
i don't know crm114 but this looks ok to me.
you could try
antispam_verbose_debug = 1
to get more verbose logging from the antispam plugin
regards
- christian
-- James Lott
So after being totally dumbfounded by what the hell could possibly be happening in the CRM114 backend that would just produce silent failure, I decided to go for a wrapper script using the mailtrain backend. Here's what I drummed up
plugin { antispam_trash_pattern_ignorecase = Trash antispam_spam_pattern_ignorecase = Spam antispam_unsure_pattern_ignorecase = Suspect antispam_backend = mailtrain antispam_mail_sendmail = /usr/local/etc/dovecot/filter/mailreaver.sh antispam_mail_sendmail_args = %h antispam_mail_spam = --spam antispam_mail_notspam = --good }
Where mailreaver.sh is:
#!/bin/sh #DEBUG=1 TARGET='mailreaver.crm' USRHOME=$1 ACTION=$2 SPAMDB="$USRHOME/spamdb" LOGFILE="$USRHOME/logs/antispam" DEBUGLOG='/dev/null' test $DEBUG && DEBUGLOG="$LOGFILE" STAMP=$(date +'[%Y %b %d %H:%M:%S]') exec 1>>$DEBUGLOG exec 2>>$LOGFILE cd $SPAMDB printf '%s In %s: Executing: %s\n' "$STAMP" "$PWD" "./$TARGET $ACTION"
$LOGFILE exec ./$TARGET $ACTION
Using this method I figured out that the problem was I had neglected to set mailtrainer.crm as executable. A very simple oversight, but one that was insanely frustrating to figure out since it wasn't producing any log messages. I think I'll continue to use this backend so that I can log each action, and would personally recommend that anyone using CRM do something similar rather than using the builtin CRM backend. Hopefully this is helpful to someone, someday :)
On 2015-07-20 05:59, James Lott wrote:
So I modified my configuration a couple times just to try and get any results from the plugin. I commented out my backend configuration, and finally got the plugin to log something.
root@zerolag:/usr/local/etc/dovecot # grep antispam /var/log/maillog Jul 20 05:27:50 zerolag dovecot: imap(james.lott): Error: antispam plugin backend is not selected for this user
At this point, I'll take it.
After that I modified my antispam configuration and changed up my directory hierarchy a bit
root@zerolag:/home/james.lott/mail # ls -1 .Archive .Drafts .Notes .Sent .Spam .Suspect .Trash cur dovecot-uidlist dovecot-uidvalidity dovecot-uidvalidity.55a4236f dovecot.index dovecot.index.cache dovecot.index.log dovecot.index.log.2 dovecot.index.thread dovecot.mailbox.log new subscriptions tmp
plugin { antispam_debug_target = syslog antispam_verbose_debug = 1 antispam_trash_pattern_ignorecase = Trash antispam_spam_pattern_ignorecase = Spam antispam_unsure_pattern_ignorecase = Suspect antispam_backend = spool2dir antispam_spool2dir_spam = /home/%u/unprocessed/spam-%%lu-%%lu antispam_spool2dir_notspam = /home/%u/unprocessed/ham-%%lu-%%lu }
After reloading with this configuration and moving a piece of spam into the spam folder...
root@zerolag:/home/james.lott/mail # ls -lah ../unprocessed/ total 12 drwxr-xr-x 2 james.lott mail 512B Jul 20 05:50 . drwxr-xr-x 9 james.lott mail 1.0K Jul 20 05:44 .. -rw------- 1 james.lott mail 2.1K Jul 20 05:50 spam-1437396653-1
Success! Unfortunately, though, I also noticed that action was not logged. So it seems that logging in this plugin is just completely bunk.
Still no dice after switching to the crm backend though, so something about the way I've set that up must not be working. This is mega progress though. Thanks for the tips everyone!
On Monday, July 20, 2015 08:39:54 Christian Kivalo wrote:
On 2015-07-20 08:20, Christian Kivalo wrote:
That seems to be about all I get though. Still nothing to indicate errors, and nothing to indicate that anything is being done when I move messages into spam. I suppose that probably means I've configured the folder paths incorrectly. I'll have to keep beating my head against it and see where it takes me.
it would help to see your dovecot -n output here.
Ok, found it in the first mail...
Do these folders exist in the filesystem? The case matches? I use antispam_{spam,trash}_pattern_ignorecase and don't care about the case of the folders...
plugin { antispam_backend = crm114 antispam_crm_args = --fileprefix=/home/%u/spamdb/ antispam_crm_binary = /usr/local/etc/dovecot/filter/mailreaver.crm antispam_debug_target = syslog antispam_signature = X-CRM114-CacheID antispam_spam = Spam antispam_trash = Trash antispam_unsure = INBOX/Suspect
i don't know crm114 but this looks ok to me.
you could try
antispam_verbose_debug = 1
to get more verbose logging from the antispam plugin
regards
- christian
participants (4)
-
Christian Kivalo
-
James Lott
-
james@lottspot.com
-
Steffen