"Date", "Message-ID", NULL
};
+struct mailbox_header_lookup_ctx *
+dsync_mail_get_hash_headers(struct mailbox *box)
+{
+ return mailbox_header_lookup_init(box, hashed_headers);
+}
+
int dsync_mail_get_hdr_hash(struct mail *mail, const char **hdr_hash_r)
{
struct istream *hdr_input, *input;
#include "mail-types.h"
struct mail;
+struct mailbox;
struct dsync_mail {
/* either GUID="" or uid=0 */
ARRAY_TYPE(const_string) keyword_changes;
};
+struct mailbox_header_lookup_ctx *
+dsync_mail_get_hash_headers(struct mailbox *box);
+
int dsync_mail_get_hdr_hash(struct mail *mail, const char **hdr_hash_r);
int dsync_mail_fill(struct mail *mail, struct dsync_mail *dmail_r,
const char **error_field_r);
struct dsync_transaction_log_scan *log_scan;
uint32_t last_common_uid;
+ struct mailbox_header_lookup_ctx *wanted_headers;
struct mailbox_transaction_context *trans;
struct mail_search_context *search_ctx;
unsigned int search_pos, search_count;
time_t save_timestamp;
int ret;
+ mail_add_temp_wanted_fields(mail, MAIL_FETCH_GUID |
+ MAIL_FETCH_SAVE_DATE,
+ exporter->wanted_headers);
+
/* If message is already expunged here, just skip it */
if ((ret = exporter_get_guids(exporter, mail, &guid, &hdr_hash)) <= 0)
return ret;
p_array_init(&exporter->expunged_seqs, pool, 16);
p_array_init(&exporter->expunged_guids, pool, 16);
+ if (!exporter->mails_have_guids)
+ exporter->wanted_headers = dsync_mail_get_hash_headers(box);
+
/* first scan transaction log and save any expunges and flag changes */
dsync_mailbox_export_log_scan(exporter, log_scan);
/* get saves and also find GUIDs for flag changes */
dsync_mailbox_export_body_search_deinit(exporter);
(void)mailbox_transaction_commit(&exporter->trans);
+ if (exporter->wanted_headers != NULL)
+ mailbox_header_lookup_unref(&exporter->wanted_headers);
if (exporter->attr.value_stream != NULL)
i_stream_unref(&exporter->attr.value_stream);