]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-lda: Added mail_deliver_hook_set()
authorTimo Sirainen <tss@iki.fi>
Thu, 12 Aug 2010 12:50:01 +0000 (13:50 +0100)
committerTimo Sirainen <tss@iki.fi>
Thu, 12 Aug 2010 12:50:01 +0000 (13:50 +0100)
src/lib-lda/mail-deliver.c
src/lib-lda/mail-deliver.h

index fe11e8d11e9cc3658221bfcae52907e75de6a7a3..55b8f54ff37e1ed88c7d8bc9d68342a6791d4194 100644 (file)
@@ -296,3 +296,11 @@ int mail_deliver(struct mail_deliver_context *ctx,
        }
        return ret;
 }
+
+deliver_mail_func_t *mail_deliver_hook_set(deliver_mail_func_t *new_hook)
+{
+       deliver_mail_func_t *old_hook = deliver_mail;
+
+       deliver_mail = new_hook;
+       return old_hook;
+}
index 42a4cb1687b19538c68c600002f26e74c7ccc3da..e100543ba877106d78a5133d36d8ef723d526ea1 100644 (file)
@@ -69,4 +69,8 @@ int mail_deliver_save(struct mail_deliver_context *ctx, const char *mailbox,
 int mail_deliver(struct mail_deliver_context *ctx,
                 struct mail_storage **storage_r);
 
+/* Sets the deliver_mail hook and returns the previous hook,
+   which the new_hook should call if it's non-NULL. */
+deliver_mail_func_t *mail_deliver_hook_set(deliver_mail_func_t *new_hook);
+
 #endif