{
struct mail_save_context *ctx;
- ctx = t->box->v.save_alloc(t);
+ T_BEGIN {
+ ctx = t->box->v.save_alloc(t);
+ } T_END;
i_assert(!ctx->unfinished);
ctx->unfinished = TRUE;
ctx->data.received_date = (time_t)-1;
mail_storage_set_error(box->storage, MAIL_ERROR_NOTPOSSIBLE,
"Saving messages not supported");
ret = -1;
- } else {
+ } else T_BEGIN {
ret = box->v.save_begin(*ctx, input);
- }
+ } T_END;
if (ret < 0) {
mailbox_save_cancel(ctx);
int mailbox_save_continue(struct mail_save_context *ctx)
{
- return ctx->transaction->box->v.save_continue(ctx);
+ int ret;
+
+ T_BEGIN {
+ ret = ctx->transaction->box->v.save_continue(ctx);
+ } T_END;
+ return ret;
}
static void
*_ctx = NULL;
ctx->finishing = TRUE;
- ret = t->box->v.save_finish(ctx);
+ T_BEGIN {
+ ret = t->box->v.save_finish(ctx);
+ } T_END;
ctx->finishing = FALSE;
if (ret == 0 && !copying_via_save) {
struct mail_private *mail;
*_ctx = NULL;
- ctx->transaction->box->v.save_cancel(ctx);
+ T_BEGIN {
+ ctx->transaction->box->v.save_cancel(ctx);
+ } T_END;
if (keywords != NULL && !ctx->finishing)
mailbox_keywords_unref(&keywords);
if (ctx->dest_mail != NULL) {
return -1;
}
ctx->finishing = TRUE;
- ret = t->box->v.copy(ctx, backend_mail);
+ T_BEGIN {
+ ret = t->box->v.copy(ctx, backend_mail);
+ } T_END;
ctx->finishing = FALSE;
if (ret == 0) {
if (pvt_flags != 0)
bool mail_prefetch(struct mail *mail)
{
struct mail_private *p = (struct mail_private *)mail;
+ bool ret;
- return p->v.prefetch(mail);
+ T_BEGIN {
+ ret = p->v.prefetch(mail);
+ } T_END;
+ return ret;
}
void mail_add_temp_wanted_fields(struct mail *mail,
int mail_get_parts(struct mail *mail, struct message_part **parts_r)
{
struct mail_private *p = (struct mail_private *)mail;
+ int ret;
- return p->v.get_parts(mail, parts_r);
+ T_BEGIN {
+ ret = p->v.get_parts(mail, parts_r);
+ } T_END;
+ return ret;
}
int mail_get_date(struct mail *mail, time_t *date_r, int *timezone_r)
{
struct mail_private *p = (struct mail_private *)mail;
+ int ret;
- return p->v.get_date(mail, date_r, timezone_r);
+ T_BEGIN {
+ ret = p->v.get_date(mail, date_r, timezone_r);
+ } T_END;
+ return ret;
}
int mail_get_received_date(struct mail *mail, time_t *date_r)
{
struct mail_private *p = (struct mail_private *)mail;
+ int ret;
- return p->v.get_received_date(mail, date_r);
+ T_BEGIN {
+ ret = p->v.get_received_date(mail, date_r);
+ } T_END;
+ return ret;
}
int mail_get_save_date(struct mail *mail, time_t *date_r)
{
struct mail_private *p = (struct mail_private *)mail;
+ int ret;
- return p->v.get_save_date(mail, date_r);
+ T_BEGIN {
+ ret = p->v.get_save_date(mail, date_r);
+ } T_END;
+ return ret;
}
int mail_get_virtual_size(struct mail *mail, uoff_t *size_r)
{
struct mail_private *p = (struct mail_private *)mail;
+ int ret;
- return p->v.get_virtual_size(mail, size_r);
+ T_BEGIN {
+ ret = p->v.get_virtual_size(mail, size_r);
+ } T_END;
+ return ret;
}
int mail_get_physical_size(struct mail *mail, uoff_t *size_r)
{
struct mail_private *p = (struct mail_private *)mail;
+ int ret;
- return p->v.get_physical_size(mail, size_r);
+ T_BEGIN {
+ ret = p->v.get_physical_size(mail, size_r);
+ } T_END;
+ return ret;
}
int mail_get_first_header(struct mail *mail, const char *field,
const char **value_r)
{
struct mail_private *p = (struct mail_private *)mail;
+ int ret;
- return p->v.get_first_header(mail, field, FALSE, value_r);
+ T_BEGIN {
+ ret = p->v.get_first_header(mail, field, FALSE, value_r);
+ } T_END;
+ return ret;
}
int mail_get_first_header_utf8(struct mail *mail, const char *field,
const char **value_r)
{
struct mail_private *p = (struct mail_private *)mail;
+ int ret;
- return p->v.get_first_header(mail, field, TRUE, value_r);
+ T_BEGIN {
+ ret = p->v.get_first_header(mail, field, TRUE, value_r);
+ } T_END;
+ return ret;
}
int mail_get_headers(struct mail *mail, const char *field,
const char *const **value_r)
{
struct mail_private *p = (struct mail_private *)mail;
+ int ret;
- return p->v.get_headers(mail, field, FALSE, value_r);
+ T_BEGIN {
+ ret = p->v.get_headers(mail, field, FALSE, value_r);
+ } T_END;
+ return ret;
}
int mail_get_headers_utf8(struct mail *mail, const char *field,
const char *const **value_r)
{
struct mail_private *p = (struct mail_private *)mail;
+ int ret;
- return p->v.get_headers(mail, field, TRUE, value_r);
+ T_BEGIN {
+ ret = p->v.get_headers(mail, field, TRUE, value_r);
+ } T_END;
+ return ret;
}
int mail_get_header_stream(struct mail *mail,
struct istream **stream_r)
{
struct mail_private *p = (struct mail_private *)mail;
+ int ret;
- return p->v.get_header_stream(mail, headers, stream_r);
+ T_BEGIN {
+ ret = p->v.get_header_stream(mail, headers, stream_r);
+ } T_END;
+ return ret;
}
void mail_set_aborted(struct mail *mail)
{
struct mail_private *p = (struct mail_private *)mail;
- p->v.expunge(mail);
+ T_BEGIN {
+ p->v.expunge(mail);
+ } T_END;
}
void mail_set_expunged(struct mail *mail)