plugins can safely specify it. ctx->dest_mail also gets updated then.
--HG--
branch : HEAD
enum mail_flags flags, struct mail_keywords *keywords,
time_t received_date, int timezone_offset ATTR_UNUSED,
const char *from_envelope ATTR_UNUSED,
- struct istream *input, struct mail *dest_mail,
+ struct istream *input, struct mail **dest_mail,
struct mail_save_context **ctx_r)
{
struct cydir_transaction_context *t =
MODIFY_REPLACE, keywords);
}
- if (dest_mail == NULL) {
+ if (*dest_mail == NULL) {
if (ctx->mail == NULL)
ctx->mail = mail_alloc(_t, 0, NULL);
- dest_mail = ctx->mail;
+ *dest_mail = ctx->mail;
}
- mail_set_seq(dest_mail, ctx->seq);
+ mail_set_seq(*dest_mail, ctx->seq);
crlf_input = i_stream_create_crlf(input);
- ctx->input = index_mail_cache_parse_init(dest_mail, crlf_input);
+ ctx->input = index_mail_cache_parse_init(*dest_mail, crlf_input);
i_stream_unref(&crlf_input);
- ctx->cur_dest_mail = dest_mail;
+ ctx->cur_dest_mail = *dest_mail;
ctx->cur_received_date = received_date;
*ctx_r = &ctx->ctx;
enum mail_flags flags, struct mail_keywords *keywords,
time_t received_date, int timezone_offset,
const char *from_envelope, struct istream *input,
- struct mail *dest_mail, struct mail_save_context **ctx_r);
+ struct mail **dest_mail, struct mail_save_context **ctx_r);
int cydir_save_continue(struct mail_save_context *ctx);
int cydir_save_finish(struct mail_save_context *ctx);
void cydir_save_cancel(struct mail_save_context *ctx);
enum mail_flags flags, struct mail_keywords *keywords,
time_t received_date, int timezone_offset ATTR_UNUSED,
const char *from_envelope ATTR_UNUSED,
- struct istream *input, struct mail *dest_mail,
+ struct istream *input, struct mail **dest_mail,
struct mail_save_context **ctx_r)
{
struct dbox_transaction_context *t =
MODIFY_REPLACE, keywords);
}
- if (dest_mail == NULL) {
+ if (*dest_mail == NULL) {
if (ctx->mail == NULL)
ctx->mail = mail_alloc(_t, 0, NULL);
- dest_mail = ctx->mail;
+ *dest_mail = ctx->mail;
}
- mail_set_seq(dest_mail, ctx->seq);
+ mail_set_seq(*dest_mail, ctx->seq);
- ctx->cur_dest_mail = dest_mail;
+ ctx->cur_dest_mail = *dest_mail;
crlf_input = i_stream_create_lf(input);
- ctx->input = index_mail_cache_parse_init(dest_mail, crlf_input);
+ ctx->input = index_mail_cache_parse_init(*dest_mail, crlf_input);
i_stream_unref(&crlf_input);
save_mail = array_append_space(&ctx->mails);
enum mail_flags flags, struct mail_keywords *keywords,
time_t received_date, int timezone_offset,
const char *from_envelope, struct istream *input,
- struct mail *dest_mail, struct mail_save_context **ctx_r);
+ struct mail **dest_mail, struct mail_save_context **ctx_r);
int dbox_save_continue(struct mail_save_context *ctx);
int dbox_save_finish(struct mail_save_context *ctx);
void dbox_save_cancel(struct mail_save_context *ctx);
enum mail_flags flags, struct mail_keywords *keywords,
time_t received_date, int timezone_offset ATTR_UNUSED,
const char *from_envelope ATTR_UNUSED,
- struct istream *input, struct mail *dest_mail,
+ struct istream *input, struct mail **dest_mail,
struct mail_save_context **ctx_r)
{
struct maildir_transaction_context *t =
i_stream_create_crlf(input) :
i_stream_create_lf(input);
- maildir_save_add(t, fname, flags, keywords, dest_mail);
+ maildir_save_add(t, fname, flags, keywords, *dest_mail);
}
} T_END;
if (ctx->failed)
enum mail_flags flags, struct mail_keywords *keywords,
time_t received_date, int timezone_offset,
const char *from_envelope, struct istream *input,
- struct mail *dest_mail, struct mail_save_context **ctx_r);
+ struct mail **dest_mail,
+ struct mail_save_context **ctx_r);
int maildir_save_continue(struct mail_save_context *ctx);
int maildir_save_finish(struct mail_save_context *ctx);
void maildir_save_cancel(struct mail_save_context *ctx);
enum mail_flags flags, struct mail_keywords *keywords,
time_t received_date, int timezone_offset ATTR_UNUSED,
const char *from_envelope, struct istream *input,
- struct mail *dest_mail, struct mail_save_context **ctx_r)
+ struct mail **dest_mail, struct mail_save_context **ctx_r)
{
struct mbox_transaction_context *t =
(struct mbox_transaction_context *)_t;
ctx->failed = FALSE;
ctx->seq = 0;
- if (mbox_save_init_file(ctx, t, dest_mail != NULL) < 0) {
+ if (mbox_save_init_file(ctx, t, *dest_mail != NULL) < 0) {
ctx->failed = TRUE;
return -1;
}
ctx->next_uid++;
/* parse and cache the mail headers as we read it */
- if (dest_mail == NULL) {
+ if (*dest_mail == NULL) {
if (ctx->mail == NULL)
ctx->mail = mail_alloc(_t, 0, NULL);
- dest_mail = ctx->mail;
+ *dest_mail = ctx->mail;
}
- mail_set_seq(dest_mail, ctx->seq);
+ mail_set_seq(*dest_mail, ctx->seq);
}
mbox_save_append_flag_headers(ctx->headers, save_flags);
mbox_save_append_keyword_headers(ctx, keywords);
enum mail_flags flags, struct mail_keywords *keywords,
time_t received_date, int timezone_offset,
const char *from_envelope, struct istream *input,
- struct mail *dest_mail, struct mail_save_context **ctx_r);
+ struct mail **dest_mail, struct mail_save_context **ctx_r);
int mbox_save_continue(struct mail_save_context *ctx);
int mbox_save_finish(struct mail_save_context *ctx);
void mbox_save_cancel(struct mail_save_context *ctx);
struct mail_keywords *keywords,
time_t received_date, int timezone_offset,
const char *from_envelope, struct istream *input,
- struct mail *dest_mail,
+ struct mail **dest_mail,
struct mail_save_context **ctx_r);
int (*save_continue)(struct mail_save_context *ctx);
int (*save_finish)(struct mail_save_context *ctx);
}
if (t->box->v.save_init(t, flags, keywords,
received_date, timezone_offset,
- from_envelope, input, dest_mail, ctx_r) < 0)
+ from_envelope, input, &dest_mail, ctx_r) < 0)
return -1;
(*ctx_r)->dest_mail = dest_mail;
enum mail_flags flags, struct mail_keywords *keywords,
time_t received_date, int timezone_offset,
const char *from_envelope, struct istream *input,
- struct mail *dest_mail, struct mail_save_context **ctx_r)
+ struct mail **dest_mail, struct mail_save_context **ctx_r)
{
struct acl_mailbox *abox = ACL_CONTEXT(t->box);
enum mail_flags flags, struct mail_keywords *keywords,
time_t received_date, int timezone_offset,
const char *from_envelope, struct istream *input,
- struct mail *dest_mail, struct mail_save_context **ctx_r)
+ struct mail **dest_mail, struct mail_save_context **ctx_r)
{
struct quota_transaction_context *qt = QUOTA_CONTEXT(t);
struct quota_mailbox *qbox = QUOTA_CONTEXT(t->box);
}
}
- if (dest_mail == NULL) {
+ if (*dest_mail == NULL) {
/* we always want to know the mail size */
if (qt->tmp_mail == NULL) {
qt->tmp_mail = mail_alloc(t, MAIL_FETCH_PHYSICAL_SIZE,
NULL);
}
- dest_mail = qt->tmp_mail;
+ *dest_mail = qt->tmp_mail;
}
return qbox->module_ctx.super.
static int quota_save_finish(struct mail_save_context *ctx)
{
- struct quota_transaction_context *qt = QUOTA_CONTEXT(ctx->transaction);
struct quota_mailbox *qbox = QUOTA_CONTEXT(ctx->transaction->box);
if (qbox->module_ctx.super.save_finish(ctx) < 0)
return -1;
qbox->save_hack = TRUE;
- return quota_check(ctx->transaction, ctx->dest_mail != NULL ?
- ctx->dest_mail : qt->tmp_mail);
+ return quota_check(ctx->transaction, ctx->dest_mail);
}
static void quota_mailbox_sync_finish(struct quota_mailbox *qbox)
int timezone_offset ATTR_UNUSED,
const char *from_envelope ATTR_UNUSED,
struct istream *input ATTR_UNUSED,
- struct mail *dest_mail ATTR_UNUSED,
+ struct mail **dest_mail ATTR_UNUSED,
struct mail_save_context **ctx_r)
{
mail_storage_set_error(_t->box->storage, MAIL_ERROR_NOTPOSSIBLE,