[Dovecot] Need to detect event: a user move a message to a “spam folder” (for antispam filter)

Timo Sirainen tss at iki.fi
Sat Sep 23 18:40:40 EEST 2006


On 23.9.2006, at 17.52, Naefen Raphaël wrote:

> I’m writing an immune system based antispam filter.
> I need to detect when a user move a message to her spam folder (to  
> inform the filter).

I guess I really should write a generic plugin which does this...

> I
> I found “cmd_copy” in imap library so I detect the copy event. But  
> at this level I wasn’t able to find info about which mail and which  
> user copy this message.

The username is currently easiest to get with getenv("USER"). It's  
guaranteed to contain the username.

As for the mail, there's the struct mail which is filled by each  
mailbox_search_next() call, so you can use it to ask anything you  
need about the message.  See struct mail and mail_*() functions in  
lib-storage/mail-storage.h. For example mail->uid gives you its uid,  
mail_get_first_header() some header etc.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20060923/83cf5c9f/attachment.pgp 


More information about the dovecot mailing list