[Dovecot] dovecot + antispam plugin - no retraining
Hi,
dovecot -n
# 2.1.7: /etc/dovecot/dovecot.conf # OS: Linux 3.8.0-0-generic x86_64 Ubuntu Raring Ringtail (development branch) listen = 10.10.200.39 login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c mail_debug = yes mail_location = maildir:~/Maildir managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave namespace inbox { inbox = yes location = prefix = } passdb { driver = pam } plugin { antispam_backend = pipe antispam_mail_notspam = ham@example.org antispam_mail_sendmail = /usr/sbin/sendmail antispam_mail_sendmail_args = -f;%u@example.org antispam_mail_spam = spam@example.org antispam_mail_tmpdir = /tmp antispam_signature = X-DSPAM-Signature antispam_signature_missing = error antispam_spam_pattern_ignorecase = SPAM;Junk antispam_trash = trash;Trash;Deleted Items; Deleted Messages mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename sieve = ~/.dovecot.sieve sieve_dir = ~/sieve } protocols = " imap sieve pop3" service auth { unix_listener /var/spool/postfix/private/dovecot-auth { group = postfix mode = 0660 user = postfix } } service imap-login { inet_listener imaps { port = 993 ssl = yes } } ssl_cert = was automatically rejected:%n%r }
filesystem is ext4 antispam util is dspam
I'm trying to utilize the imap plugin antispam for retraining spam/ham when moving mail from/to spam folders.
antispam plugin is loaded and imap service itself runs correctly logfile excerp for login: Jan 16 21:04:33 mailhost dovecot: imap: Debug: Loading modules from directory: /usr/lib/dovecot/modules Jan 16 21:04:33 mailhost dovecot: imap: Debug: Module loaded: /usr/lib/dovecot/modules/lib90_antispam_plugin.so Jan 16 21:04:33 mailhost dovecot: imap(user): Debug: Effective uid=1001, gid=1001, home=/home/user Jan 16 21:04:33 mailhost dovecot: imap(user): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:~/Maildir Jan 16 21:04:33 mailhost dovecot: imap(user): Debug: maildir++: root=/home/user/Maildir, index=, control=, inbox=/home/user/Maildir, alt= Jan 16 21:04:34 mailhost dovecot: imap-login: Login: user=<user>, method=PLAIN, rip=10.10.99.205, lip=10.10.200.39, mpid=5936, TLS Jan 16 21:04:34 mailhost dovecot: imap: Debug: Loading modules from directory: /usr/lib/dovecot/modules Jan 16 21:04:34 mailhost dovecot: imap: Debug: Module loaded: /usr/lib/dovecot/modules/lib90_antispam_plugin.so Jan 16 21:04:34 mailhost dovecot: imap(user): Debug: Effective uid=1001, gid=1001, home=/home/user Jan 16 21:04:34 mailhost dovecot: imap(user): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:~/Maildir Jan 16 21:04:34 mailhost dovecot: imap(user): Debug: maildir++: root=/home/user/Maildir, index=, control=, inbox=/home/user/Maildir, alt=
When I move mail into or out of imap folders named Junk or SPAM I would expect, that the antispam plugin kicks in and pipes the mail to dspam. Apparently this does not happen, nothing gets piped, though the mail is still moved to the folder.
I've already tried dspam-exec as a backend as well, but that fails even ealier right after imap login with: Jan 16 19:26:15 mailhost dovecot: master: Dovecot v2.1.7 starting up (core dumps disabled) Jan 16 19:26:45 mailhost dovecot: imap-login: Login: user=<user>, method=PLAIN, rip=10.10.99.205, lip=10.10.200.39, mpid=4701, TLS Jan 16 19:26:45 mailhost dovecot: imap: Debug: Loading modules from directory: /usr/lib/dovecot/modules Jan 16 19:26:45 mailhost dovecot: imap: Debug: Module loaded: /usr/lib/dovecot/modules/lib90_antispam_plugin.so Jan 16 19:26:45 mailhost dovecot: imap(user): Debug: Effective uid=1001, gid=1001, home=/home/user Jan 16 19:26:45 mailhost dovecot: imap(user): Fatal: master: service(imap): child 4701 returned error 3
settings were: antispam_backend = dspam-exec antispam_dspam_binary = /usr/bin/dspam antispam_dspam_args = --client;--source=error;--user;%u;--signature=%%s
I've also tried with: antispam_backend = dspam-exec antispam_dspam_binary = /usr/bin/dspam antispam_dspam_args = --source=error;--user;%u
those settings actually do not produce the problem after the imap login, but they still do not react to moving mail into/from spam folders.
I've also tried to utilize antispam_spam = Junk or antispam_spam_pattern = SPAM instead of antispam_spam_pattern_ignorecase = SPAM;Junk but neither makes a difference.
Thx in advance for any advice.
kind regards, Michael Moerz
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, 16 Jan 2013, Michael Moerz wrote:
plugin { antispam_backend = pipe
Er, this module is called "mailtrain", isn't it? At least in antispam changeset 50:0319240072d8. You should get an error "configured non-existent antispam backend: pipe"
antispam_mail_notspam = ham@example.org antispam_mail_sendmail = /usr/sbin/sendmail
You could replace this program by a shell script to get the info, that it is called, e.g.:
==== /usr/local/bin/mailtrain.sh #!/bin/bash
( date id -a echo "$@" /usr/sbin/sendmail "%@" rc=$? echo rc=$rc exit $rc ) >>/tmp/mailtrain.log 2>&1
So you see, if the program is fired up and which uid is used and what problem sendmail had.
Kind regards,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUPfPjV3r2wJMiz2NAQL5Swf/X8UYD0PH/WG1qUp9QkzqCCaq0U33aTCU qGy9nYAHjvaXbjv9iDOorTb9kOdX0ApkliHtGnSWTOB9aJSwltDk2Cg+AFLudZaa UoyBE67P3XajPh4hxJ7Q/qaMDmqSnOV7W2bvMuQXe0tWgA19dppQIHCN+P0tUhva p3UiQGShp2yCOW9lPGCrVxALyv/0IeJzNzfRjIf7bfd586HCxuNWirPRP4VQ8Dni oz2KLIwABGlaCl5dk+d6r0OrTnln0YpHWfa2vDpOShqLN4J0AncQoDV4VBqEYUyH HzD1SEhTHU++bVWvni7vrGPVa9LEy/4vdPzeBkHcVlbowOzn5zokoA== =9u45 -----END PGP SIGNATURE-----
On Thursday, January 17, 2013 11:16:45 AM Steffen Kaiser wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, 16 Jan 2013, Michael Moerz wrote:
plugin {
antispam_backend = pipe
Er, this module is called "mailtrain", isn't it? At least in antispam changeset 50:0319240072d8. You should get an error "configured non-existent antispam backend: pipe" tmp = getenv("BACKEND", getenv_data); if (tmp) { if (strcmp(tmp, "crm114") == 0) cfg->backend = &crm114_backend; else if (strcmp(tmp, "dspam") == 0) cfg->backend = &dspam_backend; else if (strcmp(tmp, "pipe") == 0) cfg->backend = &pipe_backend; else if (strcmp(tmp, "spool2dir") == 0) cfg->backend = &spool2dir_backend; else { debug(&cfg->dbgcfg, "selected invalid backend!\n"); exit(3); }
probably i fail to see something important here, but to me 'pipe' seems correct.
antispam_mail_notspam = ham@example.org antispam_mail_sendmail = /usr/sbin/sendmail
You could replace this program by a shell script to get the info, that it is called, e.g.:
This is really a nifty idea, i'll give it a try and report back on that.
kind regards, Michael Moerz
participants (2)
-
Michael Moerz
-
Steffen Kaiser