]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mail-log: If uid field is used, make sure newly saved mails actually get an UID.
authorTimo Sirainen <tss@iki.fi>
Tue, 1 Dec 2015 15:31:08 +0000 (17:31 +0200)
committerTimo Sirainen <tss@iki.fi>
Tue, 1 Dec 2015 15:31:08 +0000 (17:31 +0200)
With Maildir the UID is otherwise assigned on mail deliveries only if
dovecot-uidlist happens to get locked.

src/plugins/mail-log/mail-log-plugin.c

index eac7880f95b65c443050675ac06d776e00193242..7adf54b6968b7259486a6e995ab09eb6dc748539 100644 (file)
@@ -263,6 +263,8 @@ mail_log_append_mail_message_real(struct mail_log_mail_txn_context *ctx,
                           this consistently with all mailbox formats */
                        mail_log_append_uid(ctx, msg, text, 0);
                }
+               /* make sure UID is assigned to this mail */
+               mail->transaction->flags |= MAILBOX_TRANSACTION_FLAG_ASSIGN_UIDS;
                str_append(text, ", ");
        }
        if ((muser->fields & MAIL_LOG_FIELD_MSGID) != 0) {