[Dovecot] dovecot >1.1.3 + antispam plugin issues
Hello, i have following problems using dovecot-antispam plugin (Dovecot >1.1.3, FreeBSD 8.0-Current, dovecot-antispam 1.0/1.1) dovecot-antispam compiled using dspam-exec/mailtrain, with/wo debugging (i've tried all possibilities)
When i try to move message to SPAM folder (using dspam-exec backend) i'm getting IMAP error: antispam signature not found and in dovecot logs: Nov 23 23:44:24 freebsd dovecot: IMAP(mr): Next message unexpectedly lost from 2708619
Using mail backend gives this error too(only IMAP error changes: failed to read mail beggining).
Commenting out following code in mbox_read_from_line function (in src/lib-storage/index/mbox/istream-raw-mbox.c) helped and plugin was working correctly, but only with Dovecot <=1.1.3.
if (stream->istream.v_offset - rstream->hdr_offset + new_pos > rstream->mail_size) { /* istream_raw_mbox_set_next_offset() used invalid cached next_offset? */ i_error("Next message unexpectedly lost from %"PRIuUOFF_T, rstream->hdr_offset + rstream->mail_size); rstream->eof = TRUE; rstream->corrupted = TRUE; rstream->istream.istream.stream_errno = EINVAL; stream->pos = 0; return -1; }
Now, with versions >1.1.3 this won't helps and plugin fails. Anyone knows how to get it working? I would like to upgrade to newest dovecot release
Best regards, mr
Marcin Rzepecki wrote:
HMMM. Same here. DC 1.1.5 with mbox.
Using mail backend gives this error too(only IMAP error changes: failed to read mail beggining).
Oops, and I tried half of last night to get the mail backend working ...
So that's code from dovecot itself. If that really helped (did you check that the messages really were trained by dspam?) there is some problem between the antispam plugin and the main code. But I think the part you commented out is only the end of the story. Can it be that there is some counting problem when the plugin looks for the inserted message? Timo?
Regards, Jakob
Thu, Nov 27, 2008 at 08:28:54PM +0100, Jakob Curdes wrote:
HMMM. Same here. DC 1.1.5 with mbox.
As I said it affects DC>=1.1.3
Oops, and I tried half of last night to get the mail backend working ...
I know something about that ;)
Yes, after patching it works good and trains dspam correctly. No i'm still using it with 1.1.3, I've tried to debug newer versions but without success. After commenting this piece of code, dovecot seems to totally ignore plugin when moving messages between Inbox/SPAM ;)
For me this is the only solution at now. Antispam plugin is very helpfull, so I cannot upgrade without it.
Greets,
Marcin Rzepecki marcinrz(at)gmail.com
On Fri, 2008-11-28 at 15:03 +0100, Marcin Rzepecki wrote:
Maybe it affects mbox? I'm using 1.1.3 now with maildir and have no trouble.
I think we really need to ask Timo. Timo?
The issue seems to be that getting a given header from a mail fails under certain circumstances.
johannes
Timo Sirainen wrote:
Hi Timo, i've tested your patches with dovecot 1.1.7 (FreeBSD8 ports tree) After rebuilding dovecot & dovecot-antispam with your patches and moving message from INBOX to SPAM folder i've unfortunatelly get the same error: Dec 13 15:28:02 freebsd dovecot: IMAP(mr): Next message unexpectedly lost from 2518625 When I comment out following code with this patch (same way as with v.1.1.3), everything is working properly. --- src/lib-storage/index/mbox/istream-raw-mbox.c.dist 2008-12-14 14:12:53.000000000 +0100 +++ src/lib-storage/index/mbox/istream-raw-mbox.c 2008-12-14 14:13:18.000000000 +0100 @@ -312,18 +312,18 @@ new_pos--; } - if (stream->istream.v_offset - - rstream->hdr_offset + new_pos > rstream->mail_size) { +/* if (stream->istream.v_offset - + rstream->hdr_offset + new_pos > rstream->mail_size) { */ /* istream_raw_mbox_set_next_offset() used invalid cached next_offset? */ - i_error("Next message unexpectedly lost from %"PRIuUOFF_T, +/* i_error("Next message unexpectedly lost from %"PRIuUOFF_T, rstream->hdr_offset + rstream->mail_size); rstream->eof = TRUE; rstream->corrupted = TRUE; rstream->istream.istream.stream_errno = EINVAL; stream->pos = 0; return -1; - } + } */ stream->buffer = buf; if (new_pos == stream->pos) { So now it's a little bit better, altough still something goes wrong. But at least it is possible to switch to a newer release now :) Anyway, thank you very much for your work. Keep it up! Greets, -- Marcin Rzepecki m.rzepecki(at)iem.pw.edu.pl
Sun, Dec 14, 2008 at 06:46:41PM +0100, Marcin Rzepecki wrote:
Hi, again :)
After using antispam-plugin a few hours i mentioned, that after moving to some folder two or more messages or after deleting it (so in fact moving to trash) i'm getting for example: Dec 16 02:15:40 freebsd dovecot: IMAP(mr): Losing sync for mail uid=49 in mbox file /home/mr/.MAIL/Trash Dec 16 02:15:45 freebsd dovecot: IMAP(mr): Losing sync for mail uid=50 in mbox file /home/mr/.MAIL/Trash
After that Thunderbird shows messages in correct folders, but in mutt for example the messages are still existing in old folders with Deleted status, so I have to resync whole mbox. After turning off antispam plugin this thinks won't happen, so your patches, Timo, are ok. Antispam plugin seems to not sync mboxes correctly after some operations (regardless which folder they affect). Do you have any suggestions?
Greetings,
-- Marcin Rzepecki m.rzepecki(at)iem.pw.edu.pl
On Tue, 2008-12-16 at 02:31 +0100, Marcin Rzepecki wrote:
See if this helps: http://hg.dovecot.org/dovecot-1.1/rev/e7bb92a42ca9
participants (6)
-
Jakob Curdes
-
Johannes Berg
-
Marcin Rzepecki
-
Marcin Rzepecki
-
Marcin Rzepecki
-
Timo Sirainen