Mercurial > dovecot > original-hg > dovecot-1.2
annotate src/lib-storage/mail-storage.h @ 2322:aae574ed7f4c HEAD
Broke mailbox_sync() into iterator.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 12 Jul 2004 14:35:50 +0300 |
parents | 1c1ed4494aa4 |
children | 7d02e2a7672d |
rev | line source |
---|---|
0 | 1 #ifndef __MAIL_STORAGE_H |
2 #define __MAIL_STORAGE_H | |
3 | |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
4 struct message_size; |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
5 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
6 #include "mail-types.h" |
0 | 7 |
1622
d22e03714d36
index_mmap_invalidate = yes now invalidate memory maps before accessing
Timo Sirainen <tss@iki.fi>
parents:
1552
diff
changeset
|
8 enum mailbox_open_flags { |
d22e03714d36
index_mmap_invalidate = yes now invalidate memory maps before accessing
Timo Sirainen <tss@iki.fi>
parents:
1552
diff
changeset
|
9 MAILBOX_OPEN_READONLY = 0x01, |
2039
f0925b2271e1
Added pop3_mails_keep_recent option. Fixed recent assert crash.
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
10 MAILBOX_OPEN_FAST = 0x02, |
f0925b2271e1
Added pop3_mails_keep_recent option. Fixed recent assert crash.
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
11 MAILBOX_OPEN_KEEP_RECENT = 0x04 |
1622
d22e03714d36
index_mmap_invalidate = yes now invalidate memory maps before accessing
Timo Sirainen <tss@iki.fi>
parents:
1552
diff
changeset
|
12 }; |
d22e03714d36
index_mmap_invalidate = yes now invalidate memory maps before accessing
Timo Sirainen <tss@iki.fi>
parents:
1552
diff
changeset
|
13 |
1198
d28571e8c810
Rewrote LIST, LSUB and subscription file handling. LIST replies aren't
Timo Sirainen <tss@iki.fi>
parents:
1179
diff
changeset
|
14 enum mailbox_list_flags { |
1244
40bae47bdba1
Added support for CHILDREN and LISTEXT extensions.
Timo Sirainen <tss@iki.fi>
parents:
1218
diff
changeset
|
15 MAILBOX_LIST_SUBSCRIBED = 0x01, |
40bae47bdba1
Added support for CHILDREN and LISTEXT extensions.
Timo Sirainen <tss@iki.fi>
parents:
1218
diff
changeset
|
16 MAILBOX_LIST_FAST_FLAGS = 0x02, |
40bae47bdba1
Added support for CHILDREN and LISTEXT extensions.
Timo Sirainen <tss@iki.fi>
parents:
1218
diff
changeset
|
17 MAILBOX_LIST_CHILDREN = 0x04 |
1198
d28571e8c810
Rewrote LIST, LSUB and subscription file handling. LIST replies aren't
Timo Sirainen <tss@iki.fi>
parents:
1179
diff
changeset
|
18 }; |
d28571e8c810
Rewrote LIST, LSUB and subscription file handling. LIST replies aren't
Timo Sirainen <tss@iki.fi>
parents:
1179
diff
changeset
|
19 |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
889
diff
changeset
|
20 enum mailbox_flags { |
1244
40bae47bdba1
Added support for CHILDREN and LISTEXT extensions.
Timo Sirainen <tss@iki.fi>
parents:
1218
diff
changeset
|
21 MAILBOX_NOSELECT = 0x001, |
40bae47bdba1
Added support for CHILDREN and LISTEXT extensions.
Timo Sirainen <tss@iki.fi>
parents:
1218
diff
changeset
|
22 MAILBOX_NONEXISTENT = 0x002, |
40bae47bdba1
Added support for CHILDREN and LISTEXT extensions.
Timo Sirainen <tss@iki.fi>
parents:
1218
diff
changeset
|
23 MAILBOX_PLACEHOLDER = 0x004, |
40bae47bdba1
Added support for CHILDREN and LISTEXT extensions.
Timo Sirainen <tss@iki.fi>
parents:
1218
diff
changeset
|
24 MAILBOX_CHILDREN = 0x008, |
40bae47bdba1
Added support for CHILDREN and LISTEXT extensions.
Timo Sirainen <tss@iki.fi>
parents:
1218
diff
changeset
|
25 MAILBOX_NOCHILDREN = 0x010, |
40bae47bdba1
Added support for CHILDREN and LISTEXT extensions.
Timo Sirainen <tss@iki.fi>
parents:
1218
diff
changeset
|
26 MAILBOX_NOINFERIORS = 0x020, |
40bae47bdba1
Added support for CHILDREN and LISTEXT extensions.
Timo Sirainen <tss@iki.fi>
parents:
1218
diff
changeset
|
27 MAILBOX_MARKED = 0x040, |
40bae47bdba1
Added support for CHILDREN and LISTEXT extensions.
Timo Sirainen <tss@iki.fi>
parents:
1218
diff
changeset
|
28 MAILBOX_UNMARKED = 0x080, |
0 | 29 |
1244
40bae47bdba1
Added support for CHILDREN and LISTEXT extensions.
Timo Sirainen <tss@iki.fi>
parents:
1218
diff
changeset
|
30 MAILBOX_READONLY = 0x100 |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
889
diff
changeset
|
31 }; |
0 | 32 |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
889
diff
changeset
|
33 enum mailbox_status_items { |
0 | 34 STATUS_MESSAGES = 0x01, |
35 STATUS_RECENT = 0x02, | |
36 STATUS_UIDNEXT = 0x04, | |
37 STATUS_UIDVALIDITY = 0x08, | |
38 STATUS_UNSEEN = 0x10, | |
100
867ec80dbf42
Custom flags are now shown in FLAGS and PERMANENTFLAGS lists after SELECT.
Timo Sirainen <tss@iki.fi>
parents:
50
diff
changeset
|
39 STATUS_FIRST_UNSEEN_SEQ = 0x20, |
1958 | 40 STATUS_KEYWORDS = 0x40 |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
889
diff
changeset
|
41 }; |
0 | 42 |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
889
diff
changeset
|
43 enum mailbox_name_status { |
0 | 44 MAILBOX_NAME_EXISTS, |
45 MAILBOX_NAME_VALID, | |
889 | 46 MAILBOX_NAME_INVALID, |
47 MAILBOX_NAME_NOINFERIORS | |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
889
diff
changeset
|
48 }; |
0 | 49 |
906
b176f913d092
"ISO C forbids forward references to enum types"
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
50 enum mail_sort_type { |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
51 /* Maximum size for sort program, 2x for reverse + END */ |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
52 #define MAX_SORT_PROGRAM_SIZE (2*7 + 1) |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
53 |
906
b176f913d092
"ISO C forbids forward references to enum types"
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
54 MAIL_SORT_ARRIVAL = 0x0010, |
b176f913d092
"ISO C forbids forward references to enum types"
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
55 MAIL_SORT_CC = 0x0020, |
b176f913d092
"ISO C forbids forward references to enum types"
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
56 MAIL_SORT_DATE = 0x0040, |
b176f913d092
"ISO C forbids forward references to enum types"
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
57 MAIL_SORT_FROM = 0x0080, |
b176f913d092
"ISO C forbids forward references to enum types"
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
58 MAIL_SORT_SIZE = 0x0100, |
b176f913d092
"ISO C forbids forward references to enum types"
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
59 MAIL_SORT_SUBJECT = 0x0200, |
b176f913d092
"ISO C forbids forward references to enum types"
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
60 MAIL_SORT_TO = 0x0400, |
b176f913d092
"ISO C forbids forward references to enum types"
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
61 |
b176f913d092
"ISO C forbids forward references to enum types"
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
62 MAIL_SORT_REVERSE = 0x0001, /* reverse the next type */ |
b176f913d092
"ISO C forbids forward references to enum types"
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
63 |
b176f913d092
"ISO C forbids forward references to enum types"
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
64 MAIL_SORT_END = 0x0000 /* ends sort program */ |
b176f913d092
"ISO C forbids forward references to enum types"
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
65 }; |
b176f913d092
"ISO C forbids forward references to enum types"
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
66 |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
67 enum mail_fetch_field { |
2238
9cc23c29aaec
Added a framework for getting POP3 UIDL strings from mail-storage. The
Timo Sirainen <tss@iki.fi>
parents:
2219
diff
changeset
|
68 MAIL_FETCH_FLAGS = 0x00000001, |
9cc23c29aaec
Added a framework for getting POP3 UIDL strings from mail-storage. The
Timo Sirainen <tss@iki.fi>
parents:
2219
diff
changeset
|
69 MAIL_FETCH_MESSAGE_PARTS = 0x00000002, |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
70 |
2238
9cc23c29aaec
Added a framework for getting POP3 UIDL strings from mail-storage. The
Timo Sirainen <tss@iki.fi>
parents:
2219
diff
changeset
|
71 MAIL_FETCH_RECEIVED_DATE = 0x00000004, |
9cc23c29aaec
Added a framework for getting POP3 UIDL strings from mail-storage. The
Timo Sirainen <tss@iki.fi>
parents:
2219
diff
changeset
|
72 MAIL_FETCH_DATE = 0x00000008, |
9cc23c29aaec
Added a framework for getting POP3 UIDL strings from mail-storage. The
Timo Sirainen <tss@iki.fi>
parents:
2219
diff
changeset
|
73 MAIL_FETCH_SIZE = 0x00000010, |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
74 |
2238
9cc23c29aaec
Added a framework for getting POP3 UIDL strings from mail-storage. The
Timo Sirainen <tss@iki.fi>
parents:
2219
diff
changeset
|
75 MAIL_FETCH_STREAM_HEADER = 0x00000020, |
9cc23c29aaec
Added a framework for getting POP3 UIDL strings from mail-storage. The
Timo Sirainen <tss@iki.fi>
parents:
2219
diff
changeset
|
76 MAIL_FETCH_STREAM_BODY = 0x00000040, |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
77 |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
78 /* specials: */ |
2238
9cc23c29aaec
Added a framework for getting POP3 UIDL strings from mail-storage. The
Timo Sirainen <tss@iki.fi>
parents:
2219
diff
changeset
|
79 MAIL_FETCH_IMAP_BODY = 0x00001000, |
9cc23c29aaec
Added a framework for getting POP3 UIDL strings from mail-storage. The
Timo Sirainen <tss@iki.fi>
parents:
2219
diff
changeset
|
80 MAIL_FETCH_IMAP_BODYSTRUCTURE = 0x00002000, |
9cc23c29aaec
Added a framework for getting POP3 UIDL strings from mail-storage. The
Timo Sirainen <tss@iki.fi>
parents:
2219
diff
changeset
|
81 MAIL_FETCH_IMAP_ENVELOPE = 0x00004000, |
9cc23c29aaec
Added a framework for getting POP3 UIDL strings from mail-storage. The
Timo Sirainen <tss@iki.fi>
parents:
2219
diff
changeset
|
82 MAIL_FETCH_FROM_ENVELOPE = 0x00008000, |
9cc23c29aaec
Added a framework for getting POP3 UIDL strings from mail-storage. The
Timo Sirainen <tss@iki.fi>
parents:
2219
diff
changeset
|
83 MAIL_FETCH_UID_STRING = 0x00010000 |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
84 }; |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
85 |
1730
8480f945e270
IDLE uses now IO_*_NOTIFY to get instant notifying of mails.
Timo Sirainen <tss@iki.fi>
parents:
1728
diff
changeset
|
86 enum mailbox_sync_flags { |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
87 MAILBOX_SYNC_FLAG_FAST = 0x01, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
88 MAILBOX_SYNC_FLAG_NO_EXPUNGES = 0x02, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
89 MAILBOX_SYNC_AUTO_STOP = 0x04 |
1552
bc3307f2f35d
Only NOOP and CHECK will now always do a real mailbox sync. Other commands
Timo Sirainen <tss@iki.fi>
parents:
1534
diff
changeset
|
90 }; |
bc3307f2f35d
Only NOOP and CHECK will now always do a real mailbox sync. Other commands
Timo Sirainen <tss@iki.fi>
parents:
1534
diff
changeset
|
91 |
2322
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
92 enum mailbox_sync_type { |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
93 MAILBOX_SYNC_TYPE_EXPUNGE = 0x01, |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
94 MAILBOX_SYNC_TYPE_FLAGS = 0x02 |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
95 }; |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
96 |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
889
diff
changeset
|
97 struct mail_storage; |
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
889
diff
changeset
|
98 struct mail_storage_callbacks; |
1198
d28571e8c810
Rewrote LIST, LSUB and subscription file handling. LIST replies aren't
Timo Sirainen <tss@iki.fi>
parents:
1179
diff
changeset
|
99 struct mailbox_list; |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
889
diff
changeset
|
100 struct mailbox_status; |
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
889
diff
changeset
|
101 struct mail_search_arg; |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
102 struct fetch_context; |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
103 struct search_context; |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
104 struct mail; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
105 struct mailbox; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
106 struct mailbox_list_context; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
107 struct mailbox_transaction_context; |
0 | 108 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
109 struct mailbox_list { |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
110 const char *name; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
111 enum mailbox_flags flags; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
112 }; |
0 | 113 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
114 struct mailbox_status { |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
115 uint32_t messages; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
116 uint32_t recent; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
117 uint32_t unseen; |
674
b7aefd0d7611
Locking changes triggered a bit larger cleanup :) If we have to wait for a
Timo Sirainen <tss@iki.fi>
parents:
568
diff
changeset
|
118 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
119 uint32_t uidvalidity; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
120 uint32_t uidnext; |
450
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
121 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
122 uint32_t first_unseen_seq; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
123 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
124 unsigned int diskspace_full:1; |
0 | 125 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
126 /* may be allocated from data stack */ |
1958 | 127 unsigned int keywords_count; |
128 const char **keywords; | |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
129 }; |
450
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
130 |
2322
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
131 struct mailbox_sync_rec { |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
132 uint32_t seq1, seq2; |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
133 enum mailbox_sync_type type; |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
134 }; |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
135 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
136 struct mail_storage_callbacks { |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
137 /* Alert: Not enough disk space */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
138 void (*alert_no_diskspace)(struct mailbox *mailbox, void *context); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
139 /* "* OK <text>" */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
140 void (*notify_ok)(struct mailbox *mailbox, const char *text, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
141 void *context); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
142 /* "* NO <text>" */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
143 void (*notify_no)(struct mailbox *mailbox, const char *text, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
144 void *context); |
0 | 145 |
2322
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
146 }; |
0 | 147 |
2322
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
148 typedef void mailbox_notify_callback_t(struct mailbox *box, void *context); |
0 | 149 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
150 extern int full_filesystem_access; |
0 | 151 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
152 void mail_storage_init(void); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
153 void mail_storage_deinit(void); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
154 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
155 /* register all mail storages */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
156 void mail_storage_register_all(void); |
0 | 157 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
158 /* Register mail storage class with given name - all methods that are NULL |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
159 are set to default methods */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
160 void mail_storage_class_register(struct mail_storage *storage_class); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
161 void mail_storage_class_unregister(struct mail_storage *storage_class); |
1642
72c6e848f583
API changes: Don't keep variables in mailbox class.
Timo Sirainen <tss@iki.fi>
parents:
1640
diff
changeset
|
162 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
163 /* Create a new instance of registered mail storage class with given |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
164 storage-specific data. If data is NULL, it tries to use defaults. |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
165 May return NULL if anything fails. |
1642
72c6e848f583
API changes: Don't keep variables in mailbox class.
Timo Sirainen <tss@iki.fi>
parents:
1640
diff
changeset
|
166 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
167 If namespace is non-NULL, all mailbox names are expected to begin with it. |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
168 hierarchy_sep overrides the default separator if it's not '\0'. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
169 struct mail_storage * |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
170 mail_storage_create(const char *name, const char *data, const char *user, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
171 const char *namespace, char hierarchy_sep); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
172 void mail_storage_destroy(struct mail_storage *storage); |
0 | 173 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
174 struct mail_storage * |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
175 mail_storage_create_default(const char *user, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
176 const char *namespace, char hierarchy_sep); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
177 struct mail_storage * |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
178 mail_storage_create_with_data(const char *data, const char *user, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
179 const char *namespace, char hierarchy_sep); |
1639
3621292209f4
Explicit lock() method for mailbox.
Timo Sirainen <tss@iki.fi>
parents:
1638
diff
changeset
|
180 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
181 char mail_storage_get_hierarchy_sep(struct mail_storage *storage); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
182 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
183 /* Set storage callback functions to use. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
184 void mail_storage_set_callbacks(struct mail_storage *storage, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
185 struct mail_storage_callbacks *callbacks, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
186 void *context); |
0 | 187 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
188 /* name is allowed to contain multiple new hierarchy levels. |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
189 If directory is TRUE, the mailbox should be created so that it |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
190 can contain children. The mailbox itself doesn't have to be |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
191 created as long as it shows in LIST. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
192 int mail_storage_mailbox_create(struct mail_storage *storage, const char *name, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
193 int directory); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
194 /* Only the specified mailbox is deleted, ie. folders under the |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
195 specified mailbox must not be deleted. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
196 int mail_storage_mailbox_delete(struct mail_storage *storage, const char *name); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
197 /* If the name has inferior hierarchical names, then the inferior |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
198 hierarchical names MUST also be renamed (ie. foo -> bar renames |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
199 also foo/bar -> bar/bar). newname may contain multiple new |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
200 hierarchies. |
0 | 201 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
202 If oldname is case-insensitively "INBOX", the mails are moved |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
203 into new folder but the INBOX folder must not be deleted. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
204 int mail_storage_mailbox_rename(struct mail_storage *storage, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
205 const char *oldname, const char *newname); |
1172 | 206 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
207 /* Initialize new mailbox list request. mask may contain '%' and '*' |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
208 wildcards as defined in RFC2060. Matching against "INBOX" is |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
209 case-insensitive, but anything else is not. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
210 struct mailbox_list_context * |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
211 mail_storage_mailbox_list_init(struct mail_storage *storage, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
212 const char *mask, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
213 enum mailbox_list_flags flags); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
214 /* Get next mailbox. Returns the mailbox name */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
215 struct mailbox_list * |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
216 mail_storage_mailbox_list_next(struct mailbox_list_context *ctx); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
217 /* Deinitialize mailbox list request. Returns FALSE if some error |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
218 occured while listing. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
219 int mail_storage_mailbox_list_deinit(struct mailbox_list_context *ctx); |
0 | 220 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
221 /* Subscribe/unsubscribe mailbox. There should be no error when |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
222 subscribing to already subscribed mailbox. Subscribing to |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
223 unexisting mailboxes is optional. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
224 int mail_storage_set_subscribed(struct mail_storage *storage, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
225 const char *name, int set); |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
226 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
227 /* Returns mailbox name status */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
228 int mail_storage_get_mailbox_name_status(struct mail_storage *storage, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
229 const char *name, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
230 enum mailbox_name_status *status); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
231 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
232 /* Returns the error message of last occured error. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
233 const char *mail_storage_get_last_error(struct mail_storage *storage, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
234 int *syntax_error_r); |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
235 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
236 /* Open a mailbox. If readonly is TRUE, mailbox must not be |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
237 modified in any way even when it's asked. If fast is TRUE, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
238 any extra time consuming operations shouldn't be performed |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
239 (eg. when opening mailbox just for STATUS). |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
240 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
241 Note that append and copy may open the selected mailbox again |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
242 with possibly different readonly-state. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
243 struct mailbox *mailbox_open(struct mail_storage *storage, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
244 const char *name, enum mailbox_open_flags flags); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
245 /* Close the box. Returns FALSE if some cleanup errors occured, but |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
246 the mailbox was closed anyway. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
247 int mailbox_close(struct mailbox *box); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
248 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
249 /* Returns storage of given mailbox */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
250 struct mail_storage *mailbox_get_storage(struct mailbox *box); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
251 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
252 /* Returns name of given mailbox */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
253 const char *mailbox_get_name(struct mailbox *box); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
254 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
255 /* Returns TRUE if mailbox is read-only. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
256 int mailbox_is_readonly(struct mailbox *box); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
257 |
1958 | 258 /* Returns TRUE if mailbox currently supports adding keywords. */ |
259 int mailbox_allow_new_keywords(struct mailbox *box); | |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
260 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
261 /* Gets the mailbox status information. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
262 int mailbox_get_status(struct mailbox *box, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
263 enum mailbox_status_items items, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
264 struct mailbox_status *status); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
265 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
266 /* Synchronize the mailbox. */ |
2322
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
267 struct mailbox_sync_context * |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
268 mailbox_sync_init(struct mailbox *box, enum mailbox_sync_flags flags); |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
269 int mailbox_sync_next(struct mailbox_sync_context *ctx, |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
270 struct mailbox_sync_rec *sync_rec_r); |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
271 int mailbox_sync_deinit(struct mailbox_sync_context *ctx, |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
272 struct mailbox_status *status_r); |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
273 |
2322
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
274 /* Call given callback function when something changes in the mailbox. |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
275 It's done until this function is called with callback = NULL. */ |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
276 void mailbox_notify_changes(struct mailbox *box, unsigned int min_interval, |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2316
diff
changeset
|
277 mailbox_notify_callback_t *callback, void *context); |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
278 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
279 struct mailbox_transaction_context * |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
280 mailbox_transaction_begin(struct mailbox *box, int hide); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
281 int mailbox_transaction_commit(struct mailbox_transaction_context *t); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
282 void mailbox_transaction_rollback(struct mailbox_transaction_context *t); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
283 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
284 /* Simplified fetching for a single sequence. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
285 struct mail *mailbox_fetch(struct mailbox_transaction_context *t, uint32_t seq, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
286 enum mail_fetch_field wanted_fields); |
0 | 287 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
288 /* Convert uid range to sequence range. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
289 int mailbox_get_uids(struct mailbox *box, uint32_t uid1, uint32_t uid2, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
290 uint32_t *seq1_r, uint32_t *seq2_r); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
291 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
292 /* Modify sort_program to specify a sort program acceptable for |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
293 search_init(). If mailbox supports no sorting, it's simply set to |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
294 {MAIL_SORT_END}. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
295 int mailbox_search_get_sorting(struct mailbox *box, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
296 enum mail_sort_type *sort_program); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
297 /* Initialize new search request. Search arguments are given so that |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
298 the storage can optimize the searching as it wants. |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
299 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
300 If sort_program is non-NULL, it requests that the returned messages |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
301 are sorted by the given criteria. sort_program must have gone |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
302 through search_get_sorting(). |
0 | 303 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
304 wanted_fields and wanted_headers aren't required, but they can be |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
305 used for optimizations. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
306 struct mail_search_context * |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
307 mailbox_search_init(struct mailbox_transaction_context *t, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
308 const char *charset, struct mail_search_arg *args, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
309 const enum mail_sort_type *sort_program, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
310 enum mail_fetch_field wanted_fields, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
311 const char *const wanted_headers[]); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
312 /* Deinitialize search request. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
313 int mailbox_search_deinit(struct mail_search_context *ctx); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
314 /* Search the next message. Returned mail object can be used until |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
315 the next call to search_next() or search_deinit(). */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
316 struct mail *mailbox_search_next(struct mail_search_context *ctx); |
1637
a64391b49589
API change for copying messages.
Timo Sirainen <tss@iki.fi>
parents:
1622
diff
changeset
|
317 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
318 /* Save a mail into mailbox. timezone_offset specifies the timezone in |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
319 minutes in which received_date was originally given with. To use |
2190
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
2062
diff
changeset
|
320 current time, set received_date to (time_t)-1. |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
2062
diff
changeset
|
321 |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
2062
diff
changeset
|
322 If mail_r is non-NULL, the saved message can be accessed using it. |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
2062
diff
changeset
|
323 Note that setting it non-NULL may require mailbox syncing, so don't give |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
2062
diff
changeset
|
324 give it unless you need it. */ |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
325 int mailbox_save(struct mailbox_transaction_context *t, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
326 const struct mail_full_flags *flags, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
327 time_t received_date, int timezone_offset, |
2190
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
2062
diff
changeset
|
328 const char *from_envelope, struct istream *data, |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
2062
diff
changeset
|
329 struct mail **mail_r); |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
2062
diff
changeset
|
330 /* Copy given message. If dest_mail_r is non-NULL, the copied message can be |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
2062
diff
changeset
|
331 accessed using it. Note that setting it non-NULL may require mailbox |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
2062
diff
changeset
|
332 syncing, so don't give give it unless you need it. */ |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
2062
diff
changeset
|
333 int mailbox_copy(struct mailbox_transaction_context *t, struct mail *mail, |
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
2062
diff
changeset
|
334 struct mail **dest_mail_r); |
1640
db14aa8e2b5c
API change for expunging messages. Not exactly what I wanted, but good
Timo Sirainen <tss@iki.fi>
parents:
1639
diff
changeset
|
335 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
336 /* Returns TRUE if mailbox is now in inconsistent state, meaning that |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
337 the message IDs etc. may have changed - only way to recover this |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
338 would be to fully close the mailbox and reopen it. With IMAP |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
339 connection this would mean a forced disconnection since we can't |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
340 do forced CLOSE. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
341 int mailbox_is_inconsistent(struct mailbox *box); |
0 | 342 |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
343 struct mail { |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
344 /* always set */ |
1637
a64391b49589
API change for copying messages.
Timo Sirainen <tss@iki.fi>
parents:
1622
diff
changeset
|
345 struct mailbox *box; |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
346 uint32_t seq, uid; |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
347 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
348 unsigned int expunged:1; |
1534
676995d7c0ca
IMAP protocol doesn't allow server to send NULs to client. Send ascii #128
Timo Sirainen <tss@iki.fi>
parents:
1479
diff
changeset
|
349 unsigned int has_nuls:1; /* message data is known to contain NULs */ |
676995d7c0ca
IMAP protocol doesn't allow server to send NULs to client. Send ascii #128
Timo Sirainen <tss@iki.fi>
parents:
1479
diff
changeset
|
350 unsigned int has_no_nuls:1; /* -''- known to not contain NULs */ |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
351 |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
352 const struct mail_full_flags *(*get_flags)(struct mail *mail); |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
353 const struct message_part *(*get_parts)(struct mail *mail); |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
354 |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
355 /* Get the time message was received (IMAP INTERNALDATE). |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
356 Returns (time_t)-1 if error occured. */ |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
357 time_t (*get_received_date)(struct mail *mail); |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
358 /* Get the Date-header in mail. Timezone is in minutes. |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
359 Returns (time_t)-1 if error occured, 0 if field wasn't found or |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
360 couldn't be parsed. */ |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
361 time_t (*get_date)(struct mail *mail, int *timezone); |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
362 /* Get the full virtual size of mail (IMAP RFC822.SIZE). |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
363 Returns (uoff_t)-1 if error occured */ |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
364 uoff_t (*get_size)(struct mail *mail); |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
365 |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
366 /* Get value for single header field */ |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
367 const char *(*get_header)(struct mail *mail, const char *field); |
1672
8920600a8cfc
Index cache file rewrite. It's not finished yet and mbox support is
Timo Sirainen <tss@iki.fi>
parents:
1652
diff
changeset
|
368 /* Returns partial headers which contain _at least_ the given fields, |
8920600a8cfc
Index cache file rewrite. It's not finished yet and mbox support is
Timo Sirainen <tss@iki.fi>
parents:
1652
diff
changeset
|
369 but it may contain others as well. */ |
8920600a8cfc
Index cache file rewrite. It's not finished yet and mbox support is
Timo Sirainen <tss@iki.fi>
parents:
1652
diff
changeset
|
370 struct istream *(*get_headers)(struct mail *mail, |
8920600a8cfc
Index cache file rewrite. It's not finished yet and mbox support is
Timo Sirainen <tss@iki.fi>
parents:
1652
diff
changeset
|
371 const char *const minimum_fields[]); |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
372 |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
373 /* Returns input stream pointing to beginning of message header. |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
374 hdr_size and body_size are updated unless they're NULL. */ |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
375 struct istream *(*get_stream)(struct mail *mail, |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
376 struct message_size *hdr_size, |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
377 struct message_size *body_size); |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
378 |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
379 /* Get the any of the "special" fields. */ |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
380 const char *(*get_special)(struct mail *mail, |
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
953
diff
changeset
|
381 enum mail_fetch_field field); |
1637
a64391b49589
API change for copying messages.
Timo Sirainen <tss@iki.fi>
parents:
1622
diff
changeset
|
382 |
1638
e95c0e462591
API change for updating message flags.
Timo Sirainen <tss@iki.fi>
parents:
1637
diff
changeset
|
383 /* Update message flags. */ |
e95c0e462591
API change for updating message flags.
Timo Sirainen <tss@iki.fi>
parents:
1637
diff
changeset
|
384 int (*update_flags)(struct mail *mail, |
e95c0e462591
API change for updating message flags.
Timo Sirainen <tss@iki.fi>
parents:
1637
diff
changeset
|
385 const struct mail_full_flags *flags, |
e95c0e462591
API change for updating message flags.
Timo Sirainen <tss@iki.fi>
parents:
1637
diff
changeset
|
386 enum modify_type modify_type); |
e95c0e462591
API change for updating message flags.
Timo Sirainen <tss@iki.fi>
parents:
1637
diff
changeset
|
387 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
388 /* Expunge this message. Sequence numbers don't change until commit. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
389 int (*expunge)(struct mail *mail); |
450
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
390 }; |
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
391 |
0 | 392 #endif |