[Dovecot] Using IMAP keywords instead of mailboxes for spam with dovecot-antispam

2008-03-20 Thread Jan Oravec
Hi, Some email clients, like Evolution, use IMAP keywords to flag spam instead of moving mail to dedicated spam mailbox. This is very useful, as false positives can be easily moved to original mailbox simply by removing $Junk keyword. I couldn't find a way how to integrate antispam software,

Re: [Dovecot] Using IMAP keywords instead of mailboxes for spam with dovecot-antispam

2008-03-20 Thread Charles Marcus
On 3/20/2008 7:23 AM, Jan Oravec wrote: Some email clients, like Evolution, use IMAP keywords to flag spam instead of moving mail to dedicated spam mailbox. This is very useful, as false positives can be easily moved to original mailbox simply by removing $Junk keyword. Thunderbird does this

Re: [Dovecot] Using IMAP keywords instead of mailboxes for spam with dovecot-antispam

2008-03-20 Thread Johannes Berg
Hi Jan, Some email clients, like Evolution, use IMAP keywords to flag spam instead of moving mail to dedicated spam mailbox. This is very useful, as false positives can be easily moved to original mailbox simply by removing $Junk keyword. Interesting idea, but the keyword my evolution uses

Re: [Dovecot] Using IMAP keywords instead of mailboxes for spam with dovecot-antispam

2008-03-20 Thread Jef Driesen
Jan Oravec wrote: Some email clients, like Evolution, use IMAP keywords to flag spam instead of moving mail to dedicated spam mailbox. This is very useful, as false positives can be easily moved to original mailbox simply by removing $Junk keyword. I couldn't find a way how to integrate

Re: [Dovecot] Using IMAP keywords instead of mailboxes for spam with dovecot-antispam

2008-03-20 Thread Jan Oravec
Hi Johannes, Interesting idea, but the keyword my evolution uses seems to be Junk, not $Junk. You are right, I didn't checked it and copied $Junk from http://wiki.dovecot.org/MailboxFormat/Maildir There isn't really, without some work. I have just committed this patch:

Re: [Dovecot] Using IMAP keywords instead of mailboxes for spam with dovecot-antispam

2008-03-20 Thread Johannes Berg
Hi, I guess that in need_keyword_hook case save_init/save_finish hooks will have to check email for spams and keyword it. It is not clear how to mark mail as spam if both need_folder_hook and need_keyword_hook are true. Well, the need_keyword_hook variable is just internal. The point is that

Re: [Dovecot] Using IMAP keywords instead of mailboxes for spam with dovecot-antispam

2008-03-20 Thread Timo Sirainen
On Thu, 2008-03-20 at 15:16 +0100, Johannes Berg wrote: The thing is that I don't know what context the update_keywords function runs in and whether it has a transaction at all, so I don't know how to roll back. I suppose it would be possible to grab the original keyword list before invoking

Re: [Dovecot] Using IMAP keywords instead of mailboxes for spam with dovecot-antispam

2008-03-20 Thread Johannes Berg
I haven't looked at your code, but struct mail always has a transaction (mail-transaction). You could fail the transaction by hooking into transaction_commit and calling rollback if your internal failure-flag was set. But that sounds a bit extreme. Indeed. But I suppose if I always have a

Re: [Dovecot] Using IMAP keywords instead of mailboxes for spam with dovecot-antispam

2008-03-20 Thread Jan Oravec
I guess that in need_keyword_hook case save_init/save_finish hooks will have to check email for spams and keyword it. It is not clear how to mark mail as spam if both need_folder_hook and need_keyword_hook are true. Well, the need_keyword_hook variable is just internal. The point is

Re: [Dovecot] Using IMAP keywords instead of mailboxes for spam with dovecot-antispam

2008-03-20 Thread Jan Oravec
But that sounds a bit extreme. Aren't you just adding/removing a single keyword? If so, you can use mail_update_keywords() to just add/remove that without reading/touching other keywords. Wouldn't it make a difference to mail client (silent fail instead of reported fail)? signature.asc