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.