4
#include "mail-types.h"
9
/* either GUID="" or uid=0 */
13
const char *pop3_uidl;
14
unsigned int pop3_order;
17
/* Input stream containing the message text, or NULL if all instances
18
of the message were already expunged from this mailbox. */
19
struct istream *input;
21
/* If non-NULL, we're syncing within the dsync process using ibc-pipe.
22
This mail can be used to mailbox_copy() the mail. */
23
struct mail *input_mail;
24
/* Verify that this equals to input_mail->uid */
25
uint32_t input_mail_uid;
28
struct dsync_mail_request {
29
/* either GUID=NULL or uid=0 */
34
enum dsync_mail_change_type {
35
DSYNC_MAIL_CHANGE_TYPE_SAVE,
36
DSYNC_MAIL_CHANGE_TYPE_EXPUNGE,
37
DSYNC_MAIL_CHANGE_TYPE_FLAG_CHANGE
40
#define KEYWORD_CHANGE_ADD '+'
41
#define KEYWORD_CHANGE_REMOVE '-'
42
#define KEYWORD_CHANGE_FINAL '='
43
#define KEYWORD_CHANGE_ADD_AND_FINAL '&'
45
struct dsync_mail_change {
46
enum dsync_mail_change_type type;
50
- for expunges either 128bit hex or NULL if unknown
51
- "" if backend doesn't support GUIDs */
53
/* If GUID is "", this contains hash of the message header,
57
/* Message's current modseq (saves, flag changes) */
59
/* Message's current private modseq (for private flags in
60
shared mailboxes, otherwise 0) */
62
/* Message's save timestamp (saves) */
63
time_t save_timestamp;
65
/* List of flag/keyword changes: (saves, flag changes) */
67
/* Flags added/removed since last sync, and final flags containing
68
flags that exist now but haven't changed */
69
uint8_t add_flags, remove_flags, final_flags;
70
uint8_t add_pvt_flags, remove_pvt_flags;
71
/* Remove all keywords before applying changes. This is used only with
72
old transaction logs, new ones never reset keywords (just explicitly
73
remove unwanted keywords) */
75
/* +add, -remove, =final, &add_and_final. */
76
ARRAY_TYPE(const_string) keyword_changes;
79
int dsync_mail_get_hdr_hash(struct mail *mail, const char **hdr_hash_r);
80
int dsync_mail_fill(struct mail *mail, struct dsync_mail *dmail_r,
81
const char **error_field_r);
83
void dsync_mail_change_dup(pool_t pool, const struct dsync_mail_change *src,
84
struct dsync_mail_change *dest_r);