aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-10-15 15:02:07 +0200
committerJohannes Berg <johannes@sipsolutions.net>2007-10-15 15:02:07 +0200
commit729458b658868cb646da1ea68ddf77a7a444ab6e (patch)
tree63a58f93ea3e9bfde503d8e42e0db8bfd60d1549
parent9d79926aebf81af7ca33648f992c22374def0922 (diff)
downloaddovecot-antispam-729458b658868cb646da1ea68ddf77a7a444ab6e.tar.gz
dovecot-antispam-729458b658868cb646da1ea68ddf77a7a444ab6e.tar.xz
dovecot-antispam-729458b658868cb646da1ea68ddf77a7a444ab6e.zip
fix assertion failure bug
We need to override 'box->v.save_init' to be able to set 'want_mail' to TRUE since we do need the mail to extract the signature.
-rw-r--r--antispam-storage-1.0.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/antispam-storage-1.0.c b/antispam-storage-1.0.c
index f93a5b3..6f3bef0 100644
--- a/antispam-storage-1.0.c
+++ b/antispam-storage-1.0.c
@@ -110,6 +110,22 @@ antispam_copy(struct mailbox_transaction_context *t, struct mail *mail,
return ret;
}
+static int antispam_save_init(struct mailbox_transaction_context *t,
+ enum mail_flags flags,
+ struct mail_keywords *keywords,
+ time_t received_date, int timezone_offset,
+ const char *from_envelope, struct istream *input,
+ bool want_mail __attr_unused__,
+ struct mail_save_context **ctx_r)
+{
+ struct antispam_mailbox *asbox = ANTISPAM_CONTEXT(t->box);
+
+ /* note that we set want_mail = TRUE in here. */
+ return asbox->super.save_init(t, flags, keywords, received_date,
+ timezone_offset, from_envelope,
+ input, TRUE, ctx_r);
+}
+
static int antispam_save_finish(struct mail_save_context *ctx,
struct mail *dest_mail)
{
@@ -228,6 +244,8 @@ static struct mailbox *antispam_mailbox_open(struct mail_storage *storage,
asbox = p_new(box->pool, struct antispam_mailbox, 1);
asbox->super = box->v;
+ /* override save_init to override want_mail, we need that */
+ box->v.save_init = antispam_save_init;
box->v.save_finish = antispam_save_finish;
box->v.transaction_begin = antispam_mailbox_transaction_begin;
box->v.transaction_commit = antispam_mailbox_transaction_commit;