[Dovecot] How to log uid and keywords of delivered mail?

Timo Sirainen tss at iki.fi
Wed Feb 13 20:13:14 EET 2008


On Tue, 2008-02-12 at 22:53 -0800, Ron Avriel wrote:

> I’d like to extend the mail_log plugin to log the uid and keywords of a mail delivered by LDA. The keywords are set by the sieve plugin.
> I added a mail_log_save_finish() function hook listed below. 
> However, the uid of the mail is always zero 

Right, because the UIDs are assigned only when committing the
transaction. With v1.1 the UIDs are returned:

int mailbox_transaction_commit_get_uids(struct mailbox_transaction_context **t,
					uint32_t *uid_validity_r,
					uint32_t *first_saved_uid_r,
					uint32_t *last_saved_uid_r);

I don't think there's an easy way to get them with v1.0.

> and trying to get the keywords results in assertion failure, probably because the message is not committed yet:

If this still happens with v1.1 I could take a look at fixing it..

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20080213/1e199138/attachment.bin 


More information about the dovecot mailing list