Hi, I have installed dovecot-antispam and configured it this way (as in the doc) with the dspam exe: protocol imap { mail_plugins = antispam mail_plugin_dir = /usr/lib64/dovecot/imap } plugin { # For dovecot-antispam: antispam_signature = X-DSPAM-Signature antispam_trash = trash;Trash;Deleted Items antispam_spam = SPAM;Junk #antispam_unsure = unsure antispam_dspam_binary = /usr/bin/dspam antispam_dspam_args = --deliver=;--user;%u antispam_mail_tmpdir = /tmp } But it does not work and really I cannot figure it out for two days, because I can find no log wherever, where it writes it does (or try to do) something, nor in the dovecot logs, nor in the dspam logs. But I know something is happening because when I try to move a spam from my inbox to the Junk folder, it fails with an error telling it could not move the email. At the opposite, when I deactivate the antispam plugin, I can move normally the emails. So what could I do to fix my issue or at least diagnose it (where would I find logs of what is happening?)? Thanks. Jehan
Tue, Feb 03, 2009 at 03:29:40PM +0100, Jehan Pag?s wrote:> Hi, > > I have installed dovecot-antispam and configured it this way (as in the doc) > [...] > But it does not work and really I cannot figure it out for two days, because > I can find no log wherever, where it writes it does (or try to do) > something, nor in the dovecot logs, nor in the dspam logs. But I know > something is happening because when I try to move a spam from my inbox to > the Junk folder, it fails with an error telling it could not move the email. > At the opposite, when I deactivate the antispam plugin, I can move normally > the emails. > So what could I do to fix my issue or at least diagnose it (where would I > find logs of what is happening?)?Hi, did you get 'Failed to call dspam' [1] or 'Antispam signature not found' [2] error? The second should not appear for dovecot >=1.1.7 (thanks Timo! ;) I was getting [1] - don't know why this error shows, cause my log said, that dspam was already called with correct parameters I had to patch dovecot-antispam sources to make it work. Apply the following patch and compile dovecot-antispam again: --- dspam-exec.c.orig 2008-11-11 16:02:20.000000000 +0100 +++ dspam-exec.c 2008-11-11 16:02:30.000000000 +0100 @@ -178,13 +178,14 @@ int ret = 0; while (item) { - if (call_dspam(item->sig, item->wanted)) { + /* if (call_dspam(item->sig, item->wanted)) { ret = -1; mail_storage_set_error(ctx->box->storage, ME(NOTPOSSIBLE) "Failed to call dspam"); break; - } + } */ + call_dspam(item->sig, item->wanted); item = item->next; } It works for me now (dovecot-1.1.10, dovecot-antispam-1.1, FreeBSD Current) with this entries in dovecot.conf: antispam_dspam_binary = "/usr/local/bin/dspam" antispam_dspam_args = --source=error antispam_dspam_args = --user=%u Hope it helps. Cheers, -- Marcin Rzepecki m.rzepecki(at)iem.pw.edu.pl
Hi Marcin and everyone, On Tue, Feb 3, 2009 at 7:08 PM, Marcin Rzepecki <m.rzepecki at iem.pw.edu.pl>wrote:> Tue, Feb 03, 2009 at 06:14:08PM +0100, Jehan Pag?s wrote: > > Hi, > > > > first of all, thanks for the answer. > > "(Un)fortunately", I don't have these error messages. For information, I > am > > using dovecot 1.1.7r1, compiled from the Gentoo package repository and > the > > only enabled debug I set was "mail_debug = yes". > > The file where I see all debug messages is /var/log/messages, which is > the > > one where all messages from dovecot and postfix are stored under Gentoo > > apparently. > > > > I am recompiling the package with "debug" to see if I see any more debug > > messages. I will make more tests and try to understand this all better, > > because currently it is pretty messy in my head as well about how all > this > > work together (postfix, dovecot, dspam, antispam plugin, etc.). I will > keep > > you up to date, but if ever you have any idea, don't hesitate... > > Hi, > > please, don't forget to CC: your replies to dovecot at dovecot.org, maybe > solution would be helpfull for someone else :) >yes sorry for this. I though I was replying to the whole ml. Apparently the ml is not very well configured because a reply does not reply to the whole ml, but to the single sender. I will take care now.> > Errors which I wrote are sent to IMAP client, so are you getting > getting eg. some pop-up window in your client with error message while > trying to move message?I was using the RoundCube web client on my server and had no such message. It was just telling me that it could not move the message. I configured a Thunderbird then and it displayed indeed this message 'Failed to call dspam'. So I made your trick, I compiled myself the dovecot-antispam library and now I can move messages... But are you sure that it is the right method and that the dspam training is indeed called? Because if I read well this piece of code, it looks like it was checking if the dspam training was successful. We commented out this check, so now maybe it fails and we copy the messages anyway to Junk/ even though no training really occurred. And when I check the logs or the dspam_stats, I don't see any change, even though I guess this retraining should be seen as a change in the stats, no?> > Antispam plugin is easy to understand: when you configure antispam_spam > = SPAM it will set SPAM folder as his special folder to observe. When > You get e-mail that was classified incorrect by DSPAM, you can move it > to SPAM folder. Antispam plugin will trigger dspam command to mark this > message as retrained-spam. You can do this of course in reverse order - > moving message _from_ SPAM folder to another will run dspam and mark > message as innocent. Message you are moving must have X-DSPAM-Signature > header (you can check in msg source to see if dspam adds it correctly) >I have the header on every emails. By the way, when one has the item "X-DSPAM-Result: Innocent" in the header, it means the email is not a spam, does'nt it (right now I am focusing on having this plugin working for training purpose, but currently not much is working perfectly as expected in my email spam system)?> > You can provide some info from your log files, i'll try to help. Debug > flag for plugin should effect with some info in debug-logs: > Dec 15 23:54:18 freebsd imap: antispam: plugin initialising (1.1-notgit) > Dec 15 23:54:18 freebsd imap: antispam: no trash folders > Dec 15 23:54:18 freebsd imap: antispam: "SPAM" is spam folder > Dec 15 23:54:18 freebsd imap: antispam: no unsure folders > Dec 15 23:54:18 freebsd imap: antispam: dspam binary set to > /usr/local/bin/dspam > Dec 15 23:54:18 freebsd imap: antispam: dspam extra arg > --user=dump-capability > Dec 15 23:54:18 freebsd imap: antispam: signature header line is > "X-DSPAM-Signature" > Dec 15 23:54:18 freebsd imap: antispam: will silently move mails with > missing signature > [...] >Me I have: Feb 3 22:10:39 ks34186 dovecot: IMAP(jehan at zemarmot.net): antispam: plugin initialising (unknown) Feb 3 22:10:39 ks34186 dovecot: IMAP(jehan at zemarmot.net): antispam: "trash" is trash folder Feb 3 22:10:39 ks34186 dovecot: IMAP(jehan at zemarmot.net): antispam: "Trash" is trash folder Feb 3 22:10:39 ks34186 dovecot: IMAP(jehan at zemarmot.net): antispam: "Deleted Items" is trash folder Feb 3 22:10:39 ks34186 dovecot: IMAP(jehan at zemarmot.net): antispam: "SPAM" is spam folder Feb 3 22:10:39 ks34186 dovecot: IMAP(jehan at zemarmot.net): antispam: "Junk" is spam folder Feb 3 22:10:39 ks34186 dovecot: IMAP(jehan at zemarmot.net): antispam: no unsure folders Feb 3 22:10:39 ks34186 dovecot: IMAP(jehan at zemarmot.net): antispam: dspam binary set to /usr/bin/dspam Feb 3 22:10:39 ks34186 dovecot: IMAP(jehan at zemarmot.net): Growing pool 'antispam-pool' with: 2048> Cheers, > > -- > Marcin Rzepecki > m.rzepecki(at)iem.pw.edu.pl > >Thanks. Jehan
Jehan wrote:> ... Apparently the ml is not very well configured because a reply > does not reply to the whole ml, but to the single sender. I will take > care now.I bet there are a *lot* of people (me included) who think the ml is very well configured precisely because it does not set Reply-to: the list. H
Hi all, just to say that finally the patch of Marcin worked great. Just my configuration is different from yours to get it work: antispam_signature = X-DSPAM-Signature antispam_trash = trash;Trash;Deleted Items antispam_spam = SPAM;Junk antispam_dspam_binary = /usr/bin/dspam antispam_dspam_args = --client;--source=error;--user;%u antispam_mail_tmpdir = /tmp The difference here is in the syntax. You write "--user=somemail" though in the manual, it is written "--user somemail". But also you were proposing 2 lines "antispam_dspam_args" though in all my tests, when I was doing such a thing, the second line seemed to override the first (in the launch logs, only the second line was displayed, so I guess...). Are you sure that it works exactly the way you intend to, Marcin? And that the "--source=error" (your first line) is indeed added as a parameter to the call of dspam? For the patch to the dovecot-antispam, probably it should not be integrated "as is", but I guess that the return code of call_dspam function must probably be checked and fixed if the call can succeed but still give a failure return code. I set Johannes as a main recipient, maybe you will see this email. Bye and thanks all. Jehan On Wed, Feb 4, 2009 at 12:45 PM, Jehan Pag?s <jehan.marmottard at gmail.com>wrote:> Hi, > > On Wed, Feb 4, 2009 at 12:40 PM, Marcin Rzepecki <m.rzepecki at iem.pw.edu.pl > > wrote: > >> Wed, Feb 04, 2009 at 12:12:44PM +0100, Jehan Pag?s wrote: >> > I saw this piece of code and did the same as you in my change of course. >> > Unfortunately, it didn't work (no logged "marked as SPAM", nor change in >> my >> > stats. I have dovecot 1.1.7-r1 though, so it is probably the reason. >> >> Logging '...markes as SPAM..' lines to syslog is my idea, I can send some >> dspam patches, to make it work. It's usefull for me. > > > Ok. Anyway the stats don't change... > > >> >> Are you using mbox or maildir? If you are using mbox, try to upgrade to >> Dovecot >=1.1.8 - it contains several mbox bug fixes (e.g 'Next message >> unexpectedly lost') which are needed to make antispam plugin work. > > > No maildir... > I am doing some stuffs about another way to interact dspam/dovecot/postfix > and will go back to this issue soon. > > Jehan >