From: Timo Sirainen Date: Tue, 1 Dec 2015 15:31:08 +0000 (+0200) Subject: mail-log: If uid field is used, make sure newly saved mails actually get an UID. X-Git-Tag: 2.2.20.rc1~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5b79409cf50bf77dcb23083e69e04afc310c7f64;p=thirdparty%2Fdovecot%2Fcore.git mail-log: If uid field is used, make sure newly saved mails actually get an UID. With Maildir the UID is otherwise assigned on mail deliveries only if dovecot-uidlist happens to get locked. --- diff --git a/src/plugins/mail-log/mail-log-plugin.c b/src/plugins/mail-log/mail-log-plugin.c index eac7880f95..7adf54b696 100644 --- a/src/plugins/mail-log/mail-log-plugin.c +++ b/src/plugins/mail-log/mail-log-plugin.c @@ -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) {