]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Add mailbox_save_get_dest_mail()
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 9 Feb 2017 16:46:14 +0000 (18:46 +0200)
committerGitLab <gitlab@git.dovecot.net>
Tue, 14 Feb 2017 12:57:34 +0000 (14:57 +0200)
This marks mailbox_save_set_dest_mail deprecated. It's not efficient to use
since it frees the already-created dest_mail.

src/lib-storage/mail-storage.c
src/lib-storage/mail-storage.h

index 5e74b7461193e18de6380498b093aa9681a5675b..143a581273568a93e8faa017b995a526d9f378fb 100644 (file)
@@ -2151,6 +2151,11 @@ void mailbox_save_set_dest_mail(struct mail_save_context *ctx,
        ctx->dest_mail_external = TRUE;
 }
 
+struct mail *mailbox_save_get_dest_mail(struct mail_save_context *ctx)
+{
+       return ctx->dest_mail;
+}
+
 int mailbox_save_begin(struct mail_save_context **ctx, struct istream *input)
 {
        struct mailbox *box = (*ctx)->transaction->box;
index c0fec6f9a98fc36e119307022fdff3d97aaef923..d38b4bc3b36f6d17ee2ffeeec7b0576087d0f2c2 100644 (file)
@@ -755,12 +755,11 @@ void mailbox_save_set_pop3_uidl(struct mail_save_context *ctx,
    of the mailbox. Not all backends support this. */
 void mailbox_save_set_pop3_order(struct mail_save_context *ctx,
                                 unsigned int order);
-/* If dest_mail is set, the saved message can be accessed using it. Note that
-   setting it may require mailbox syncing, so don't set it unless you need
-   it. Also you shouldn't try to access it before mailbox_save_finish() is
-   called. */
+/* FIXME: Remove in v2.3. Obsolete - use mailbox_save_get_dest_mail() instead */
 void mailbox_save_set_dest_mail(struct mail_save_context *ctx,
                                struct mail *mail);
+/* Returns the destination mail */
+struct mail *mailbox_save_get_dest_mail(struct mail_save_context *ctx);
 /* Begin saving the message. All mail_save_set_*() calls must have been called
    before this function. If the save initialization fails, the context is freed
    and -1 is returned. After beginning the save you should keep calling