5 #define GLOBAL_UIDVALIDITY_VALUE 1L
8 void imap_cleanup_function(void);
9 void imap_greeting(void);
10 void imap_command_loop(void);
11 int imap_grabroom(char *returned_roomname, char *foldername, int zapped_ok);
12 void imap_free_transmitted_message(void);
13 int imap_do_expunge(void);
14 void imap_rescan_msgids(void);
20 int selected; /* set to 1 if in the SELECTED state */
21 int readonly; /* mailbox is open read only */
22 int num_msgs; /* Number of messages being mapped */
23 int num_alloc; /* Number of messages for which we've allocated space */
24 time_t last_mtime; /* For checking whether the room was modified... */
27 StrBuf *TransmittedMessage; /* for APPEND command... */
29 /* Cache most recent RFC822 FETCH because client might load in pieces */
30 char *cached_rfc822_data;
31 long cached_rfc822_msgnum;
32 size_t cached_rfc822_len;
33 char cached_rfc822_withbody; /* 1 = body cached; 0 = only headers cached */
35 /* Cache most recent BODY FETCH because client might load in pieces */
37 size_t cached_body_len;
38 char cached_bodypart[SIZ];
39 long cached_bodymsgnum;
40 char cached_body_withbody; /* 1 = body cached; 0 = only headers cached */
44 * values of 'authstate'
48 imap_as_expecting_username,
49 imap_as_expecting_password,
50 imap_as_expecting_plainauth,
51 imap_as_expecting_multilineusername,
52 imap_as_expecting_multilinepassword
55 /* Flags for the above struct. Note that some of these are for internal use,
56 * and are not to be reported to IMAP clients.
58 #define IMAP_ANSWERED 1 /* reportable and setable */
59 #define IMAP_FLAGGED 2 /* reportable and setable */
60 #define IMAP_DELETED 4 /* reportable and setable */
61 #define IMAP_DRAFT 8 /* reportable and setable */
62 #define IMAP_SEEN 16 /* reportable and setable */
64 #define IMAP_MASK_SETABLE 0x1f
65 #define IMAP_MASK_SYSTEM 0xe0
67 #define IMAP_SELECTED 32 /* neither reportable nor setable */
68 #define IMAP_RECENT 64 /* reportable but not setable */
71 #define IMAP ((struct citimap *)CC->session_specific_data)
74 * When loading arrays of message ID's into memory, increase the buffer to
75 * hold this many additional messages instead of calling realloc() each time.
77 #define REALLOC_INCREMENT 100