7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen /* either GUID="" or uid=0 */
f5d3d7a0e1e517c6dff9bb1750334c8d9e4dce99Timo Sirainen /* If non-NULL, we're syncing within the dsync process using ibc-pipe.
f5d3d7a0e1e517c6dff9bb1750334c8d9e4dce99Timo Sirainen This mail can be used to mailbox_copy() the mail. */
f5d3d7a0e1e517c6dff9bb1750334c8d9e4dce99Timo Sirainen /* Verify that this equals to input_mail->uid */
d519a0449d0e536a32db93305516fdbd7db6773dTimo Sirainen /* TRUE if the following fields aren't set, because minimal_fill=TRUE
d519a0449d0e536a32db93305516fdbd7db6773dTimo Sirainen parameter was used. */
d519a0449d0e536a32db93305516fdbd7db6773dTimo Sirainen /* Input stream containing the message text, or NULL if all instances
d519a0449d0e536a32db93305516fdbd7db6773dTimo Sirainen of the message were already expunged from this mailbox. */
d8bdf558c7ba173fc47a194633d9bd97af1b9c74Timo Sirainen /* either GUID=NULL or uid=0 */
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen /* Message's GUID:
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen - for expunges either 128bit hex or NULL if unknown
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen - "" if backend doesn't support GUIDs */
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen /* If GUID is "", this contains hash of the message header,
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen otherwise NULL */
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen /* Message's current modseq (saves, flag changes) */
6abf66a3731d52889517bd644595c540e3a9b3ecTimo Sirainen /* Message's current private modseq (for private flags in
6abf66a3731d52889517bd644595c540e3a9b3ecTimo Sirainen shared mailboxes, otherwise 0) */
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen /* List of flag/keyword changes: (saves, flag changes) */
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen /* Flags added/removed since last sync, and final flags containing
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen flags that exist now but haven't changed */
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen /* Remove all keywords before applying changes. This is used only with
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen old transaction logs, new ones never reset keywords (just explicitly
7bd5b1c64cc987715bdaf8cc4907c3c37d5d7b29Timo Sirainen remove unwanted keywords) */
252f5c6a63878e7a8a7ffb5847eecbad7f8737e8Timo Sirainen /* +add, -remove, =final, &add_and_final. */
ee8294dbc7bb549557f6ba1264d66b55fbef69b6Aki Tuomi /* Received timestamp for saves, if brain.sync_since/until_timestamp is set */
ae949831f1f668b5501b4b125e7f7b1767fb109bTimo Sirainen /* Mail's size for saves if brain.sync_max_size is set,
ae949831f1f668b5501b4b125e7f7b1767fb109bTimo Sirainen (uoff_t)-1 otherwise. */
69a71891361b2b27ff68ed84b29278486628464aAki Tuomidsync_mail_get_hash_headers(struct mailbox *box, const char *const *hashed_headers);
45af47783693b3ba2768c5ad34eeff68132382d0Timo Sirainenint dsync_mail_get_hdr_hash(struct mail *mail, unsigned int version,
69a71891361b2b27ff68ed84b29278486628464aAki Tuomi const char *const *hashed_headers, const char **hdr_hash_r);
afd6d387ea65843b59fb6051fb567719d2a5279cAki Tuomistatic inline bool dsync_mail_hdr_hash_is_empty(const char *hdr_hash)
afd6d387ea65843b59fb6051fb567719d2a5279cAki Tuomi /* md5(\n) */
afd6d387ea65843b59fb6051fb567719d2a5279cAki Tuomi return strcmp(hdr_hash, "68b329da9893e34099c7d8ad5cb9c940") == 0;
d519a0449d0e536a32db93305516fdbd7db6773dTimo Sirainenint dsync_mail_fill(struct mail *mail, bool minimal_fill,
d519a0449d0e536a32db93305516fdbd7db6773dTimo Sirainen struct dsync_mail *dmail_r, const char **error_field_r);
d519a0449d0e536a32db93305516fdbd7db6773dTimo Sirainenint dsync_mail_fill_nonminimal(struct mail *mail, struct dsync_mail *dmail_r,