Ron Avriel
2008-Apr-01 06:46 UTC
[Dovecot] Wrong UIDs returned from mailbox_transaction_commit_get_uids()
Hi, Wrong UIDs are returned from mailbox_transaction_commit_get_uids() in dovecot-1.1.rc3. The problem is in: int mailbox_transaction_commit(struct mailbox_transaction_context **t) { uint32_t tmp; return mailbox_transaction_commit_get_uids(t, &tmp, &tmp, &tmp); } It should be: int mailbox_transaction_commit(struct mailbox_transaction_context **t) { uint32_t tmp1, tmp2, tmp3; return mailbox_transaction_commit_get_uids(t, &tmp1, &tmp2, &tmp3); } After this fix it works OK. Thanks, Ron ____________________________________________________________________________________ You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com
Timo Sirainen
2008-Apr-01 08:24 UTC
[Dovecot] Wrong UIDs returned from mailbox_transaction_commit_get_uids()
On Mon, 2008-03-31 at 23:46 -0700, Ron Avriel wrote:> Hi, > > Wrong UIDs are returned from mailbox_transaction_commit_get_uids() in dovecot-1.1.rc3.Where do you see this causing problems?> The problem is in: > > int mailbox_transaction_commit(struct mailbox_transaction_context **t) > { > uint32_t tmp; > > return mailbox_transaction_commit_get_uids(t, &tmp, &tmp, &tmp); > } > > > It should be: > > int mailbox_transaction_commit(struct mailbox_transaction_context **t) > { > uint32_t tmp1, tmp2, tmp3; > > return mailbox_transaction_commit_get_uids(t, &tmp1, &tmp2, &tmp3); > }How/where does this help? The tmp values are ignored in any case, so I don't think this is the right fix for it. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20080401/37c5c2ee/attachment-0002.bin>
Ron Avriel
2008-Apr-01 12:16 UTC
[Dovecot] Wrong UIDs returned from mailbox_transaction_commit_get_uids()
> > > > It should be: > > > > int mailbox_transaction_commit(struct mailbox_transaction_context **t) > > { > > uint32_t tmp1, tmp2, tmp3; > > > > return mailbox_transaction_commit_get_uids(t, &tmp1, &tmp2, &tmp3); > > } > > How/where does this help? The tmp values are ignored in any case, so I > don't think this is the right fix for it. >The problem occurs if transaction_commit() is hooked. In mail_log plugin I wanted to print the committed UIDs. I changed mail_log_transaction_commit() to: { ... ret = lbox->super.transaction_commit(t, uid_validity_r, first_saved_uid_r, last_saved_uid_r); if (0 == ret) { i_info("uid_validity=%u, first_uid=%u, last_uid=%u", *uid_validity_r, *first_saved_uid_r, *last_saved_uid_r); } return ret; } the result was: Apr 1 14:59:37 ha-test1 deliver(test1 at test.com): uid_validity=1202218363, first_uid=1202218363, last_uid=1202218363 These values are equal to the UID validity. After changing mailbox_transaction_commit() as described above, I got correct values: Apr 1 15:09:50 ha-test1 deliver(test1 at test.com): uid_validity=1202218363, first_uid=139, last_uid=139 Ron ____________________________________________________________________________________ You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com