uint32_t parse_line_num;
struct message_part *parts;
- const char *envelope, *body, *bodystructure, *uid_string;
+ const char *envelope, *body, *bodystructure, *uid_string, *guid;
struct message_part_envelope_data *envelope_data;
uint32_t seq;
switch (field) {
case MAIL_FETCH_UIDL_FILE_NAME:
case MAIL_FETCH_GUID:
+ if (mail->data.guid != NULL) {
+ *value_r = mail->data.guid;
+ return 0;
+ }
if (_mail->uid != 0) {
if (maildir_mail_get_fname(mbox, _mail, &fname) <= 0)
return -1;
fname = fname != NULL ? fname + 1 : path;
}
end = strchr(fname, MAILDIR_INFO_SEP);
- *value_r = end == NULL ? fname : t_strdup_until(fname, end);
+ mail->data.guid = end == NULL ?
+ p_strdup(mail->data_pool, fname) :
+ p_strdup_until(mail->data_pool, fname, end);
+ *value_r = mail->data.guid;
return 0;
case MAIL_FETCH_UIDL_BACKEND:
uidl = maildir_uidlist_lookup_ext(mbox->uidlist, _mail->uid,
struct mailbox_sync_context *
mailbox_sync_init(struct mailbox *box, enum mailbox_sync_flags flags)
{
+ struct mailbox_sync_context *ctx;
+
if (box->transaction_count != 0) {
i_panic("Trying to sync mailbox %s with open transactions",
box->name);
}
- return box->v.sync_init(box, flags);
+ T_BEGIN {
+ ctx = box->v.sync_init(box, flags);
+ } T_END;
+ return ctx;
}
bool mailbox_sync_next(struct mailbox_sync_context *ctx,