rev |
line source |
yuuji@0
|
1 /* ========================================================================
|
yuuji@0
|
2 * Copyright 1988-2008 University of Washington
|
yuuji@0
|
3 *
|
yuuji@0
|
4 * Licensed under the Apache License, Version 2.0 (the "License");
|
yuuji@0
|
5 * you may not use this file except in compliance with the License.
|
yuuji@0
|
6 * You may obtain a copy of the License at
|
yuuji@0
|
7 *
|
yuuji@0
|
8 * http://www.apache.org/licenses/LICENSE-2.0
|
yuuji@0
|
9 *
|
yuuji@0
|
10 *
|
yuuji@0
|
11 * ========================================================================
|
yuuji@0
|
12 */
|
yuuji@0
|
13
|
yuuji@0
|
14 /*
|
yuuji@0
|
15 * Program: Mailbox Access routines
|
yuuji@0
|
16 *
|
yuuji@0
|
17 * Author: Mark Crispin
|
yuuji@0
|
18 * UW Technology
|
yuuji@0
|
19 * University of Washington
|
yuuji@0
|
20 * Seattle, WA 98195
|
yuuji@0
|
21 * Internet: MRC@Washington.EDU
|
yuuji@0
|
22 *
|
yuuji@0
|
23 * Date: 22 November 1989
|
yuuji@3
|
24 * Last Edited: 22 July 2011
|
yuuji@0
|
25 */
|
yuuji@0
|
26
|
yuuji@0
|
27 /* The Version */
|
yuuji@0
|
28
|
yuuji@3
|
29 #define CCLIENTVERSION "2007f"
|
yuuji@0
|
30
|
yuuji@0
|
31 /* Build parameters */
|
yuuji@0
|
32
|
yuuji@0
|
33 #define CACHEINCREMENT 250 /* cache growth increments */
|
yuuji@0
|
34 #define MAILTMPLEN 1024 /* size of a temporary buffer */
|
yuuji@0
|
35 #define SENDBUFLEN 16385 /* size of temporary sending buffer, also
|
yuuji@0
|
36 * used for SMTP commands and NETMBX generation
|
yuuji@0
|
37 * buffer so shouldn't be made smaller than
|
yuuji@0
|
38 * MAILTMPLEN. Note that there's a guard byte,
|
yuuji@0
|
39 * so this is actually len+1. */
|
yuuji@0
|
40 #define MAXAUTHENTICATORS 8 /* maximum number of SASL authenticators */
|
yuuji@0
|
41 /* maximum number of messages */
|
yuuji@0
|
42 #define MAXMESSAGES (unsigned long) 1000000
|
yuuji@0
|
43 #define MAXLOGINTRIALS 3 /* maximum number of client login attempts */
|
yuuji@0
|
44 #define MAXWILDCARDS 10 /* maximum wildcards allowed in LIST/LSUB */
|
yuuji@0
|
45
|
yuuji@0
|
46
|
yuuji@0
|
47 /* These can't be changed without changing code */
|
yuuji@0
|
48
|
yuuji@0
|
49 #define NUSERFLAGS 30 /* maximum number of user flags */
|
yuuji@0
|
50 #define MAXUSERFLAG 50 /* maximum length of a user flag */
|
yuuji@0
|
51 #define BASEYEAR 1970 /* the year time began on Unix DON'T CHANGE */
|
yuuji@0
|
52 /* default for unqualified addresses */
|
yuuji@0
|
53 #define BADHOST ".MISSING-HOST-NAME."
|
yuuji@0
|
54 /* default for syntax errors in addresses */
|
yuuji@0
|
55 #define ERRHOST ".SYNTAX-ERROR."
|
yuuji@0
|
56
|
yuuji@0
|
57
|
yuuji@0
|
58 /* Coddle certain compilers' 6-character symbol limitation */
|
yuuji@0
|
59
|
yuuji@0
|
60 #ifdef __COMPILER_KCC__
|
yuuji@0
|
61 #include "shortsym.h"
|
yuuji@0
|
62 #endif
|
yuuji@0
|
63
|
yuuji@0
|
64
|
yuuji@0
|
65 /* Function status code */
|
yuuji@0
|
66
|
yuuji@0
|
67 #define NIL 0 /* convenient name */
|
yuuji@0
|
68 #define T 1 /* opposite of NIL */
|
yuuji@0
|
69 #define LONGT (long) 1 /* long T to pacify some compilers */
|
yuuji@0
|
70 #define VOIDT (void *) "" /* void T ditto */
|
yuuji@0
|
71
|
yuuji@0
|
72 /* Global and Driver Parameters */
|
yuuji@0
|
73
|
yuuji@0
|
74 /* 0xx: driver and authenticator flags */
|
yuuji@0
|
75 #define ENABLE_DRIVER (long) 1
|
yuuji@0
|
76 #define DISABLE_DRIVER (long) 2
|
yuuji@0
|
77 #define ENABLE_AUTHENTICATOR (long) 3
|
yuuji@0
|
78 #define DISABLE_AUTHENTICATOR (long) 4
|
yuuji@0
|
79 #define ENABLE_DEBUG (long) 5
|
yuuji@0
|
80 #define DISABLE_DEBUG (long) 6
|
yuuji@0
|
81 #define HIDE_AUTHENTICATOR (long) 7
|
yuuji@0
|
82 #define UNHIDE_AUTHENTICATOR (long) 8
|
yuuji@0
|
83 /* 1xx: c-client globals */
|
yuuji@0
|
84 #define GET_DRIVERS (long) 101
|
yuuji@0
|
85 #define SET_DRIVERS (long) 102
|
yuuji@0
|
86 #define GET_GETS (long) 103
|
yuuji@0
|
87 #define SET_GETS (long) 104
|
yuuji@0
|
88 #define GET_CACHE (long) 105
|
yuuji@0
|
89 #define SET_CACHE (long) 106
|
yuuji@0
|
90 #define GET_SMTPVERBOSE (long) 107
|
yuuji@0
|
91 #define SET_SMTPVERBOSE (long) 108
|
yuuji@0
|
92 #define GET_RFC822OUTPUT (long) 109
|
yuuji@0
|
93 #define SET_RFC822OUTPUT (long) 110
|
yuuji@0
|
94 #define GET_READPROGRESS (long) 111
|
yuuji@0
|
95 #define SET_READPROGRESS (long) 112
|
yuuji@0
|
96 #define GET_THREADERS (long) 113
|
yuuji@0
|
97 #define SET_THREADERS (long) 114
|
yuuji@0
|
98 #define GET_NAMESPACE (long) 115
|
yuuji@0
|
99 #define SET_NAMESPACE (long) 116
|
yuuji@0
|
100 #define GET_MAILPROXYCOPY (long) 117
|
yuuji@0
|
101 #define SET_MAILPROXYCOPY (long) 118
|
yuuji@0
|
102 #define GET_SERVICENAME (long) 119
|
yuuji@0
|
103 #define SET_SERVICENAME (long) 120
|
yuuji@0
|
104 #define GET_DRIVER (long) 121
|
yuuji@0
|
105 #define SET_DRIVER (long) 122
|
yuuji@0
|
106 #define GET_EXPUNGEATPING (long) 123
|
yuuji@0
|
107 #define SET_EXPUNGEATPING (long) 124
|
yuuji@0
|
108 #define GET_PARSEPHRASE (long) 125
|
yuuji@0
|
109 #define SET_PARSEPHRASE (long) 126
|
yuuji@0
|
110 #define GET_SSLDRIVER (long) 127
|
yuuji@0
|
111 #define SET_SSLDRIVER (long) 128
|
yuuji@0
|
112 #define GET_TRYSSLFIRST (long) 129
|
yuuji@0
|
113 #define SET_TRYSSLFIRST (long) 130
|
yuuji@0
|
114 #define GET_BLOCKNOTIFY (long) 131
|
yuuji@0
|
115 #define SET_BLOCKNOTIFY (long) 132
|
yuuji@0
|
116 #define GET_SORTRESULTS (long) 133
|
yuuji@0
|
117 #define SET_SORTRESULTS (long) 134
|
yuuji@0
|
118 #define GET_THREADRESULTS (long) 135
|
yuuji@0
|
119 #define SET_THREADRESULTS (long) 136
|
yuuji@0
|
120 #define GET_PARSELINE (long) 137
|
yuuji@0
|
121 #define SET_PARSELINE (long) 138
|
yuuji@0
|
122 #define GET_NEWSRCQUERY (long) 139
|
yuuji@0
|
123 #define SET_NEWSRCQUERY (long) 140
|
yuuji@0
|
124 #define GET_FREEENVELOPESPAREP (long) 141
|
yuuji@0
|
125 #define SET_FREEENVELOPESPAREP (long) 142
|
yuuji@0
|
126 #define GET_FREEELTSPAREP (long) 143
|
yuuji@0
|
127 #define SET_FREEELTSPAREP (long) 144
|
yuuji@0
|
128 #define GET_SSLSTART (long) 145
|
yuuji@0
|
129 #define SET_SSLSTART (long) 146
|
yuuji@0
|
130 #define GET_DEBUGSENSITIVE (long) 147
|
yuuji@0
|
131 #define SET_DEBUGSENSITIVE (long) 148
|
yuuji@0
|
132 #define GET_TCPDEBUG (long) 149
|
yuuji@0
|
133 #define SET_TCPDEBUG (long) 150
|
yuuji@0
|
134 #define GET_FREESTREAMSPAREP (long) 151
|
yuuji@0
|
135 #define SET_FREESTREAMSPAREP (long) 152
|
yuuji@0
|
136 #define GET_FREEBODYSPAREP (long) 153
|
yuuji@0
|
137 #define SET_FREEBODYSPAREP (long) 154
|
yuuji@0
|
138 #define GET_COPYUID (long) 155
|
yuuji@0
|
139 #define SET_COPYUID (long) 156
|
yuuji@0
|
140 #define GET_APPENDUID (long) 157
|
yuuji@0
|
141 #define SET_APPENDUID (long) 158
|
yuuji@0
|
142 #define GET_RFC822OUTPUTFULL (long) 159
|
yuuji@0
|
143 #define SET_RFC822OUTPUTFULL (long) 160
|
yuuji@0
|
144 #define GET_BLOCKENVINIT (long) 161
|
yuuji@0
|
145 #define SET_BLOCKENVINIT (long) 162
|
yuuji@0
|
146
|
yuuji@0
|
147 /* 2xx: environment */
|
yuuji@0
|
148 #define GET_USERNAME (long) 201
|
yuuji@0
|
149 #define SET_USERNAME (long) 202
|
yuuji@0
|
150 #define GET_HOMEDIR (long) 203
|
yuuji@0
|
151 #define SET_HOMEDIR (long) 204
|
yuuji@0
|
152 #define GET_LOCALHOST (long) 205
|
yuuji@0
|
153 #define SET_LOCALHOST (long) 206
|
yuuji@0
|
154 #define GET_SYSINBOX (long) 207
|
yuuji@0
|
155 #define SET_SYSINBOX (long) 208
|
yuuji@0
|
156 #define GET_USERPROMPT (long) 209
|
yuuji@0
|
157 #define SET_USERPROMPT (long) 210
|
yuuji@0
|
158 #define GET_DISABLEPLAINTEXT (long) 211
|
yuuji@0
|
159 #define SET_DISABLEPLAINTEXT (long) 212
|
yuuji@0
|
160 #define GET_CHROOTSERVER (long) 213
|
yuuji@0
|
161 #define SET_CHROOTSERVER (long) 214
|
yuuji@0
|
162 #define GET_ADVERTISETHEWORLD (long) 215
|
yuuji@0
|
163 #define SET_ADVERTISETHEWORLD (long) 216
|
yuuji@0
|
164 #define GET_DISABLEAUTOSHAREDNS (long) 217
|
yuuji@0
|
165 #define SET_DISABLEAUTOSHAREDNS (long) 218
|
yuuji@0
|
166 #define GET_MAILSUBDIR 219
|
yuuji@0
|
167 #define SET_MAILSUBDIR 220
|
yuuji@0
|
168 #define GET_DISABLE822TZTEXT 221
|
yuuji@0
|
169 #define SET_DISABLE822TZTEXT 222
|
yuuji@0
|
170 #define GET_LIMITEDADVERTISE (long) 223
|
yuuji@0
|
171 #define SET_LIMITEDADVERTISE (long) 224
|
yuuji@0
|
172 #define GET_LOGOUTHOOK (long) 225
|
yuuji@0
|
173 #define SET_LOGOUTHOOK (long) 226
|
yuuji@0
|
174 #define GET_LOGOUTDATA (long) 227
|
yuuji@0
|
175 #define SET_LOGOUTDATA (long) 228
|
yuuji@0
|
176 #define GET_EXTERNALAUTHID (long) 229
|
yuuji@0
|
177 #define SET_EXTERNALAUTHID (long) 230
|
yuuji@0
|
178 #define GET_SSLCAPATH (long) 231
|
yuuji@0
|
179 #define SET_SSLCAPATH (long) 232
|
yuuji@0
|
180
|
yuuji@0
|
181 /* 3xx: TCP/IP */
|
yuuji@0
|
182 #define GET_OPENTIMEOUT (long) 300
|
yuuji@0
|
183 #define SET_OPENTIMEOUT (long) 301
|
yuuji@0
|
184 #define GET_READTIMEOUT (long) 302
|
yuuji@0
|
185 #define SET_READTIMEOUT (long) 303
|
yuuji@0
|
186 #define GET_WRITETIMEOUT (long) 304
|
yuuji@0
|
187 #define SET_WRITETIMEOUT (long) 305
|
yuuji@0
|
188 #define GET_CLOSETIMEOUT (long) 306
|
yuuji@0
|
189 #define SET_CLOSETIMEOUT (long) 307
|
yuuji@0
|
190 #define GET_TIMEOUT (long) 308
|
yuuji@0
|
191 #define SET_TIMEOUT (long) 309
|
yuuji@0
|
192 #define GET_RSHTIMEOUT (long) 310
|
yuuji@0
|
193 #define SET_RSHTIMEOUT (long) 311
|
yuuji@0
|
194 #define GET_ALLOWREVERSEDNS (long) 312
|
yuuji@0
|
195 #define SET_ALLOWREVERSEDNS (long) 313
|
yuuji@0
|
196 #define GET_RSHCOMMAND (long) 314
|
yuuji@0
|
197 #define SET_RSHCOMMAND (long) 315
|
yuuji@0
|
198 #define GET_RSHPATH (long) 316
|
yuuji@0
|
199 #define SET_RSHPATH (long) 317
|
yuuji@0
|
200 #define GET_SSHTIMEOUT (long) 318
|
yuuji@0
|
201 #define SET_SSHTIMEOUT (long) 319
|
yuuji@0
|
202 #define GET_SSHCOMMAND (long) 320
|
yuuji@0
|
203 #define SET_SSHCOMMAND (long) 321
|
yuuji@0
|
204 #define GET_SSHPATH (long) 322
|
yuuji@0
|
205 #define SET_SSHPATH (long) 323
|
yuuji@0
|
206 #define GET_SSLCERTIFICATEQUERY (long) 324
|
yuuji@0
|
207 #define SET_SSLCERTIFICATEQUERY (long) 325
|
yuuji@0
|
208 #define GET_SSLFAILURE (long) 326
|
yuuji@0
|
209 #define SET_SSLFAILURE (long) 327
|
yuuji@0
|
210 #define GET_NEWSRCCANONHOST (long) 328
|
yuuji@0
|
211 #define SET_NEWSRCCANONHOST (long) 329
|
yuuji@0
|
212 #define GET_KINIT (long) 330
|
yuuji@0
|
213 #define SET_KINIT (long) 331
|
yuuji@0
|
214 #define GET_SSLCLIENTCERT (long) 332
|
yuuji@0
|
215 #define SET_SSLCLIENTCERT (long) 333
|
yuuji@0
|
216 #define GET_SSLCLIENTKEY (long) 334
|
yuuji@0
|
217 #define SET_SSLCLIENTKEY (long) 335
|
yuuji@0
|
218 #define GET_KERBEROS_CP_SVR_NAME (long) 336
|
yuuji@0
|
219 #define SET_KERBEROS_CP_SVR_NAME (long) 337
|
yuuji@0
|
220
|
yuuji@0
|
221 /* 4xx: network drivers */
|
yuuji@0
|
222 #define GET_MAXLOGINTRIALS (long) 400
|
yuuji@0
|
223 #define SET_MAXLOGINTRIALS (long) 401
|
yuuji@0
|
224 #define GET_LOOKAHEAD (long) 402
|
yuuji@0
|
225 #define SET_LOOKAHEAD (long) 403
|
yuuji@0
|
226 #define GET_IMAPPORT (long) 404
|
yuuji@0
|
227 #define SET_IMAPPORT (long) 405
|
yuuji@0
|
228 #define GET_PREFETCH (long) 406
|
yuuji@0
|
229 #define SET_PREFETCH (long) 407
|
yuuji@0
|
230 #define GET_CLOSEONERROR (long) 408
|
yuuji@0
|
231 #define SET_CLOSEONERROR (long) 409
|
yuuji@0
|
232 #define GET_POP3PORT (long) 410
|
yuuji@0
|
233 #define SET_POP3PORT (long) 411
|
yuuji@0
|
234 #define GET_UIDLOOKAHEAD (long) 412
|
yuuji@0
|
235 #define SET_UIDLOOKAHEAD (long) 413
|
yuuji@0
|
236 #define GET_NNTPPORT (long) 414
|
yuuji@0
|
237 #define SET_NNTPPORT (long) 415
|
yuuji@0
|
238 #define GET_IMAPENVELOPE (long) 416
|
yuuji@0
|
239 #define SET_IMAPENVELOPE (long) 417
|
yuuji@0
|
240 #define GET_IMAPREFERRAL (long) 418
|
yuuji@0
|
241 #define SET_IMAPREFERRAL (long) 419
|
yuuji@0
|
242 #define GET_SSLIMAPPORT (long) 420
|
yuuji@0
|
243 #define SET_SSLIMAPPORT (long) 421
|
yuuji@0
|
244 #define GET_SSLPOPPORT (long) 422
|
yuuji@0
|
245 #define SET_SSLPOPPORT (long) 423
|
yuuji@0
|
246 #define GET_SSLNNTPPORT (long) 424
|
yuuji@0
|
247 #define SET_SSLNNTPPORT (long) 425
|
yuuji@0
|
248 #define GET_SSLSMTPPORT (long) 426
|
yuuji@0
|
249 #define SET_SSLSMTPPORT (long) 427
|
yuuji@0
|
250 #define GET_SMTPPORT (long) 428
|
yuuji@0
|
251 #define SET_SMTPPORT (long) 429
|
yuuji@0
|
252 #define GET_IMAPEXTRAHEADERS (long) 430
|
yuuji@0
|
253 #define SET_IMAPEXTRAHEADERS (long) 431
|
yuuji@0
|
254 #define GET_ACL (long) 432
|
yuuji@0
|
255 #define SET_ACL (long) 433
|
yuuji@0
|
256 #define GET_LISTRIGHTS (long) 434
|
yuuji@0
|
257 #define SET_LISTRIGHTS (long) 435
|
yuuji@0
|
258 #define GET_MYRIGHTS (long) 436
|
yuuji@0
|
259 #define SET_MYRIGHTS (long) 437
|
yuuji@0
|
260 #define GET_QUOTA (long) 438
|
yuuji@0
|
261 #define SET_QUOTA (long) 439
|
yuuji@0
|
262 #define GET_QUOTAROOT (long) 440
|
yuuji@0
|
263 #define SET_QUOTAROOT (long) 441
|
yuuji@0
|
264 #define GET_IMAPTRYSSL (long) 442
|
yuuji@0
|
265 #define SET_IMAPTRYSSL (long) 443
|
yuuji@0
|
266 #define GET_FETCHLOOKAHEAD (long) 444
|
yuuji@0
|
267 #define SET_FETCHLOOKAHEAD (long) 445
|
yuuji@0
|
268 #define GET_NNTPRANGE (long) 446
|
yuuji@0
|
269 #define SET_NNTPRANGE (long) 447
|
yuuji@0
|
270 #define GET_NNTPHIDEPATH (long) 448
|
yuuji@0
|
271 #define SET_NNTPHIDEPATH (long) 449
|
yuuji@0
|
272 #define GET_SENDCOMMAND (long) 450
|
yuuji@0
|
273 #define SET_SENDCOMMAND (long) 451
|
yuuji@0
|
274 #define GET_IDLETIMEOUT (long) 452
|
yuuji@0
|
275 #define SET_IDLETIMEOUT (long) 453
|
yuuji@0
|
276 #define GET_FETCHLOOKAHEADLIMIT (long) 454
|
yuuji@0
|
277 #define SET_FETCHLOOKAHEADLIMIT (long) 455
|
yuuji@0
|
278
|
yuuji@0
|
279 /* 5xx: local file drivers */
|
yuuji@0
|
280 #define GET_MBXPROTECTION (long) 500
|
yuuji@0
|
281 #define SET_MBXPROTECTION (long) 501
|
yuuji@0
|
282 #define GET_DIRPROTECTION (long) 502
|
yuuji@0
|
283 #define SET_DIRPROTECTION (long) 503
|
yuuji@0
|
284 #define GET_LOCKPROTECTION (long) 504
|
yuuji@0
|
285 #define SET_LOCKPROTECTION (long) 505
|
yuuji@0
|
286 #define GET_FROMWIDGET (long) 506
|
yuuji@0
|
287 #define SET_FROMWIDGET (long) 507
|
yuuji@0
|
288 #define GET_NEWSACTIVE (long) 508
|
yuuji@0
|
289 #define SET_NEWSACTIVE (long) 509
|
yuuji@0
|
290 #define GET_NEWSSPOOL (long) 510
|
yuuji@0
|
291 #define SET_NEWSSPOOL (long) 511
|
yuuji@0
|
292 #define GET_NEWSRC (long) 512
|
yuuji@0
|
293 #define SET_NEWSRC (long) 513
|
yuuji@0
|
294 #define GET_EXTENSION (long) 514
|
yuuji@0
|
295 #define SET_EXTENSION (long) 515
|
yuuji@0
|
296 #define GET_DISABLEFCNTLLOCK (long) 516
|
yuuji@0
|
297 #define SET_DISABLEFCNTLLOCK (long) 517
|
yuuji@0
|
298 #define GET_LOCKEACCESERROR (long) 518
|
yuuji@0
|
299 #define SET_LOCKEACCESERROR (long) 519
|
yuuji@0
|
300 #define GET_LISTMAXLEVEL (long) 520
|
yuuji@0
|
301 #define SET_LISTMAXLEVEL (long) 521
|
yuuji@0
|
302 #define GET_ANONYMOUSHOME (long) 522
|
yuuji@0
|
303 #define SET_ANONYMOUSHOME (long) 523
|
yuuji@0
|
304 #define GET_FTPHOME (long) 524
|
yuuji@0
|
305 #define SET_FTPHOME (long) 525
|
yuuji@0
|
306 #define GET_PUBLICHOME (long) 526
|
yuuji@0
|
307 #define SET_PUBLICHOME (long) 527
|
yuuji@0
|
308 #define GET_SHAREDHOME (long) 528
|
yuuji@0
|
309 #define SET_SHAREDHOME (long) 529
|
yuuji@0
|
310 #define GET_MHPROFILE (long) 530
|
yuuji@0
|
311 #define SET_MHPROFILE (long) 531
|
yuuji@0
|
312 #define GET_MHPATH (long) 532
|
yuuji@0
|
313 #define SET_MHPATH (long) 533
|
yuuji@0
|
314 #define GET_ONETIMEEXPUNGEATPING (long) 534
|
yuuji@0
|
315 #define SET_ONETIMEEXPUNGEATPING (long) 535
|
yuuji@0
|
316 #define GET_USERHASNOLIFE (long) 536
|
yuuji@0
|
317 #define SET_USERHASNOLIFE (long) 537
|
yuuji@0
|
318 #define GET_FTPPROTECTION (long) 538
|
yuuji@0
|
319 #define SET_FTPPROTECTION (long) 539
|
yuuji@0
|
320 #define GET_PUBLICPROTECTION (long) 540
|
yuuji@0
|
321 #define SET_PUBLICPROTECTION (long) 541
|
yuuji@0
|
322 #define GET_SHAREDPROTECTION (long) 542
|
yuuji@0
|
323 #define SET_SHAREDPROTECTION (long) 543
|
yuuji@0
|
324 #define GET_LOCKTIMEOUT (long) 544
|
yuuji@0
|
325 #define SET_LOCKTIMEOUT (long) 545
|
yuuji@0
|
326 #define GET_NOTIMEZONES (long) 546
|
yuuji@0
|
327 #define SET_NOTIMEZONES (long) 547
|
yuuji@0
|
328 #define GET_HIDEDOTFILES (long) 548
|
yuuji@0
|
329 #define SET_HIDEDOTFILES (long) 549
|
yuuji@0
|
330 #define GET_FTPDIRPROTECTION (long) 550
|
yuuji@0
|
331 #define SET_FTPDIRPROTECTION (long) 551
|
yuuji@0
|
332 #define GET_PUBLICDIRPROTECTION (long) 552
|
yuuji@0
|
333 #define SET_PUBLICDIRPROTECTION (long) 553
|
yuuji@0
|
334 #define GET_SHAREDDIRPROTECTION (long) 554
|
yuuji@0
|
335 #define SET_SHAREDDIRPROTECTION (long) 555
|
yuuji@0
|
336 #define GET_TRUSTDNS (long) 556
|
yuuji@0
|
337 #define SET_TRUSTDNS (long) 557
|
yuuji@0
|
338 #define GET_SASLUSESPTRNAME (long) 558
|
yuuji@0
|
339 #define SET_SASLUSESPTRNAME (long) 559
|
yuuji@0
|
340 #define GET_NETFSSTATBUG (long) 560
|
yuuji@0
|
341 #define SET_NETFSSTATBUG (long) 561
|
yuuji@0
|
342 #define GET_SNARFMAILBOXNAME (long) 562
|
yuuji@0
|
343 #define SET_SNARFMAILBOXNAME (long) 563
|
yuuji@0
|
344 #define GET_SNARFINTERVAL (long) 564
|
yuuji@0
|
345 #define SET_SNARFINTERVAL (long) 565
|
yuuji@0
|
346 #define GET_SNARFPRESERVE (long) 566
|
yuuji@0
|
347 #define SET_SNARFPRESERVE (long) 567
|
yuuji@0
|
348 #define GET_INBOXPATH (long) 568
|
yuuji@0
|
349 #define SET_INBOXPATH (long) 569
|
yuuji@0
|
350 #define GET_DIRFMTTEST (long) 570
|
yuuji@0
|
351 #define SET_DIRFMTTEST (long) 571
|
yuuji@0
|
352 #define GET_SCANCONTENTS (long) 572
|
yuuji@0
|
353 #define SET_SCANCONTENTS (long) 573
|
yuuji@0
|
354 #define GET_MHALLOWINBOX (long) 574
|
yuuji@0
|
355 #define SET_MHALLOWINBOX (long) 575
|
yuuji@0
|
356
|
yuuji@0
|
357 /* Driver flags */
|
yuuji@0
|
358
|
yuuji@0
|
359 #define DR_DISABLE (long) 0x1 /* driver is disabled */
|
yuuji@0
|
360 #define DR_LOCAL (long) 0x2 /* local file driver */
|
yuuji@0
|
361 #define DR_MAIL (long) 0x4 /* supports mail */
|
yuuji@0
|
362 #define DR_NEWS (long) 0x8 /* supports news */
|
yuuji@0
|
363 #define DR_READONLY (long) 0x10 /* driver only allows readonly access */
|
yuuji@0
|
364 #define DR_NOFAST (long) 0x20 /* "fast" data is slow (whole msg fetch) */
|
yuuji@0
|
365 #define DR_NAMESPACE (long) 0x40/* driver has a special namespace */
|
yuuji@0
|
366 #define DR_LOWMEM (long) 0x80 /* low amounts of memory available */
|
yuuji@0
|
367 #define DR_LOCKING (long) 0x100 /* driver does locking */
|
yuuji@0
|
368 #define DR_CRLF (long) 0x200 /* driver internal form uses CRLF newlines */
|
yuuji@0
|
369 #define DR_NOSTICKY (long) 0x400/* driver does not support sticky UIDs */
|
yuuji@0
|
370 #define DR_RECYCLE (long) 0x800 /* driver does stream recycling */
|
yuuji@0
|
371 #define DR_XPOINT (long) 0x1000 /* needs to be checkpointed */
|
yuuji@0
|
372 /* driver has no real internal date */
|
yuuji@0
|
373 #define DR_NOINTDATE (long) 0x2000
|
yuuji@0
|
374 /* driver does not announce new mail */
|
yuuji@0
|
375 #define DR_NONEWMAIL (long) 0x4000
|
yuuji@0
|
376 /* driver does not announce new mail when RO */
|
yuuji@0
|
377 #define DR_NONEWMAILRONLY (long) 0x8000
|
yuuji@0
|
378 /* driver can be halfopen */
|
yuuji@0
|
379 #define DR_HALFOPEN (long) 0x10000
|
yuuji@0
|
380 #define DR_DIRFMT (long) 0x20000/* driver is a directory-format */
|
yuuji@0
|
381 #define DR_MODSEQ (long) 0x40000/* driver supports modseqs */
|
yuuji@0
|
382
|
yuuji@0
|
383
|
yuuji@0
|
384 /* Cache management function codes */
|
yuuji@0
|
385
|
yuuji@0
|
386 #define CH_INIT (long) 10 /* initialize cache */
|
yuuji@0
|
387 #define CH_SIZE (long) 11 /* (re-)size the cache */
|
yuuji@0
|
388 #define CH_MAKEELT (long) 30 /* return elt, make if needed */
|
yuuji@0
|
389 #define CH_ELT (long) 31 /* return elt if exists */
|
yuuji@0
|
390 #define CH_SORTCACHE (long) 35 /* return sortcache entry, make if needed */
|
yuuji@0
|
391 #define CH_FREE (long) 40 /* free space used by elt */
|
yuuji@0
|
392 /* free space used by sortcache */
|
yuuji@0
|
393 #define CH_FREESORTCACHE (long) 43
|
yuuji@0
|
394 #define CH_EXPUNGE (long) 45 /* delete elt pointer from list */
|
yuuji@0
|
395
|
yuuji@0
|
396
|
yuuji@0
|
397 /* Mailbox open options
|
yuuji@0
|
398 * For compatibility with the past, OP_DEBUG must always be 1.
|
yuuji@0
|
399 */
|
yuuji@0
|
400
|
yuuji@0
|
401 #define OP_DEBUG (long) 0x1 /* debug protocol negotiations */
|
yuuji@0
|
402 #define OP_READONLY (long) 0x2 /* read-only open */
|
yuuji@0
|
403 #define OP_ANONYMOUS (long) 0x4 /* anonymous open of newsgroup */
|
yuuji@0
|
404 #define OP_SHORTCACHE (long) 0x8/* short (elt-only) caching */
|
yuuji@0
|
405 #define OP_SILENT (long) 0x10 /* don't pass up events (internal use) */
|
yuuji@0
|
406 #define OP_PROTOTYPE (long) 0x20/* return driver prototype */
|
yuuji@0
|
407 #define OP_HALFOPEN (long) 0x40 /* half-open (IMAP connect but no select) */
|
yuuji@0
|
408 #define OP_EXPUNGE (long) 0x80 /* silently expunge recycle stream */
|
yuuji@0
|
409 #define OP_SECURE (long) 0x100 /* don't do non-secure authentication */
|
yuuji@0
|
410 #define OP_TRYSSL (long) 0x200 /* try SSL first */
|
yuuji@0
|
411 /* use multiple newsrc files */
|
yuuji@0
|
412 #define OP_MULNEWSRC (long) 0x400
|
yuuji@0
|
413 #define OP_NOKOD (long) 0x800 /* suppress kiss-of-death */
|
yuuji@0
|
414 #define OP_SNIFF (long) 0x1000 /* metadata only open */
|
yuuji@0
|
415 /* reserved for application use */
|
yuuji@0
|
416 #define OP_RESERVED (unsigned long) 0xff000000
|
yuuji@0
|
417
|
yuuji@0
|
418
|
yuuji@0
|
419 /* Net open options */
|
yuuji@0
|
420
|
yuuji@0
|
421 /* no error messages */
|
yuuji@0
|
422 #define NET_SILENT ((unsigned long) 0x80000000)
|
yuuji@0
|
423 /* no validation of SSL certificates */
|
yuuji@0
|
424 #define NET_NOVALIDATECERT ((unsigned long) 0x40000000)
|
yuuji@0
|
425 /* no open timeout */
|
yuuji@0
|
426 #define NET_NOOPENTIMEOUT ((unsigned long) 0x20000000)
|
yuuji@0
|
427 /* TLS not SSL */
|
yuuji@0
|
428 #define NET_TLSCLIENT ((unsigned long) 0x10000000)
|
yuuji@0
|
429 /* try SSL mode */
|
yuuji@0
|
430 #define NET_TRYSSL ((unsigned long) 0x8000000)
|
yuuji@0
|
431
|
yuuji@0
|
432 /* Close options */
|
yuuji@0
|
433
|
yuuji@0
|
434 #define CL_EXPUNGE (long) 1 /* expunge silently */
|
yuuji@0
|
435
|
yuuji@0
|
436
|
yuuji@0
|
437 /* Fetch options */
|
yuuji@0
|
438
|
yuuji@0
|
439 #define FT_UID (long) 0x1 /* argument is a UID */
|
yuuji@0
|
440 #define FT_PEEK (long) 0x2 /* peek at data */
|
yuuji@0
|
441 #define FT_NOT (long) 0x4 /* NOT flag for header lines fetch */
|
yuuji@0
|
442 #define FT_INTERNAL (long) 0x8 /* text can be internal strings */
|
yuuji@0
|
443 /* IMAP prefetch text when fetching header */
|
yuuji@0
|
444 #define FT_PREFETCHTEXT (long) 0x20
|
yuuji@0
|
445 #define FT_NOHDRS (long) 0x40 /* suppress fetching extra headers (note that
|
yuuji@0
|
446 this breaks news handling) */
|
yuuji@0
|
447 #define FT_NEEDENV (long) 0x80 /* (internal use) include envelope */
|
yuuji@0
|
448 #define FT_NEEDBODY (long) 0x100/* (internal use) include body structure */
|
yuuji@0
|
449 /* no fetch lookahead */
|
yuuji@0
|
450 #define FT_NOLOOKAHEAD (long) 0x200
|
yuuji@0
|
451 /* (internal use) lookahead in hdr searching */
|
yuuji@0
|
452 #define FT_SEARCHLOOKAHEAD (long) 0x400
|
yuuji@0
|
453 /* stringstruct return hack */
|
yuuji@0
|
454 #define FT_RETURNSTRINGSTRUCT (long) 0x800
|
yuuji@0
|
455
|
yuuji@0
|
456
|
yuuji@0
|
457 /* Flagging options */
|
yuuji@0
|
458
|
yuuji@0
|
459 #define ST_UID (long) 0x1 /* argument is a UID sequence */
|
yuuji@0
|
460 #define ST_SILENT (long) 0x2 /* don't return results */
|
yuuji@0
|
461 #define ST_SET (long) 0x4 /* set vs. clear */
|
yuuji@0
|
462
|
yuuji@0
|
463
|
yuuji@0
|
464 /* Expunge options */
|
yuuji@0
|
465
|
yuuji@0
|
466 #define EX_UID (long) 0x1 /* argument is a UID sequence */
|
yuuji@0
|
467
|
yuuji@0
|
468
|
yuuji@0
|
469 /* Copy options */
|
yuuji@0
|
470
|
yuuji@0
|
471 #define CP_UID (long) 0x1 /* argument is a UID sequence */
|
yuuji@0
|
472 #define CP_MOVE (long) 0x2 /* delete from source after copying */
|
yuuji@0
|
473 /* set debug in any created stream */
|
yuuji@0
|
474 #define CP_DEBUG (long) 0x20000000
|
yuuji@0
|
475
|
yuuji@0
|
476 /* Search/sort/thread options */
|
yuuji@0
|
477
|
yuuji@0
|
478 #define SE_UID (long) 0x1 /* return UID */
|
yuuji@0
|
479 #define SE_FREE (long) 0x2 /* free search program after finished */
|
yuuji@0
|
480 #define SE_NOPREFETCH (long) 0x4/* no search prefetching */
|
yuuji@0
|
481 #define SO_FREE (long) 0x8 /* free sort program after finished */
|
yuuji@0
|
482 #define SE_NOSERVER (long) 0x10 /* don't do server-based search/sort/thread */
|
yuuji@0
|
483 #define SE_RETAIN (long) 0x20 /* retain previous search results */
|
yuuji@0
|
484 #define SO_OVERVIEW (long) 0x40 /* use overviews in searching (NNTP only) */
|
yuuji@0
|
485 #define SE_NEEDBODY (long) 0x80 /* include body structure in prefetch */
|
yuuji@0
|
486 #define SE_NOHDRS (long) 0x100 /* suppress prefetching extra headers (note
|
yuuji@0
|
487 that this breaks news handling) */
|
yuuji@0
|
488 #define SE_NOLOCAL (long) 0x200 /* no local retry (IMAP only) */
|
yuuji@0
|
489
|
yuuji@0
|
490 #define SO_NOSERVER SE_NOSERVER /* compatibility name */
|
yuuji@0
|
491 #define SE_SILLYOK (long) 0x400 /* allow silly searches */
|
yuuji@0
|
492
|
yuuji@0
|
493
|
yuuji@0
|
494 /* Status options */
|
yuuji@0
|
495
|
yuuji@0
|
496 #define SA_MESSAGES (long) 0x1 /* number of messages */
|
yuuji@0
|
497 #define SA_RECENT (long) 0x2 /* number of recent messages */
|
yuuji@0
|
498 #define SA_UNSEEN (long) 0x4 /* number of unseen messages */
|
yuuji@0
|
499 #define SA_UIDNEXT (long) 0x8 /* next UID to be assigned */
|
yuuji@0
|
500 /* UID validity value */
|
yuuji@0
|
501 #define SA_UIDVALIDITY (long) 0x10
|
yuuji@0
|
502 /* set OP_DEBUG on any created stream */
|
yuuji@0
|
503 #define SA_DEBUG (long) 0x10000000
|
yuuji@0
|
504 /* use multiple newsrcs */
|
yuuji@0
|
505 #define SA_MULNEWSRC (long) 0x20000000
|
yuuji@0
|
506
|
yuuji@0
|
507 /* Mailgets flags */
|
yuuji@0
|
508
|
yuuji@0
|
509 #define MG_UID (long) 0x1 /* message number is a UID */
|
yuuji@0
|
510 #define MG_COPY (long) 0x2 /* must return copy of argument */
|
yuuji@0
|
511
|
yuuji@0
|
512 /* SASL authenticator categories */
|
yuuji@0
|
513
|
yuuji@0
|
514 #define AU_SECURE (long) 0x1 /* /secure allowed */
|
yuuji@0
|
515 #define AU_AUTHUSER (long) 0x2 /* /authuser=xxx allowed */
|
yuuji@0
|
516 /* authenticator hidden */
|
yuuji@0
|
517 #define AU_HIDE (long) 0x10000000
|
yuuji@0
|
518 /* authenticator disabled */
|
yuuji@0
|
519 #define AU_DISABLE (long) 0x20000000
|
yuuji@0
|
520
|
yuuji@0
|
521
|
yuuji@0
|
522 /* Garbage collection flags */
|
yuuji@0
|
523
|
yuuji@0
|
524 #define GC_ELT (long) 0x1 /* message cache elements */
|
yuuji@0
|
525 #define GC_ENV (long) 0x2 /* envelopes and bodies */
|
yuuji@0
|
526 #define GC_TEXTS (long) 0x4 /* cached texts */
|
yuuji@0
|
527
|
yuuji@0
|
528
|
yuuji@0
|
529 /* mm_log()/mm_notify() condition codes */
|
yuuji@0
|
530
|
yuuji@0
|
531 #define WARN (long) 1 /* mm_log warning type */
|
yuuji@0
|
532 #define ERROR (long) 2 /* mm_log error type */
|
yuuji@0
|
533 #define PARSE (long) 3 /* mm_log parse error type */
|
yuuji@0
|
534 #define BYE (long) 4 /* mm_notify stream dying */
|
yuuji@0
|
535 #define TCPDEBUG (long) 5 /* mm_log TCP debug babble */
|
yuuji@0
|
536
|
yuuji@0
|
537
|
yuuji@0
|
538 /* Bits from mail_parse_flags(). Don't change these, since the header format
|
yuuji@0
|
539 * used by tenex, mtx, and mbx corresponds to these bits.
|
yuuji@0
|
540 */
|
yuuji@0
|
541
|
yuuji@0
|
542 #define fSEEN 0x1
|
yuuji@0
|
543 #define fDELETED 0x2
|
yuuji@0
|
544 #define fFLAGGED 0x4
|
yuuji@0
|
545 #define fANSWERED 0x8
|
yuuji@0
|
546 #define fOLD 0x10
|
yuuji@0
|
547 #define fDRAFT 0x20
|
yuuji@0
|
548
|
yuuji@0
|
549 #define fEXPUNGED 0x8000 /* internal flag */
|
yuuji@0
|
550
|
yuuji@0
|
551 /* Bits for mm_list() and mm_lsub() */
|
yuuji@0
|
552
|
yuuji@0
|
553 /* Note that (LATT_NOINFERIORS LATT_HASCHILDREN LATT_HASNOCHILDREN) and
|
yuuji@0
|
554 * (LATT_NOSELECT LATT_MARKED LATT_UNMARKED) each have eight possible states,
|
yuuji@0
|
555 * but only four of these are valid. The other four are silly states which
|
yuuji@0
|
556 * while invalid can unfortunately be expressed in the IMAP protocol.
|
yuuji@0
|
557 */
|
yuuji@0
|
558
|
yuuji@0
|
559 /* terminal node in hierarchy */
|
yuuji@0
|
560 #define LATT_NOINFERIORS (long) 0x1
|
yuuji@0
|
561 /* name can not be selected */
|
yuuji@0
|
562 #define LATT_NOSELECT (long) 0x2
|
yuuji@0
|
563 /* changed since last accessed */
|
yuuji@0
|
564 #define LATT_MARKED (long) 0x4
|
yuuji@0
|
565 /* accessed since last changed */
|
yuuji@0
|
566 #define LATT_UNMARKED (long) 0x8
|
yuuji@0
|
567 /* name has referral to remote mailbox */
|
yuuji@0
|
568 #define LATT_REFERRAL (long) 0x10
|
yuuji@0
|
569 /* has selectable inferiors */
|
yuuji@0
|
570 #define LATT_HASCHILDREN (long) 0x20
|
yuuji@0
|
571 /* has no selectable inferiors */
|
yuuji@0
|
572 #define LATT_HASNOCHILDREN (long) 0x40
|
yuuji@0
|
573
|
yuuji@0
|
574
|
yuuji@0
|
575 /* Sort functions */
|
yuuji@0
|
576
|
yuuji@0
|
577 #define SORTDATE 0 /* date */
|
yuuji@0
|
578 #define SORTARRIVAL 1 /* arrival date */
|
yuuji@0
|
579 #define SORTFROM 2 /* from */
|
yuuji@0
|
580 #define SORTSUBJECT 3 /* subject */
|
yuuji@0
|
581 #define SORTTO 4 /* to */
|
yuuji@0
|
582 #define SORTCC 5 /* cc */
|
yuuji@0
|
583 #define SORTSIZE 6 /* size */
|
yuuji@0
|
584
|
yuuji@0
|
585
|
yuuji@0
|
586 /* imapreferral_t codes */
|
yuuji@0
|
587
|
yuuji@0
|
588 #define REFAUTHFAILED (long) 0 /* authentication referral -- not logged in */
|
yuuji@0
|
589 #define REFAUTH (long) 1 /* authentication referral -- logged in */
|
yuuji@0
|
590 #define REFSELECT (long) 2 /* select referral */
|
yuuji@0
|
591 #define REFCREATE (long) 3
|
yuuji@0
|
592 #define REFDELETE (long) 4
|
yuuji@0
|
593 #define REFRENAME (long) 5
|
yuuji@0
|
594 #define REFSUBSCRIBE (long) 6
|
yuuji@0
|
595 #define REFUNSUBSCRIBE (long) 7
|
yuuji@0
|
596 #define REFSTATUS (long) 8
|
yuuji@0
|
597 #define REFCOPY (long) 9
|
yuuji@0
|
598 #define REFAPPEND (long) 10
|
yuuji@0
|
599
|
yuuji@0
|
600
|
yuuji@0
|
601 /* sendcommand_t codes */
|
yuuji@0
|
602
|
yuuji@0
|
603 /* expunge response deferred */
|
yuuji@0
|
604 #define SC_EXPUNGEDEFERRED (long) 1
|
yuuji@0
|
605
|
yuuji@0
|
606 /* Block notification codes */
|
yuuji@0
|
607
|
yuuji@0
|
608 #define BLOCK_NONE 0 /* not blocked */
|
yuuji@0
|
609 #define BLOCK_SENSITIVE 1 /* sensitive code, disallow alarms */
|
yuuji@0
|
610 #define BLOCK_NONSENSITIVE 2 /* non-sensitive code, allow alarms */
|
yuuji@0
|
611 #define BLOCK_DNSLOOKUP 10 /* blocked on DNS lookup */
|
yuuji@0
|
612 #define BLOCK_TCPOPEN 11 /* blocked on TCP open */
|
yuuji@0
|
613 #define BLOCK_TCPREAD 12 /* blocked on TCP read */
|
yuuji@0
|
614 #define BLOCK_TCPWRITE 13 /* blocked on TCP write */
|
yuuji@0
|
615 #define BLOCK_TCPCLOSE 14 /* blocked on TCP close */
|
yuuji@0
|
616 #define BLOCK_FILELOCK 20 /* blocked on file locking */
|
yuuji@0
|
617
|
yuuji@0
|
618
|
yuuji@0
|
619 /* In-memory sized-text */
|
yuuji@0
|
620
|
yuuji@0
|
621 #define SIZEDTEXT struct mail_sizedtext
|
yuuji@0
|
622
|
yuuji@0
|
623 SIZEDTEXT {
|
yuuji@0
|
624 unsigned char *data; /* text */
|
yuuji@0
|
625 unsigned long size; /* size of text in octets */
|
yuuji@0
|
626 };
|
yuuji@0
|
627
|
yuuji@0
|
628
|
yuuji@0
|
629 /* String list */
|
yuuji@0
|
630
|
yuuji@0
|
631 #define STRINGLIST struct string_list
|
yuuji@0
|
632
|
yuuji@0
|
633 STRINGLIST {
|
yuuji@0
|
634 SIZEDTEXT text; /* string text */
|
yuuji@0
|
635 STRINGLIST *next;
|
yuuji@0
|
636 };
|
yuuji@0
|
637
|
yuuji@0
|
638
|
yuuji@0
|
639 /* Parse results from mail_valid_net_parse */
|
yuuji@0
|
640
|
yuuji@0
|
641 #define NETMAXHOST 256
|
yuuji@0
|
642 #define NETMAXUSER 65
|
yuuji@0
|
643 #define NETMAXMBX (MAILTMPLEN/4)
|
yuuji@0
|
644 #define NETMAXSRV 21
|
yuuji@0
|
645 typedef struct net_mailbox {
|
yuuji@0
|
646 char host[NETMAXHOST]; /* host name (may be canonicalized) */
|
yuuji@0
|
647 char orighost[NETMAXHOST]; /* host name before canonicalization */
|
yuuji@0
|
648 char user[NETMAXUSER]; /* user name */
|
yuuji@0
|
649 char authuser[NETMAXUSER]; /* authentication user name */
|
yuuji@0
|
650 char mailbox[NETMAXMBX]; /* mailbox name */
|
yuuji@0
|
651 char service[NETMAXSRV]; /* service name */
|
yuuji@0
|
652 unsigned long port; /* TCP port number */
|
yuuji@0
|
653 unsigned int anoflag : 1; /* anonymous */
|
yuuji@0
|
654 unsigned int dbgflag : 1; /* debug flag */
|
yuuji@0
|
655 unsigned int secflag : 1; /* secure flag */
|
yuuji@0
|
656 unsigned int sslflag : 1; /* SSL driver flag */
|
yuuji@0
|
657 unsigned int trysslflag : 1; /* try SSL driver first flag */
|
yuuji@0
|
658 unsigned int novalidate : 1; /* don't validate certificates */
|
yuuji@0
|
659 unsigned int tlsflag : 1; /* TLS flag */
|
yuuji@0
|
660 unsigned int notlsflag : 1; /* do not do TLS flag */
|
yuuji@0
|
661 unsigned int readonlyflag : 1;/* want readonly */
|
yuuji@0
|
662 unsigned int norsh : 1; /* don't use rsh/ssh */
|
yuuji@0
|
663 unsigned int loser : 1; /* server is a loser */
|
yuuji@0
|
664 unsigned int tlssslv23 : 1; /* force SSLv23 client method over TLS */
|
yuuji@0
|
665 } NETMBX;
|
yuuji@0
|
666
|
yuuji@0
|
667 /* Item in an address list */
|
yuuji@0
|
668
|
yuuji@0
|
669 #define ADDRESS struct mail_address
|
yuuji@0
|
670
|
yuuji@0
|
671 ADDRESS {
|
yuuji@0
|
672 char *personal; /* personal name phrase */
|
yuuji@0
|
673 char *adl; /* at-domain-list source route */
|
yuuji@0
|
674 char *mailbox; /* mailbox name */
|
yuuji@0
|
675 char *host; /* domain name of mailbox's host */
|
yuuji@0
|
676 char *error; /* error in address from SMTP module */
|
yuuji@0
|
677 struct {
|
yuuji@0
|
678 char *type; /* address type (default "rfc822") */
|
yuuji@0
|
679 char *addr; /* address as xtext */
|
yuuji@0
|
680 } orcpt;
|
yuuji@0
|
681 ADDRESS *next; /* pointer to next address in list */
|
yuuji@0
|
682 };
|
yuuji@0
|
683
|
yuuji@0
|
684
|
yuuji@0
|
685 /* Message envelope */
|
yuuji@0
|
686
|
yuuji@0
|
687 typedef struct mail_envelope {
|
yuuji@0
|
688 unsigned int incomplete : 1; /* envelope may be incomplete */
|
yuuji@0
|
689 unsigned int imapenvonly : 1; /* envelope only has IMAP envelope */
|
yuuji@0
|
690 char *remail; /* remail header if any */
|
yuuji@0
|
691 ADDRESS *return_path; /* error return address */
|
yuuji@0
|
692 unsigned char *date; /* message composition date string */
|
yuuji@0
|
693 ADDRESS *from; /* originator address list */
|
yuuji@0
|
694 ADDRESS *sender; /* sender address list */
|
yuuji@0
|
695 ADDRESS *reply_to; /* reply address list */
|
yuuji@0
|
696 char *subject; /* message subject string */
|
yuuji@0
|
697 ADDRESS *to; /* primary recipient list */
|
yuuji@0
|
698 ADDRESS *cc; /* secondary recipient list */
|
yuuji@0
|
699 ADDRESS *bcc; /* blind secondary recipient list */
|
yuuji@0
|
700 char *in_reply_to; /* replied message ID */
|
yuuji@0
|
701 char *message_id; /* message ID */
|
yuuji@0
|
702 char *newsgroups; /* USENET newsgroups */
|
yuuji@0
|
703 char *followup_to; /* USENET reply newsgroups */
|
yuuji@0
|
704 char *references; /* USENET references */
|
yuuji@0
|
705 void *sparep; /* spare pointer reserved for main program */
|
yuuji@0
|
706 } ENVELOPE;
|
yuuji@0
|
707
|
yuuji@0
|
708 /* Primary body types */
|
yuuji@0
|
709 /* If you change any of these you must also change body_types in rfc822.c */
|
yuuji@0
|
710
|
yuuji@0
|
711 #define TYPETEXT 0 /* unformatted text */
|
yuuji@0
|
712 #define TYPEMULTIPART 1 /* multiple part */
|
yuuji@0
|
713 #define TYPEMESSAGE 2 /* encapsulated message */
|
yuuji@0
|
714 #define TYPEAPPLICATION 3 /* application data */
|
yuuji@0
|
715 #define TYPEAUDIO 4 /* audio */
|
yuuji@0
|
716 #define TYPEIMAGE 5 /* static image */
|
yuuji@0
|
717 #define TYPEVIDEO 6 /* video */
|
yuuji@0
|
718 #define TYPEMODEL 7 /* model */
|
yuuji@0
|
719 #define TYPEOTHER 8 /* unknown */
|
yuuji@0
|
720 #define TYPEMAX 15 /* maximum type code */
|
yuuji@0
|
721
|
yuuji@0
|
722
|
yuuji@0
|
723 /* Body encodings */
|
yuuji@0
|
724 /* If you change any of these you must also change body_encodings in rfc822.c
|
yuuji@0
|
725 */
|
yuuji@0
|
726
|
yuuji@0
|
727 #define ENC7BIT 0 /* 7 bit SMTP semantic data */
|
yuuji@0
|
728 #define ENC8BIT 1 /* 8 bit SMTP semantic data */
|
yuuji@0
|
729 #define ENCBINARY 2 /* 8 bit binary data */
|
yuuji@0
|
730 #define ENCBASE64 3 /* base-64 encoded data */
|
yuuji@0
|
731 #define ENCQUOTEDPRINTABLE 4 /* human-readable 8-as-7 bit data */
|
yuuji@0
|
732 #define ENCOTHER 5 /* unknown */
|
yuuji@0
|
733 #define ENCMAX 10 /* maximum encoding code */
|
yuuji@0
|
734
|
yuuji@0
|
735
|
yuuji@0
|
736 /* Body contents */
|
yuuji@0
|
737
|
yuuji@0
|
738 #define BODY struct mail_bodystruct
|
yuuji@0
|
739 #define MESSAGE struct mail_body_message
|
yuuji@0
|
740 #define PARAMETER struct mail_body_parameter
|
yuuji@0
|
741 #define PART struct mail_body_part
|
yuuji@0
|
742 #define PARTTEXT struct mail_body_text
|
yuuji@0
|
743
|
yuuji@0
|
744 /* Message body text */
|
yuuji@0
|
745
|
yuuji@0
|
746 PARTTEXT {
|
yuuji@0
|
747 unsigned long offset; /* offset from body origin */
|
yuuji@0
|
748 SIZEDTEXT text; /* text */
|
yuuji@0
|
749 };
|
yuuji@0
|
750
|
yuuji@0
|
751
|
yuuji@0
|
752 /* Message body structure */
|
yuuji@0
|
753
|
yuuji@0
|
754 BODY {
|
yuuji@0
|
755 unsigned short type; /* body primary type */
|
yuuji@0
|
756 unsigned short encoding; /* body transfer encoding */
|
yuuji@0
|
757 char *subtype; /* subtype string */
|
yuuji@0
|
758 PARAMETER *parameter; /* parameter list */
|
yuuji@0
|
759 char *id; /* body identifier */
|
yuuji@0
|
760 char *description; /* body description */
|
yuuji@0
|
761 struct { /* body disposition */
|
yuuji@0
|
762 char *type; /* disposition type */
|
yuuji@0
|
763 PARAMETER *parameter; /* disposition parameters */
|
yuuji@0
|
764 } disposition;
|
yuuji@0
|
765 STRINGLIST *language; /* body language */
|
yuuji@0
|
766 char *location; /* body content URI */
|
yuuji@0
|
767 PARTTEXT mime; /* MIME header */
|
yuuji@0
|
768 PARTTEXT contents; /* body part contents */
|
yuuji@0
|
769 union { /* different ways of accessing contents */
|
yuuji@0
|
770 PART *part; /* body part list */
|
yuuji@0
|
771 MESSAGE *msg; /* body encapsulated message */
|
yuuji@0
|
772 } nested;
|
yuuji@0
|
773 struct {
|
yuuji@0
|
774 unsigned long lines; /* size of text in lines */
|
yuuji@0
|
775 unsigned long bytes; /* size of text in octets */
|
yuuji@0
|
776 } size;
|
yuuji@0
|
777 char *md5; /* MD5 checksum */
|
yuuji@0
|
778 void *sparep; /* spare pointer reserved for main program */
|
yuuji@0
|
779 };
|
yuuji@0
|
780
|
yuuji@0
|
781
|
yuuji@0
|
782 /* Parameter list */
|
yuuji@0
|
783
|
yuuji@0
|
784 PARAMETER {
|
yuuji@0
|
785 char *attribute; /* parameter attribute name */
|
yuuji@0
|
786 char *value; /* parameter value */
|
yuuji@0
|
787 PARAMETER *next; /* next parameter in list */
|
yuuji@0
|
788 };
|
yuuji@0
|
789
|
yuuji@0
|
790
|
yuuji@0
|
791 /* Multipart content list */
|
yuuji@0
|
792
|
yuuji@0
|
793 PART {
|
yuuji@0
|
794 BODY body; /* body information for this part */
|
yuuji@0
|
795 PART *next; /* next body part */
|
yuuji@0
|
796 };
|
yuuji@0
|
797
|
yuuji@0
|
798
|
yuuji@0
|
799 /* RFC-822 Message */
|
yuuji@0
|
800
|
yuuji@0
|
801 MESSAGE {
|
yuuji@0
|
802 ENVELOPE *env; /* message envelope */
|
yuuji@0
|
803 BODY *body; /* message body */
|
yuuji@0
|
804 PARTTEXT full; /* full message */
|
yuuji@0
|
805 STRINGLIST *lines; /* lines used to filter header */
|
yuuji@0
|
806 PARTTEXT header; /* header text */
|
yuuji@0
|
807 PARTTEXT text; /* body text */
|
yuuji@0
|
808 };
|
yuuji@0
|
809
|
yuuji@0
|
810 /* Entry in the message cache array */
|
yuuji@0
|
811
|
yuuji@0
|
812 typedef struct message_cache {
|
yuuji@0
|
813 unsigned long msgno; /* message number */
|
yuuji@0
|
814 unsigned int lockcount : 8; /* non-zero if multiple references */
|
yuuji@0
|
815 unsigned long rfc822_size; /* # of bytes of message as raw RFC822 */
|
yuuji@0
|
816 struct { /* c-client internal use only */
|
yuuji@0
|
817 unsigned long uid; /* message unique ID */
|
yuuji@0
|
818 unsigned long mod; /* modseq */
|
yuuji@0
|
819 PARTTEXT special; /* special text pointers */
|
yuuji@0
|
820 MESSAGE msg; /* internal message pointers */
|
yuuji@0
|
821 union { /* driver internal use */
|
yuuji@0
|
822 unsigned long data;
|
yuuji@0
|
823 void *ptr;
|
yuuji@0
|
824 } spare;
|
yuuji@0
|
825 unsigned int sequence : 1; /* saved sequence bit */
|
yuuji@0
|
826 unsigned int dirty : 1; /* driver internal use */
|
yuuji@0
|
827 unsigned int filter : 1; /* driver internal use */
|
yuuji@0
|
828 unsigned int ghost : 1; /* driver internal use */
|
yuuji@0
|
829 } private;
|
yuuji@0
|
830 /* internal date */
|
yuuji@0
|
831 unsigned int day : 5; /* day of month (1-31) */
|
yuuji@0
|
832 unsigned int month : 4; /* month of year (1-12) */
|
yuuji@0
|
833 unsigned int year : 7; /* year since BASEYEAR (expires in 127 yrs) */
|
yuuji@0
|
834 unsigned int hours: 5; /* hours (0-23) */
|
yuuji@0
|
835 unsigned int minutes: 6; /* minutes (0-59) */
|
yuuji@0
|
836 unsigned int seconds: 6; /* seconds (0-59) */
|
yuuji@0
|
837 unsigned int zoccident : 1; /* non-zero if west of UTC */
|
yuuji@0
|
838 unsigned int zhours : 4; /* hours from UTC (0-12) */
|
yuuji@0
|
839 unsigned int zminutes: 6; /* minutes (0-59) */
|
yuuji@0
|
840 /* system flags */
|
yuuji@0
|
841 unsigned int seen : 1; /* system Seen flag */
|
yuuji@0
|
842 unsigned int deleted : 1; /* system Deleted flag */
|
yuuji@0
|
843 unsigned int flagged : 1; /* system Flagged flag */
|
yuuji@0
|
844 unsigned int answered : 1; /* system Answered flag */
|
yuuji@0
|
845 unsigned int draft : 1; /* system Draft flag */
|
yuuji@0
|
846 unsigned int recent : 1; /* system Recent flag */
|
yuuji@0
|
847 /* message status */
|
yuuji@0
|
848 unsigned int valid : 1; /* elt has valid flags */
|
yuuji@0
|
849 unsigned int searched : 1; /* message was searched */
|
yuuji@0
|
850 unsigned int sequence : 1; /* message is in sequence */
|
yuuji@0
|
851 /* reserved for use by main program */
|
yuuji@0
|
852 unsigned int spare : 1; /* first spare bit */
|
yuuji@0
|
853 unsigned int spare2 : 1; /* second spare bit */
|
yuuji@0
|
854 unsigned int spare3 : 1; /* third spare bit */
|
yuuji@0
|
855 unsigned int spare4 : 1; /* fourth spare bit */
|
yuuji@0
|
856 unsigned int spare5 : 1; /* fifth spare bit */
|
yuuji@0
|
857 unsigned int spare6 : 1; /* sixth spare bit */
|
yuuji@0
|
858 unsigned int spare7 : 1; /* seventh spare bit */
|
yuuji@0
|
859 unsigned int spare8 : 1; /* eighth spare bit */
|
yuuji@0
|
860 void *sparep; /* spare pointer */
|
yuuji@4
|
861 void *maildirp; /* for the Maildir driver */
|
yuuji@0
|
862 unsigned long user_flags; /* user-assignable flags */
|
yuuji@0
|
863 } MESSAGECACHE;
|
yuuji@0
|
864
|
yuuji@0
|
865 /* String structure */
|
yuuji@0
|
866
|
yuuji@0
|
867 #define STRINGDRIVER struct string_driver
|
yuuji@0
|
868
|
yuuji@0
|
869 typedef struct mailstring {
|
yuuji@0
|
870 void *data; /* driver-dependent data */
|
yuuji@0
|
871 unsigned long data1; /* driver-dependent data */
|
yuuji@0
|
872 unsigned long size; /* total length of string */
|
yuuji@0
|
873 char *chunk; /* base address of chunk */
|
yuuji@0
|
874 unsigned long chunksize; /* size of chunk */
|
yuuji@0
|
875 unsigned long offset; /* offset of this chunk in base */
|
yuuji@0
|
876 char *curpos; /* current position in chunk */
|
yuuji@0
|
877 unsigned long cursize; /* number of bytes remaining in chunk */
|
yuuji@0
|
878 STRINGDRIVER *dtb; /* driver that handles this type of string */
|
yuuji@0
|
879 } STRING;
|
yuuji@0
|
880
|
yuuji@0
|
881
|
yuuji@0
|
882 /* Dispatch table for string driver */
|
yuuji@0
|
883
|
yuuji@0
|
884 STRINGDRIVER {
|
yuuji@0
|
885 /* initialize string driver */
|
yuuji@0
|
886 void (*init) (STRING *s,void *data,unsigned long size);
|
yuuji@0
|
887 /* get next character in string */
|
yuuji@0
|
888 char (*next) (STRING *s);
|
yuuji@0
|
889 /* set position in string */
|
yuuji@0
|
890 void (*setpos) (STRING *s,unsigned long i);
|
yuuji@0
|
891 };
|
yuuji@0
|
892
|
yuuji@0
|
893
|
yuuji@0
|
894 /* Stringstruct access routines */
|
yuuji@0
|
895
|
yuuji@0
|
896 #define INIT(s,d,data,size) ((*((s)->dtb = &d)->init) (s,data,size))
|
yuuji@0
|
897 #define SIZE(s) ((s)->size - GETPOS (s))
|
yuuji@0
|
898 #define CHR(s) (*(s)->curpos)
|
yuuji@0
|
899 #define SNX(s) (--(s)->cursize ? *(s)->curpos++ : (*(s)->dtb->next) (s))
|
yuuji@0
|
900 #define GETPOS(s) ((s)->offset + ((s)->curpos - (s)->chunk))
|
yuuji@0
|
901 #define SETPOS(s,i) (*(s)->dtb->setpos) (s,i)
|
yuuji@0
|
902
|
yuuji@0
|
903 /* Search program */
|
yuuji@0
|
904
|
yuuji@0
|
905 #define SEARCHPGM struct search_program
|
yuuji@0
|
906 #define SEARCHHEADER struct search_header
|
yuuji@0
|
907 #define SEARCHSET struct search_set
|
yuuji@0
|
908 #define SEARCHOR struct search_or
|
yuuji@0
|
909 #define SEARCHPGMLIST struct search_pgm_list
|
yuuji@0
|
910
|
yuuji@0
|
911
|
yuuji@0
|
912 SEARCHHEADER { /* header search */
|
yuuji@0
|
913 SIZEDTEXT line; /* header line */
|
yuuji@0
|
914 SIZEDTEXT text; /* text in header */
|
yuuji@0
|
915 SEARCHHEADER *next; /* next in list */
|
yuuji@0
|
916 };
|
yuuji@0
|
917
|
yuuji@0
|
918
|
yuuji@0
|
919 SEARCHSET { /* message set */
|
yuuji@0
|
920 unsigned long first; /* sequence number */
|
yuuji@0
|
921 unsigned long last; /* last value, if a range */
|
yuuji@0
|
922 SEARCHSET *next; /* next in list */
|
yuuji@0
|
923 };
|
yuuji@0
|
924
|
yuuji@0
|
925
|
yuuji@0
|
926 SEARCHOR {
|
yuuji@0
|
927 SEARCHPGM *first; /* first program */
|
yuuji@0
|
928 SEARCHPGM *second; /* second program */
|
yuuji@0
|
929 SEARCHOR *next; /* next in list */
|
yuuji@0
|
930 };
|
yuuji@0
|
931
|
yuuji@0
|
932
|
yuuji@0
|
933 SEARCHPGMLIST {
|
yuuji@0
|
934 SEARCHPGM *pgm; /* search program */
|
yuuji@0
|
935 SEARCHPGMLIST *next; /* next in list */
|
yuuji@0
|
936 };
|
yuuji@0
|
937
|
yuuji@0
|
938 SEARCHPGM { /* search program */
|
yuuji@0
|
939 SEARCHSET *msgno; /* message numbers */
|
yuuji@0
|
940 SEARCHSET *uid; /* unique identifiers */
|
yuuji@0
|
941 SEARCHOR *or; /* or'ed in programs */
|
yuuji@0
|
942 SEARCHPGMLIST *not; /* and'ed not program */
|
yuuji@0
|
943 SEARCHHEADER *header; /* list of headers */
|
yuuji@0
|
944 STRINGLIST *bcc; /* bcc recipients */
|
yuuji@0
|
945 STRINGLIST *body; /* text in message body */
|
yuuji@0
|
946 STRINGLIST *cc; /* cc recipients */
|
yuuji@0
|
947 STRINGLIST *from; /* originator */
|
yuuji@0
|
948 STRINGLIST *keyword; /* keywords */
|
yuuji@0
|
949 STRINGLIST *unkeyword; /* unkeywords */
|
yuuji@0
|
950 STRINGLIST *subject; /* text in subject */
|
yuuji@0
|
951 STRINGLIST *text; /* text in headers and body */
|
yuuji@0
|
952 STRINGLIST *to; /* to recipients */
|
yuuji@0
|
953 unsigned long larger; /* larger than this size */
|
yuuji@0
|
954 unsigned long smaller; /* smaller than this size */
|
yuuji@0
|
955 unsigned long older; /* older than this interval */
|
yuuji@0
|
956 unsigned long younger; /* younger than this interval */
|
yuuji@0
|
957 unsigned short sentbefore; /* sent before this date */
|
yuuji@0
|
958 unsigned short senton; /* sent on this date */
|
yuuji@0
|
959 unsigned short sentsince; /* sent since this date */
|
yuuji@0
|
960 unsigned short before; /* before this date */
|
yuuji@0
|
961 unsigned short on; /* on this date */
|
yuuji@0
|
962 unsigned short since; /* since this date */
|
yuuji@0
|
963 unsigned int answered : 1; /* answered messages */
|
yuuji@0
|
964 unsigned int unanswered : 1; /* unanswered messages */
|
yuuji@0
|
965 unsigned int deleted : 1; /* deleted messages */
|
yuuji@0
|
966 unsigned int undeleted : 1; /* undeleted messages */
|
yuuji@0
|
967 unsigned int draft : 1; /* message draft */
|
yuuji@0
|
968 unsigned int undraft : 1; /* message undraft */
|
yuuji@0
|
969 unsigned int flagged : 1; /* flagged messages */
|
yuuji@0
|
970 unsigned int unflagged : 1; /* unflagged messages */
|
yuuji@0
|
971 unsigned int recent : 1; /* recent messages */
|
yuuji@0
|
972 unsigned int old : 1; /* old messages */
|
yuuji@0
|
973 unsigned int seen : 1; /* seen messages */
|
yuuji@0
|
974 unsigned int unseen : 1; /* unseen messages */
|
yuuji@0
|
975 /* These must be simulated in IMAP */
|
yuuji@0
|
976 STRINGLIST *return_path; /* error return address */
|
yuuji@0
|
977 STRINGLIST *sender; /* sender address list */
|
yuuji@0
|
978 STRINGLIST *reply_to; /* reply address list */
|
yuuji@0
|
979 STRINGLIST *in_reply_to; /* replied message ID */
|
yuuji@0
|
980 STRINGLIST *message_id; /* message ID */
|
yuuji@0
|
981 STRINGLIST *newsgroups; /* USENET newsgroups */
|
yuuji@0
|
982 STRINGLIST *followup_to; /* USENET reply newsgroups */
|
yuuji@0
|
983 STRINGLIST *references; /* USENET references */
|
yuuji@0
|
984 };
|
yuuji@0
|
985
|
yuuji@0
|
986
|
yuuji@0
|
987 /* Mailbox status */
|
yuuji@0
|
988
|
yuuji@0
|
989 typedef struct mbx_status {
|
yuuji@0
|
990 long flags; /* validity flags */
|
yuuji@0
|
991 unsigned long messages; /* number of messages */
|
yuuji@0
|
992 unsigned long recent; /* number of recent messages */
|
yuuji@0
|
993 unsigned long unseen; /* number of unseen messages */
|
yuuji@0
|
994 unsigned long uidnext; /* next UID to be assigned */
|
yuuji@0
|
995 unsigned long uidvalidity; /* UID validity value */
|
yuuji@0
|
996 } MAILSTATUS;
|
yuuji@0
|
997
|
yuuji@0
|
998 /* Sort program */
|
yuuji@0
|
999
|
yuuji@0
|
1000 typedef void (*postsort_t) (void *sc);
|
yuuji@0
|
1001
|
yuuji@0
|
1002 #define SORTPGM struct sort_program
|
yuuji@0
|
1003
|
yuuji@0
|
1004 SORTPGM {
|
yuuji@0
|
1005 unsigned int reverse : 1; /* sort function is to be reversed */
|
yuuji@0
|
1006 unsigned int abort : 1; /* abort sorting */
|
yuuji@0
|
1007 short function; /* sort function */
|
yuuji@0
|
1008 unsigned long nmsgs; /* number of messages being sorted */
|
yuuji@0
|
1009 struct {
|
yuuji@0
|
1010 unsigned long cached; /* number of messages cached so far */
|
yuuji@0
|
1011 unsigned long sorted; /* number of messages sorted so far */
|
yuuji@0
|
1012 unsigned long postsorted; /* number of postsorted messages so far */
|
yuuji@0
|
1013 } progress;
|
yuuji@0
|
1014 postsort_t postsort; /* post sorter */
|
yuuji@0
|
1015 SORTPGM *next; /* next function */
|
yuuji@0
|
1016 };
|
yuuji@0
|
1017
|
yuuji@0
|
1018
|
yuuji@0
|
1019 /* Sort cache */
|
yuuji@0
|
1020
|
yuuji@0
|
1021 #define SORTCACHE struct sort_cache
|
yuuji@0
|
1022
|
yuuji@0
|
1023 SORTCACHE {
|
yuuji@0
|
1024 unsigned int sorted : 1; /* message has been sorted */
|
yuuji@0
|
1025 unsigned int postsorted : 1; /* message has been postsorted */
|
yuuji@0
|
1026 unsigned int refwd : 1; /* subject is a re or fwd */
|
yuuji@0
|
1027 unsigned int dirty : 1; /* has data not written to backup */
|
yuuji@0
|
1028 SORTPGM *pgm; /* sort program */
|
yuuji@0
|
1029 unsigned long num; /* message number (sequence or UID) */
|
yuuji@0
|
1030 unsigned long date; /* sent date */
|
yuuji@0
|
1031 unsigned long arrival; /* arrival date */
|
yuuji@0
|
1032 unsigned long size; /* message size */
|
yuuji@0
|
1033 char *from; /* from string */
|
yuuji@0
|
1034 char *to; /* to string */
|
yuuji@0
|
1035 char *cc; /* cc string */
|
yuuji@0
|
1036 char *subject; /* extracted subject string */
|
yuuji@0
|
1037 char *message_id; /* message-id string */
|
yuuji@0
|
1038 char *unique; /* unique string, normally message-id */
|
yuuji@0
|
1039 STRINGLIST *references; /* references string */
|
yuuji@0
|
1040 };
|
yuuji@0
|
1041
|
yuuji@0
|
1042 /* ACL list */
|
yuuji@0
|
1043
|
yuuji@0
|
1044 #define ACLLIST struct acl_list
|
yuuji@0
|
1045
|
yuuji@0
|
1046 ACLLIST {
|
yuuji@0
|
1047 char *identifier; /* authentication identifier */
|
yuuji@0
|
1048 char *rights; /* access rights */
|
yuuji@0
|
1049 ACLLIST *next;
|
yuuji@0
|
1050 };
|
yuuji@0
|
1051
|
yuuji@0
|
1052 /* Quota resource list */
|
yuuji@0
|
1053
|
yuuji@0
|
1054 #define QUOTALIST struct quota_list
|
yuuji@0
|
1055
|
yuuji@0
|
1056 QUOTALIST {
|
yuuji@0
|
1057 char *name; /* resource name */
|
yuuji@0
|
1058 unsigned long usage; /* resource usage */
|
yuuji@0
|
1059 unsigned long limit; /* resource limit */
|
yuuji@0
|
1060 QUOTALIST *next; /* next resource */
|
yuuji@0
|
1061 };
|
yuuji@0
|
1062
|
yuuji@0
|
1063 /* Mail Access I/O stream */
|
yuuji@0
|
1064
|
yuuji@0
|
1065
|
yuuji@0
|
1066 /* Structure for mail driver dispatch */
|
yuuji@0
|
1067
|
yuuji@0
|
1068 #define DRIVER struct driver
|
yuuji@0
|
1069
|
yuuji@0
|
1070
|
yuuji@0
|
1071 /* Mail I/O stream */
|
yuuji@0
|
1072
|
yuuji@0
|
1073 typedef struct mail_stream {
|
yuuji@0
|
1074 DRIVER *dtb; /* dispatch table for this driver */
|
yuuji@0
|
1075 void *local; /* pointer to driver local data */
|
yuuji@0
|
1076 char *mailbox; /* mailbox name (canonicalized) */
|
yuuji@0
|
1077 char *original_mailbox; /* mailbox name (non-canonicalized) */
|
yuuji@0
|
1078 unsigned short use; /* stream use count */
|
yuuji@0
|
1079 unsigned short sequence; /* stream sequence */
|
yuuji@0
|
1080 unsigned int inbox : 1; /* stream open on an INBOX */
|
yuuji@0
|
1081 unsigned int lock : 1; /* stream lock flag */
|
yuuji@0
|
1082 unsigned int debug : 1; /* stream debug flag */
|
yuuji@0
|
1083 unsigned int silent : 1; /* don't pass events to main program */
|
yuuji@0
|
1084 unsigned int rdonly : 1; /* stream read-only flag */
|
yuuji@0
|
1085 unsigned int anonymous : 1; /* stream anonymous access flag */
|
yuuji@0
|
1086 unsigned int scache : 1; /* stream short cache flag */
|
yuuji@0
|
1087 unsigned int halfopen : 1; /* stream half-open flag */
|
yuuji@0
|
1088 unsigned int secure : 1; /* stream secure flag */
|
yuuji@0
|
1089 unsigned int tryssl : 1; /* stream tryssl flag */
|
yuuji@0
|
1090 unsigned int mulnewsrc : 1; /* stream use multiple newsrc files */
|
yuuji@0
|
1091 unsigned int perm_seen : 1; /* permanent Seen flag */
|
yuuji@0
|
1092 unsigned int perm_deleted : 1;/* permanent Deleted flag */
|
yuuji@0
|
1093 unsigned int perm_flagged : 1;/* permanent Flagged flag */
|
yuuji@0
|
1094 unsigned int perm_answered :1;/* permanent Answered flag */
|
yuuji@0
|
1095 unsigned int perm_draft : 1; /* permanent Draft flag */
|
yuuji@0
|
1096 unsigned int kwd_create : 1; /* can create new keywords */
|
yuuji@0
|
1097 unsigned int uid_nosticky : 1;/* UIDs are not preserved */
|
yuuji@0
|
1098 unsigned int unhealthy : 1; /* unhealthy protocol negotiations */
|
yuuji@0
|
1099 unsigned int nokod : 1; /* suppress kiss-of-death */
|
yuuji@0
|
1100 unsigned int sniff : 1; /* metadata only */
|
yuuji@0
|
1101 unsigned long perm_user_flags;/* mask of permanent user flags */
|
yuuji@0
|
1102 unsigned long gensym; /* generated tag */
|
yuuji@0
|
1103 unsigned long nmsgs; /* # of associated msgs */
|
yuuji@0
|
1104 unsigned long recent; /* # of recent msgs */
|
yuuji@0
|
1105 unsigned long uid_validity; /* UID validity sequence */
|
yuuji@0
|
1106 unsigned long uid_last; /* last assigned UID */
|
yuuji@0
|
1107 char *user_flags[NUSERFLAGS]; /* pointers to user flags in bit order */
|
yuuji@0
|
1108 unsigned long cachesize; /* size of message cache */
|
yuuji@0
|
1109 MESSAGECACHE **cache; /* message cache array */
|
yuuji@0
|
1110 SORTCACHE **sc; /* sort cache array */
|
yuuji@0
|
1111 unsigned long msgno; /* message number of `current' message */
|
yuuji@0
|
1112 ENVELOPE *env; /* scratch buffer for envelope */
|
yuuji@0
|
1113 BODY *body; /* scratch buffer for body */
|
yuuji@0
|
1114 SIZEDTEXT text; /* scratch buffer for text */
|
yuuji@0
|
1115 struct {
|
yuuji@0
|
1116 char *name; /* mailbox name to snarf from */
|
yuuji@0
|
1117 unsigned long time; /* last snarf time */
|
yuuji@0
|
1118 long options; /* snarf open options */
|
yuuji@0
|
1119 } snarf;
|
yuuji@0
|
1120 struct { /* internal use only */
|
yuuji@0
|
1121 struct { /* search temporaries */
|
yuuji@0
|
1122 STRINGLIST *string; /* string(s) to search */
|
yuuji@0
|
1123 long result; /* search result */
|
yuuji@0
|
1124 char *text; /* cache of fetched text */
|
yuuji@0
|
1125 } search;
|
yuuji@0
|
1126 STRING string; /* stringstruct return hack */
|
yuuji@0
|
1127 } private;
|
yuuji@0
|
1128 /* reserved for use by main program */
|
yuuji@0
|
1129 void *sparep; /* spare pointer */
|
yuuji@0
|
1130 unsigned int spare : 1; /* first spare bit */
|
yuuji@0
|
1131 unsigned int spare2 : 1; /* second spare bit */
|
yuuji@0
|
1132 unsigned int spare3 : 1; /* third spare bit */
|
yuuji@0
|
1133 unsigned int spare4 : 1; /* fourth spare bit */
|
yuuji@0
|
1134 unsigned int spare5 : 1; /* fifth spare bit */
|
yuuji@0
|
1135 unsigned int spare6 : 1; /* sixth spare bit */
|
yuuji@0
|
1136 unsigned int spare7 : 1; /* seventh spare bit */
|
yuuji@0
|
1137 unsigned int spare8 : 1; /* eighth spare bit */
|
yuuji@0
|
1138 } MAILSTREAM;
|
yuuji@0
|
1139
|
yuuji@0
|
1140 /* Mail I/O stream handle */
|
yuuji@0
|
1141
|
yuuji@0
|
1142 typedef struct mail_stream_handle {
|
yuuji@0
|
1143 MAILSTREAM *stream; /* pointer to mail stream */
|
yuuji@0
|
1144 unsigned short sequence; /* sequence of what we expect stream to be */
|
yuuji@0
|
1145 } MAILHANDLE;
|
yuuji@0
|
1146
|
yuuji@0
|
1147
|
yuuji@0
|
1148 /* Message overview */
|
yuuji@0
|
1149
|
yuuji@0
|
1150 typedef struct mail_overview {
|
yuuji@0
|
1151 char *subject; /* message subject string */
|
yuuji@0
|
1152 ADDRESS *from; /* originator address list */
|
yuuji@0
|
1153 char *date; /* message composition date string */
|
yuuji@0
|
1154 char *message_id; /* message ID */
|
yuuji@0
|
1155 char *references; /* USENET references */
|
yuuji@0
|
1156 struct { /* may be 0 or NUL if unknown/undefined */
|
yuuji@0
|
1157 unsigned long octets; /* message octets (probably LF-newline form) */
|
yuuji@0
|
1158 unsigned long lines; /* message lines */
|
yuuji@0
|
1159 char *xref; /* cross references */
|
yuuji@0
|
1160 } optional;
|
yuuji@0
|
1161 } OVERVIEW;
|
yuuji@0
|
1162
|
yuuji@0
|
1163 /* Network access I/O stream */
|
yuuji@0
|
1164
|
yuuji@0
|
1165
|
yuuji@0
|
1166 /* Structure for network driver dispatch */
|
yuuji@0
|
1167
|
yuuji@0
|
1168 #define NETDRIVER struct net_driver
|
yuuji@0
|
1169
|
yuuji@0
|
1170
|
yuuji@0
|
1171 /* Network transport I/O stream */
|
yuuji@0
|
1172
|
yuuji@0
|
1173 typedef struct net_stream {
|
yuuji@0
|
1174 void *stream; /* driver's I/O stream */
|
yuuji@0
|
1175 NETDRIVER *dtb; /* network driver */
|
yuuji@0
|
1176 } NETSTREAM;
|
yuuji@0
|
1177
|
yuuji@0
|
1178
|
yuuji@0
|
1179 /* Network transport driver dispatch */
|
yuuji@0
|
1180
|
yuuji@0
|
1181 NETDRIVER {
|
yuuji@0
|
1182 void *(*open) (char *host,char *service,unsigned long port);
|
yuuji@0
|
1183 void *(*aopen) (NETMBX *mb,char *service,char *usrbuf);
|
yuuji@0
|
1184 char *(*getline) (void *stream);
|
yuuji@0
|
1185 long (*getbuffer) (void *stream,unsigned long size,char *buffer);
|
yuuji@0
|
1186 long (*soutr) (void *stream,char *string);
|
yuuji@0
|
1187 long (*sout) (void *stream,char *string,unsigned long size);
|
yuuji@0
|
1188 void (*close) (void *stream);
|
yuuji@0
|
1189 char *(*host) (void *stream);
|
yuuji@0
|
1190 char *(*remotehost) (void *stream);
|
yuuji@0
|
1191 unsigned long (*port) (void *stream);
|
yuuji@0
|
1192 char *(*localhost) (void *stream);
|
yuuji@0
|
1193 };
|
yuuji@0
|
1194
|
yuuji@0
|
1195
|
yuuji@0
|
1196 /* Mailgets data identifier */
|
yuuji@0
|
1197
|
yuuji@0
|
1198 typedef struct getsdata {
|
yuuji@0
|
1199 MAILSTREAM *stream;
|
yuuji@0
|
1200 unsigned long msgno;
|
yuuji@0
|
1201 char *what;
|
yuuji@0
|
1202 STRINGLIST *stl;
|
yuuji@0
|
1203 unsigned long first;
|
yuuji@0
|
1204 unsigned long last;
|
yuuji@0
|
1205 long flags;
|
yuuji@0
|
1206 } GETS_DATA;
|
yuuji@0
|
1207
|
yuuji@0
|
1208
|
yuuji@0
|
1209 #define INIT_GETS(md,s,m,w,f,l) \
|
yuuji@0
|
1210 md.stream = s, md.msgno = m, md.what = w, md.first = f, md.last = l, \
|
yuuji@0
|
1211 md.stl = NIL, md.flags = NIL;
|
yuuji@0
|
1212
|
yuuji@0
|
1213 /* Mail delivery I/O stream */
|
yuuji@0
|
1214
|
yuuji@0
|
1215 typedef struct send_stream {
|
yuuji@0
|
1216 NETSTREAM *netstream; /* network I/O stream */
|
yuuji@0
|
1217 char *host; /* SMTP service host */
|
yuuji@0
|
1218 char *reply; /* last reply string */
|
yuuji@0
|
1219 long replycode; /* last reply code */
|
yuuji@0
|
1220 unsigned int debug : 1; /* stream debug flag */
|
yuuji@0
|
1221 unsigned int sensitive : 1; /* sensitive data in progress */
|
yuuji@0
|
1222 unsigned int loser : 1; /* server is a loser */
|
yuuji@0
|
1223 unsigned int saslcancel : 1; /* SASL cancelled by protocol */
|
yuuji@0
|
1224 union { /* protocol specific */
|
yuuji@0
|
1225 struct { /* SMTP specific */
|
yuuji@0
|
1226 unsigned int ok : 1; /* supports ESMTP */
|
yuuji@0
|
1227 struct { /* service extensions */
|
yuuji@0
|
1228 unsigned int send : 1; /* supports SEND */
|
yuuji@0
|
1229 unsigned int soml : 1; /* supports SOML */
|
yuuji@0
|
1230 unsigned int saml : 1; /* supports SAML */
|
yuuji@0
|
1231 unsigned int expn : 1; /* supports EXPN */
|
yuuji@0
|
1232 unsigned int help : 1; /* supports HELP */
|
yuuji@0
|
1233 unsigned int turn : 1; /* supports TURN */
|
yuuji@0
|
1234 unsigned int etrn : 1; /* supports ETRN */
|
yuuji@0
|
1235 unsigned int starttls:1;/* supports STARTTLS */
|
yuuji@0
|
1236 unsigned int relay : 1; /* supports relaying */
|
yuuji@0
|
1237 unsigned int pipe : 1; /* supports pipelining */
|
yuuji@0
|
1238 unsigned int ensc : 1; /* supports enhanced status codes */
|
yuuji@0
|
1239 unsigned int bmime : 1; /* supports BINARYMIME */
|
yuuji@0
|
1240 unsigned int chunk : 1; /* supports CHUNKING */
|
yuuji@0
|
1241 } service;
|
yuuji@0
|
1242 struct { /* 8-bit MIME transport */
|
yuuji@0
|
1243 unsigned int ok : 1; /* supports 8-bit MIME */
|
yuuji@0
|
1244 unsigned int want : 1; /* want 8-bit MIME */
|
yuuji@0
|
1245 } eightbit;
|
yuuji@0
|
1246 struct { /* delivery status notification */
|
yuuji@0
|
1247 unsigned int ok : 1; /* supports DSN */
|
yuuji@0
|
1248 unsigned int want : 1; /* want DSN */
|
yuuji@0
|
1249 struct { /* notification options */
|
yuuji@0
|
1250 /* notify on failure */
|
yuuji@0
|
1251 unsigned int failure : 1;
|
yuuji@0
|
1252 /* notify on delay */
|
yuuji@0
|
1253 unsigned int delay : 1;
|
yuuji@0
|
1254 /* notify on success */
|
yuuji@0
|
1255 unsigned int success : 1;
|
yuuji@0
|
1256 } notify;
|
yuuji@0
|
1257 unsigned int full : 1; /* return full headers */
|
yuuji@0
|
1258 char *envid; /* envelope identifier as xtext */
|
yuuji@0
|
1259 } dsn;
|
yuuji@0
|
1260 struct { /* size declaration */
|
yuuji@0
|
1261 unsigned int ok : 1; /* supports SIZE */
|
yuuji@0
|
1262 unsigned long limit; /* maximum size supported */
|
yuuji@0
|
1263 } size;
|
yuuji@0
|
1264 struct { /* deliverby declaration */
|
yuuji@0
|
1265 unsigned int ok : 1; /* supports DELIVERBY */
|
yuuji@0
|
1266 unsigned long minby; /* minimum by-time */
|
yuuji@0
|
1267 } deliverby;
|
yuuji@0
|
1268 struct { /* authenticated turn */
|
yuuji@0
|
1269 unsigned int ok : 1; /* supports ATRN */
|
yuuji@0
|
1270 char *domains; /* domains */
|
yuuji@0
|
1271 } atrn;
|
yuuji@0
|
1272 /* supported SASL authenticators */
|
yuuji@0
|
1273 unsigned int auth : MAXAUTHENTICATORS;
|
yuuji@0
|
1274 } esmtp;
|
yuuji@0
|
1275 struct { /* NNTP specific */
|
yuuji@0
|
1276 unsigned int post : 1; /* supports POST */
|
yuuji@0
|
1277 struct { /* NNTP extensions */
|
yuuji@0
|
1278 unsigned int ok : 1; /* supports extensions */
|
yuuji@0
|
1279 /* supports LISTGROUP */
|
yuuji@0
|
1280 unsigned int listgroup : 1;
|
yuuji@0
|
1281 unsigned int over : 1; /* supports OVER */
|
yuuji@0
|
1282 unsigned int hdr : 1; /* supports HDR */
|
yuuji@0
|
1283 unsigned int pat : 1; /* supports PAT */
|
yuuji@0
|
1284 /* supports STARTTLS */
|
yuuji@0
|
1285 unsigned int starttls : 1;
|
yuuji@0
|
1286 /* server has MULTIDOMAIN */
|
yuuji@0
|
1287 unsigned int multidomain : 1;
|
yuuji@0
|
1288 /* supports AUTHINFO USER */
|
yuuji@0
|
1289 unsigned int authuser : 1;
|
yuuji@0
|
1290 /* supported authenticators */
|
yuuji@0
|
1291 unsigned int sasl : MAXAUTHENTICATORS;
|
yuuji@0
|
1292 } ext;
|
yuuji@0
|
1293 } nntp;
|
yuuji@0
|
1294 } protocol;
|
yuuji@0
|
1295 } SENDSTREAM;
|
yuuji@0
|
1296
|
yuuji@0
|
1297 /* Jacket into external interfaces */
|
yuuji@0
|
1298
|
yuuji@0
|
1299 typedef long (*readfn_t) (void *stream,unsigned long size,char *buffer);
|
yuuji@0
|
1300 typedef char *(*mailgets_t) (readfn_t f,void *stream,unsigned long size,
|
yuuji@0
|
1301 GETS_DATA *md);
|
yuuji@0
|
1302 typedef char *(*readprogress_t) (GETS_DATA *md,unsigned long octets);
|
yuuji@0
|
1303 typedef void *(*mailcache_t) (MAILSTREAM *stream,unsigned long msgno,long op);
|
yuuji@0
|
1304 typedef long (*mailproxycopy_t) (MAILSTREAM *stream,char *sequence,
|
yuuji@0
|
1305 char *mailbox,long options);
|
yuuji@0
|
1306 typedef long (*tcptimeout_t) (long overall,long last);
|
yuuji@0
|
1307 typedef void *(*authchallenge_t) (void *stream,unsigned long *len);
|
yuuji@0
|
1308 typedef long (*authrespond_t) (void *stream,char *s,unsigned long size);
|
yuuji@0
|
1309 typedef long (*authcheck_t) (void);
|
yuuji@0
|
1310 typedef long (*authclient_t) (authchallenge_t challenger,
|
yuuji@0
|
1311 authrespond_t responder,char *service,NETMBX *mb,
|
yuuji@0
|
1312 void *s,unsigned long *trial,char *user);
|
yuuji@0
|
1313 typedef char *(*authresponse_t) (void *challenge,unsigned long clen,
|
yuuji@0
|
1314 unsigned long *rlen);
|
yuuji@0
|
1315 typedef char *(*authserver_t) (authresponse_t responder,int argc,char *argv[]);
|
yuuji@0
|
1316 typedef void (*smtpverbose_t) (char *buffer);
|
yuuji@0
|
1317 typedef void (*imapenvelope_t) (MAILSTREAM *stream,unsigned long msgno,
|
yuuji@0
|
1318 ENVELOPE *env);
|
yuuji@0
|
1319 typedef char *(*imapreferral_t) (MAILSTREAM *stream,char *url,long code);
|
yuuji@0
|
1320 typedef void (*overview_t) (MAILSTREAM *stream,unsigned long uid,OVERVIEW *ov,
|
yuuji@0
|
1321 unsigned long msgno);
|
yuuji@0
|
1322 typedef unsigned long *(*sorter_t) (MAILSTREAM *stream,char *charset,
|
yuuji@0
|
1323 SEARCHPGM *spg,SORTPGM *pgm,long flags);
|
yuuji@0
|
1324 typedef void (*parseline_t) (ENVELOPE *env,char *hdr,char *data,char *host);
|
yuuji@0
|
1325 typedef ADDRESS *(*parsephrase_t) (char *phrase,char *end,char *host);
|
yuuji@0
|
1326 typedef void *(*blocknotify_t) (int reason,void *data);
|
yuuji@0
|
1327 typedef long (*kinit_t) (char *host,char *reason);
|
yuuji@0
|
1328 typedef void (*sendcommand_t) (MAILSTREAM *stream,char *cmd,long flags);
|
yuuji@0
|
1329 typedef char *(*newsrcquery_t) (MAILSTREAM *stream,char *mulname,char *name);
|
yuuji@0
|
1330 typedef void (*getacl_t) (MAILSTREAM *stream,char *mailbox,ACLLIST *acl);
|
yuuji@0
|
1331 typedef void (*listrights_t) (MAILSTREAM *stream,char *mailbox,char *id,
|
yuuji@0
|
1332 char *alwaysrights,STRINGLIST *possiblerights);
|
yuuji@0
|
1333 typedef void (*myrights_t) (MAILSTREAM *stream,char *mailbox,char *rights);
|
yuuji@0
|
1334 typedef void (*quota_t) (MAILSTREAM *stream,char *qroot,QUOTALIST *qlist);
|
yuuji@0
|
1335 typedef void (*quotaroot_t) (MAILSTREAM *stream,char *mbx,STRINGLIST *qroot);
|
yuuji@0
|
1336 typedef void (*sortresults_t) (MAILSTREAM *stream,unsigned long *list,
|
yuuji@0
|
1337 unsigned long size);
|
yuuji@0
|
1338 typedef char *(*userprompt_t) (void);
|
yuuji@0
|
1339 typedef long (*append_t) (MAILSTREAM *stream,void *data,char **flags,
|
yuuji@0
|
1340 char **date,STRING **message);
|
yuuji@0
|
1341 typedef void (*copyuid_t) (MAILSTREAM *stream,char *mailbox,
|
yuuji@0
|
1342 unsigned long uidvalidity,SEARCHSET *sourceset,
|
yuuji@0
|
1343 SEARCHSET *destset);
|
yuuji@0
|
1344 typedef void (*appenduid_t) (char *mailbox,unsigned long uidvalidity,
|
yuuji@0
|
1345 SEARCHSET *set);
|
yuuji@0
|
1346 typedef long (*dirfmttest_t) (char *name);
|
yuuji@0
|
1347 typedef long (*scancontents_t) (char *name,char *contents,unsigned long csiz,
|
yuuji@0
|
1348 unsigned long fsiz);
|
yuuji@0
|
1349
|
yuuji@0
|
1350 typedef void (*freeeltsparep_t) (void **sparep);
|
yuuji@0
|
1351 typedef void (*freeenvelopesparep_t) (void **sparep);
|
yuuji@0
|
1352 typedef void (*freebodysparep_t) (void **sparep);
|
yuuji@0
|
1353 typedef void (*freestreamsparep_t) (void **sparep);
|
yuuji@0
|
1354 typedef void *(*sslstart_t) (void *stream,char *host,unsigned long flags);
|
yuuji@0
|
1355 typedef long (*sslcertificatequery_t) (char *reason,char *host,char *cert);
|
yuuji@0
|
1356 typedef void (*sslfailure_t) (char *host,char *reason,unsigned long flags);
|
yuuji@0
|
1357 typedef void (*logouthook_t) (void *data);
|
yuuji@0
|
1358 typedef char *(*sslclientcert_t) (void);
|
yuuji@0
|
1359 typedef char *(*sslclientkey_t) (void);
|
yuuji@0
|
1360
|
yuuji@0
|
1361 /* Globals */
|
yuuji@0
|
1362
|
yuuji@0
|
1363 extern char *body_types[]; /* defined body type strings */
|
yuuji@0
|
1364 extern char *body_encodings[]; /* defined body encoding strings */
|
yuuji@0
|
1365 extern const char *days[]; /* day name strings */
|
yuuji@0
|
1366 extern const char *months[]; /* month name strings */
|
yuuji@0
|
1367
|
yuuji@0
|
1368 /* Threading */
|
yuuji@0
|
1369
|
yuuji@0
|
1370 /* Thread node */
|
yuuji@0
|
1371
|
yuuji@0
|
1372 #define THREADNODE struct thread_node
|
yuuji@0
|
1373
|
yuuji@0
|
1374 THREADNODE {
|
yuuji@0
|
1375 unsigned long num; /* message number */
|
yuuji@0
|
1376 SORTCACHE *sc; /* (internal use) sortcache entry */
|
yuuji@0
|
1377 THREADNODE *branch; /* branch at this point in tree */
|
yuuji@0
|
1378 THREADNODE *next; /* next node */
|
yuuji@0
|
1379 };
|
yuuji@0
|
1380
|
yuuji@0
|
1381 typedef void (*threadresults_t) (MAILSTREAM *stream,THREADNODE *tree);
|
yuuji@0
|
1382
|
yuuji@0
|
1383
|
yuuji@0
|
1384 /* Thread dispatch */
|
yuuji@0
|
1385
|
yuuji@0
|
1386 #define THREADER struct threader_list
|
yuuji@0
|
1387
|
yuuji@0
|
1388 THREADER {
|
yuuji@0
|
1389 char *name; /* name of threader */
|
yuuji@0
|
1390 THREADNODE *(*dispatch) (MAILSTREAM *stream,char *charset,SEARCHPGM *spg,
|
yuuji@0
|
1391 long flags,sorter_t sorter);
|
yuuji@0
|
1392 THREADER *next;
|
yuuji@0
|
1393 };
|
yuuji@0
|
1394
|
yuuji@0
|
1395
|
yuuji@0
|
1396 /* Container for references threading */
|
yuuji@0
|
1397
|
yuuji@0
|
1398 typedef void ** container_t;
|
yuuji@0
|
1399
|
yuuji@0
|
1400 /* Namespaces */
|
yuuji@0
|
1401
|
yuuji@0
|
1402 #define NAMESPACE struct mail_namespace
|
yuuji@0
|
1403
|
yuuji@0
|
1404 NAMESPACE {
|
yuuji@0
|
1405 char *name; /* name of this namespace */
|
yuuji@0
|
1406 int delimiter; /* hierarchy delimiter */
|
yuuji@0
|
1407 PARAMETER *param; /* namespace parameters */
|
yuuji@0
|
1408 NAMESPACE *next; /* next namespace */
|
yuuji@0
|
1409 };
|
yuuji@0
|
1410
|
yuuji@0
|
1411
|
yuuji@0
|
1412 /* Authentication */
|
yuuji@0
|
1413
|
yuuji@0
|
1414 #define AUTHENTICATOR struct mail_authenticator
|
yuuji@0
|
1415
|
yuuji@0
|
1416 AUTHENTICATOR {
|
yuuji@0
|
1417 long flags; /* authenticator flags */
|
yuuji@0
|
1418 char *name; /* name of this authenticator */
|
yuuji@0
|
1419 authcheck_t valid; /* authenticator valid on this system */
|
yuuji@0
|
1420 authclient_t client; /* client function that supports it */
|
yuuji@0
|
1421 authserver_t server; /* server function that supports it */
|
yuuji@0
|
1422 AUTHENTICATOR *next; /* next authenticator */
|
yuuji@0
|
1423 };
|
yuuji@0
|
1424
|
yuuji@0
|
1425 /* Mail driver dispatch */
|
yuuji@0
|
1426
|
yuuji@0
|
1427 DRIVER {
|
yuuji@0
|
1428 char *name; /* driver name */
|
yuuji@0
|
1429 unsigned long flags; /* driver flags */
|
yuuji@0
|
1430 DRIVER *next; /* next driver */
|
yuuji@0
|
1431 /* mailbox is valid for us */
|
yuuji@0
|
1432 DRIVER *(*valid) (char *mailbox);
|
yuuji@0
|
1433 /* manipulate driver parameters */
|
yuuji@0
|
1434 void *(*parameters) (long function,void *value);
|
yuuji@0
|
1435 /* scan mailboxes */
|
yuuji@0
|
1436 void (*scan) (MAILSTREAM *stream,char *ref,char *pat,char *contents);
|
yuuji@0
|
1437 /* list mailboxes */
|
yuuji@0
|
1438 void (*list) (MAILSTREAM *stream,char *ref,char *pat);
|
yuuji@0
|
1439 /* list subscribed mailboxes */
|
yuuji@0
|
1440 void (*lsub) (MAILSTREAM *stream,char *ref,char *pat);
|
yuuji@0
|
1441 /* subscribe to mailbox */
|
yuuji@0
|
1442 long (*subscribe) (MAILSTREAM *stream,char *mailbox);
|
yuuji@0
|
1443 /* unsubscribe from mailbox */
|
yuuji@0
|
1444 long (*unsubscribe) (MAILSTREAM *stream,char *mailbox);
|
yuuji@0
|
1445 /* create mailbox */
|
yuuji@0
|
1446 long (*create) (MAILSTREAM *stream,char *mailbox);
|
yuuji@0
|
1447 /* delete mailbox */
|
yuuji@0
|
1448 long (*mbxdel) (MAILSTREAM *stream,char *mailbox);
|
yuuji@0
|
1449 /* rename mailbox */
|
yuuji@0
|
1450 long (*mbxren) (MAILSTREAM *stream,char *old,char *newname);
|
yuuji@0
|
1451 /* status of mailbox */
|
yuuji@0
|
1452 long (*status) (MAILSTREAM *stream,char *mbx,long flags);
|
yuuji@0
|
1453
|
yuuji@0
|
1454 /* open mailbox */
|
yuuji@0
|
1455 MAILSTREAM *(*open) (MAILSTREAM *stream);
|
yuuji@0
|
1456 /* close mailbox */
|
yuuji@0
|
1457 void (*close) (MAILSTREAM *stream,long options);
|
yuuji@0
|
1458 /* fetch message "fast" attributes */
|
yuuji@0
|
1459 void (*fast) (MAILSTREAM *stream,char *sequence,long flags);
|
yuuji@0
|
1460 /* fetch message flags */
|
yuuji@0
|
1461 void (*msgflags) (MAILSTREAM *stream,char *sequence,long flags);
|
yuuji@0
|
1462 /* fetch message overview */
|
yuuji@0
|
1463 long (*overview) (MAILSTREAM *stream,overview_t ofn);
|
yuuji@0
|
1464 /* fetch message envelopes */
|
yuuji@0
|
1465 ENVELOPE *(*structure) (MAILSTREAM *stream,unsigned long msgno,BODY **body,
|
yuuji@0
|
1466 long flags);
|
yuuji@0
|
1467 /* return RFC-822 header */
|
yuuji@0
|
1468 char *(*header) (MAILSTREAM *stream,unsigned long msgno,
|
yuuji@0
|
1469 unsigned long *length,long flags);
|
yuuji@0
|
1470 /* return RFC-822 text */
|
yuuji@0
|
1471 long (*text) (MAILSTREAM *stream,unsigned long msgno,STRING *bs,long flags);
|
yuuji@0
|
1472 /* load cache */
|
yuuji@0
|
1473 long (*msgdata) (MAILSTREAM *stream,unsigned long msgno,char *section,
|
yuuji@0
|
1474 unsigned long first,unsigned long last,STRINGLIST *lines,
|
yuuji@0
|
1475 long flags);
|
yuuji@0
|
1476 /* return UID for message */
|
yuuji@0
|
1477 unsigned long (*uid) (MAILSTREAM *stream,unsigned long msgno);
|
yuuji@0
|
1478 /* return message number from UID */
|
yuuji@0
|
1479 unsigned long (*msgno) (MAILSTREAM *stream,unsigned long uid);
|
yuuji@0
|
1480 /* modify flags */
|
yuuji@0
|
1481 void (*flag) (MAILSTREAM *stream,char *sequence,char *flag,long flags);
|
yuuji@0
|
1482 /* per-message modify flags */
|
yuuji@0
|
1483 void (*flagmsg) (MAILSTREAM *stream,MESSAGECACHE *elt);
|
yuuji@0
|
1484 /* search for message based on criteria */
|
yuuji@0
|
1485 long (*search) (MAILSTREAM *stream,char *charset,SEARCHPGM *pgm,long flags);
|
yuuji@0
|
1486 /* sort messages */
|
yuuji@0
|
1487 unsigned long *(*sort) (MAILSTREAM *stream,char *charset,SEARCHPGM *spg,
|
yuuji@0
|
1488 SORTPGM *pgm,long flags);
|
yuuji@0
|
1489 /* thread messages */
|
yuuji@0
|
1490 THREADNODE *(*thread) (MAILSTREAM *stream,char *type,char *charset,
|
yuuji@0
|
1491 SEARCHPGM *spg,long flag);
|
yuuji@0
|
1492 /* ping mailbox to see if still alive */
|
yuuji@0
|
1493 long (*ping) (MAILSTREAM *stream);
|
yuuji@0
|
1494 /* check for new messages */
|
yuuji@0
|
1495 void (*check) (MAILSTREAM *stream);
|
yuuji@0
|
1496 /* expunge deleted messages */
|
yuuji@0
|
1497 long (*expunge) (MAILSTREAM *stream,char *sequence,long options);
|
yuuji@0
|
1498 /* copy messages to another mailbox */
|
yuuji@0
|
1499 long (*copy) (MAILSTREAM *stream,char *sequence,char *mailbox,long options);
|
yuuji@0
|
1500 /* append string message to mailbox */
|
yuuji@0
|
1501 long (*append) (MAILSTREAM *stream,char *mailbox,append_t af,void *data);
|
yuuji@0
|
1502 /* garbage collect stream */
|
yuuji@0
|
1503 void (*gc) (MAILSTREAM *stream,long gcflags);
|
yuuji@0
|
1504 };
|
yuuji@0
|
1505
|
yuuji@0
|
1506
|
yuuji@0
|
1507 #include "linkage.h"
|
yuuji@0
|
1508
|
yuuji@0
|
1509 /* Compatibility support names for old interfaces */
|
yuuji@0
|
1510
|
yuuji@0
|
1511 #define GET_TRYALTFIRST GET_TRYSSLFIRST
|
yuuji@0
|
1512 #define SET_TRYALTFIRST SET_TRYSSLFIRST
|
yuuji@0
|
1513 #define GET_IMAPTRYALT GET_IMAPTRYSSL
|
yuuji@0
|
1514 #define SET_IMAPTRYALT SET_IMAPTRYSSL
|
yuuji@0
|
1515 #define OP_TRYALT OP_TRYSSL
|
yuuji@0
|
1516 #define altflag sslflag
|
yuuji@0
|
1517
|
yuuji@0
|
1518 #define mail_close(stream) \
|
yuuji@0
|
1519 mail_close_full (stream,NIL)
|
yuuji@0
|
1520 #define mail_fetchfast(stream,sequence) \
|
yuuji@0
|
1521 mail_fetch_fast (stream,sequence,NIL)
|
yuuji@0
|
1522 #define mail_fetchfast_full mail_fetch_fast
|
yuuji@0
|
1523 #define mail_fetchflags(stream,sequence) \
|
yuuji@0
|
1524 mail_fetch_flags (stream,sequence,NIL)
|
yuuji@0
|
1525 #define mail_fetchflags_full mail_fetch_flags
|
yuuji@0
|
1526 #define mail_fetchenvelope(stream,msgno) \
|
yuuji@0
|
1527 mail_fetch_structure (stream,msgno,NIL,NIL)
|
yuuji@0
|
1528 #define mail_fetchstructure(stream,msgno,body) \
|
yuuji@0
|
1529 mail_fetch_structure (stream,msgno,body,NIL)
|
yuuji@0
|
1530 #define mail_fetchstructure_full mail_fetch_structure
|
yuuji@0
|
1531 #define mail_fetchheader(stream,msgno) \
|
yuuji@0
|
1532 mail_fetch_header (stream,msgno,NIL,NIL,NIL,FT_PEEK)
|
yuuji@0
|
1533 #define mail_fetchheader_full(stream,msgno,lines,len,flags) \
|
yuuji@0
|
1534 mail_fetch_header (stream,msgno,NIL,lines,len,FT_PEEK | (flags))
|
yuuji@0
|
1535 #define mail_fetchtext(stream,msgno) \
|
yuuji@0
|
1536 mail_fetch_text (stream,msgno,NIL,NIL,NIL)
|
yuuji@0
|
1537 #define mail_fetchtext_full(stream,msgno,length,flags) \
|
yuuji@0
|
1538 mail_fetch_text (stream,msgno,NIL,length,flags)
|
yuuji@0
|
1539 #define mail_fetchbody(stream,msgno,section,length) \
|
yuuji@0
|
1540 mail_fetch_body (stream,msgno,section,length,NIL)
|
yuuji@0
|
1541 #define mail_fetchbody_full mail_fetch_body
|
yuuji@0
|
1542 #define mail_setflag(stream,sequence,flag) \
|
yuuji@0
|
1543 mail_flag (stream,sequence,flag,ST_SET)
|
yuuji@0
|
1544 #define mail_setflag_full(stream,sequence,flag,flags) \
|
yuuji@0
|
1545 mail_flag (stream,sequence,flag,ST_SET | (flags))
|
yuuji@0
|
1546 #define mail_clearflag(stream,sequence,flag) \
|
yuuji@0
|
1547 mail_flag (stream,sequence,flag,NIL)
|
yuuji@0
|
1548 #define mail_clearflag_full mail_flag
|
yuuji@0
|
1549 #define mail_search(stream,criteria) \
|
yuuji@0
|
1550 mail_search_full (stream,NIL,mail_criteria (criteria),SE_FREE);
|
yuuji@0
|
1551 #define mail_expunge(stream) \
|
yuuji@0
|
1552 mail_expunge_full (stream,NIL,NIL)
|
yuuji@0
|
1553 #define mail_copy(stream,sequence,mailbox) \
|
yuuji@0
|
1554 mail_copy_full (stream,sequence,mailbox,NIL)
|
yuuji@0
|
1555 #define mail_move(stream,sequence,mailbox) \
|
yuuji@0
|
1556 mail_copy_full (stream,sequence,mailbox,CP_MOVE)
|
yuuji@0
|
1557 #define mail_append(stream,mailbox,message) \
|
yuuji@0
|
1558 mail_append_full (stream,mailbox,NIL,NIL,message)
|
yuuji@0
|
1559
|
yuuji@0
|
1560 /* Interfaces for SVR4 locking brain-damage workaround */
|
yuuji@0
|
1561
|
yuuji@0
|
1562 /* Driver dispatching */
|
yuuji@0
|
1563
|
yuuji@0
|
1564 #define SAFE_DELETE(dtb,stream,mailbox) (*dtb->mbxdel) (stream,mailbox)
|
yuuji@0
|
1565 #define SAFE_RENAME(dtb,stream,old,newname) (*dtb->mbxren) (stream,old,newname)
|
yuuji@0
|
1566 #define SAFE_STATUS(dtb,stream,mbx,flags) (*dtb->status) (stream,mbx,flags)
|
yuuji@0
|
1567 #define SAFE_COPY(dtb,stream,sequence,mailbox,options) \
|
yuuji@0
|
1568 (*dtb->copy) (stream,sequence,mailbox,options)
|
yuuji@0
|
1569 #define SAFE_APPEND(dtb,stream,mailbox,af,data) \
|
yuuji@0
|
1570 (*dtb->append) (stream,mailbox,af,data)
|
yuuji@0
|
1571 #define SAFE_SCAN_CONTENTS(dtb,name,contents,csiz,fsiz) \
|
yuuji@0
|
1572 scan_contents (dtb,name,contents,csiz,fsiz)
|
yuuji@0
|
1573
|
yuuji@0
|
1574
|
yuuji@0
|
1575 /* Driver callbacks */
|
yuuji@0
|
1576
|
yuuji@0
|
1577 #define MM_EXISTS mm_exists
|
yuuji@0
|
1578 #define MM_EXPUNGED mm_expunged
|
yuuji@0
|
1579 #define MM_FLAGS mm_flags
|
yuuji@0
|
1580 #define MM_NOTIFY mm_notify
|
yuuji@0
|
1581 #define MM_STATUS mm_status
|
yuuji@0
|
1582 #define MM_LOG mm_log
|
yuuji@0
|
1583 #define MM_CRITICAL mm_critical
|
yuuji@0
|
1584 #define MM_NOCRITICAL mm_nocritical
|
yuuji@0
|
1585 #define MM_DISKERROR mm_diskerror
|
yuuji@0
|
1586 #define MM_FATAL mm_fatal
|
yuuji@0
|
1587 #define MM_APPEND(af) (*af)
|
yuuji@0
|
1588
|
yuuji@0
|
1589 /* Function prototypes */
|
yuuji@0
|
1590
|
yuuji@0
|
1591 void mm_searched (MAILSTREAM *stream,unsigned long number);
|
yuuji@0
|
1592 void mm_exists (MAILSTREAM *stream,unsigned long number);
|
yuuji@0
|
1593 void mm_expunged (MAILSTREAM *stream,unsigned long number);
|
yuuji@0
|
1594 void mm_flags (MAILSTREAM *stream,unsigned long number);
|
yuuji@0
|
1595 void mm_notify (MAILSTREAM *stream,char *string,long errflg);
|
yuuji@0
|
1596 void mm_list (MAILSTREAM *stream,int delimiter,char *name,long attributes);
|
yuuji@0
|
1597 void mm_lsub (MAILSTREAM *stream,int delimiter,char *name,long attributes);
|
yuuji@0
|
1598 void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status);
|
yuuji@0
|
1599 void mm_log (char *string,long errflg);
|
yuuji@0
|
1600 void mm_dlog (char *string);
|
yuuji@0
|
1601 void mm_login (NETMBX *mb,char *user,char *pwd,long trial);
|
yuuji@0
|
1602 void mm_critical (MAILSTREAM *stream);
|
yuuji@0
|
1603 void mm_nocritical (MAILSTREAM *stream);
|
yuuji@0
|
1604 long mm_diskerror (MAILSTREAM *stream,long errcode,long serious);
|
yuuji@0
|
1605 void mm_fatal (char *string);
|
yuuji@0
|
1606 void *mm_cache (MAILSTREAM *stream,unsigned long msgno,long op);
|
yuuji@0
|
1607
|
yuuji@0
|
1608 extern STRINGDRIVER mail_string;
|
yuuji@0
|
1609 void mail_versioncheck (char *version);
|
yuuji@0
|
1610 void mail_link (DRIVER *driver);
|
yuuji@0
|
1611 void *mail_parameters (MAILSTREAM *stream,long function,void *value);
|
yuuji@0
|
1612 DRIVER *mail_valid (MAILSTREAM *stream,char *mailbox,char *purpose);
|
yuuji@0
|
1613 DRIVER *mail_valid_net (char *name,DRIVER *drv,char *host,char *mailbox);
|
yuuji@0
|
1614 long mail_valid_net_parse (char *name,NETMBX *mb);
|
yuuji@0
|
1615 long mail_valid_net_parse_work (char *name,NETMBX *mb,char *service);
|
yuuji@0
|
1616 void mail_scan (MAILSTREAM *stream,char *ref,char *pat,char *contents);
|
yuuji@0
|
1617 void mail_list (MAILSTREAM *stream,char *ref,char *pat);
|
yuuji@0
|
1618 void mail_lsub (MAILSTREAM *stream,char *ref,char *pat);
|
yuuji@0
|
1619 long mail_subscribe (MAILSTREAM *stream,char *mailbox);
|
yuuji@0
|
1620 long mail_unsubscribe (MAILSTREAM *stream,char *mailbox);
|
yuuji@0
|
1621 long mail_create (MAILSTREAM *stream,char *mailbox);
|
yuuji@0
|
1622 long mail_delete (MAILSTREAM *stream,char *mailbox);
|
yuuji@0
|
1623 long mail_rename (MAILSTREAM *stream,char *old,char *newname);
|
yuuji@0
|
1624 char *mail_utf7_valid (char *mailbox);
|
yuuji@0
|
1625 long mail_status (MAILSTREAM *stream,char *mbx,long flags);
|
yuuji@0
|
1626 long mail_status_default (MAILSTREAM *stream,char *mbx,long flags);
|
yuuji@0
|
1627 MAILSTREAM *mail_open (MAILSTREAM *stream,char *name,long options);
|
yuuji@0
|
1628 MAILSTREAM *mail_open_work (DRIVER *d,MAILSTREAM *stream,char *name,
|
yuuji@0
|
1629 long options);
|
yuuji@0
|
1630 MAILSTREAM *mail_close_full (MAILSTREAM *stream,long options);
|
yuuji@0
|
1631 MAILHANDLE *mail_makehandle (MAILSTREAM *stream);
|
yuuji@0
|
1632 void mail_free_handle (MAILHANDLE **handle);
|
yuuji@0
|
1633 MAILSTREAM *mail_stream (MAILHANDLE *handle);
|
yuuji@0
|
1634
|
yuuji@0
|
1635 void mail_fetch_fast (MAILSTREAM *stream,char *sequence,long flags);
|
yuuji@0
|
1636 void mail_fetch_flags (MAILSTREAM *stream,char *sequence,long flags);
|
yuuji@0
|
1637 void mail_fetch_overview (MAILSTREAM *stream,char *sequence,overview_t ofn);
|
yuuji@0
|
1638 void mail_fetch_overview_sequence (MAILSTREAM *stream,char *sequence,
|
yuuji@0
|
1639 overview_t ofn);
|
yuuji@0
|
1640 void mail_fetch_overview_default (MAILSTREAM *stream,overview_t ofn);
|
yuuji@0
|
1641 ENVELOPE *mail_fetch_structure (MAILSTREAM *stream,unsigned long msgno,
|
yuuji@0
|
1642 BODY **body,long flags);
|
yuuji@0
|
1643 char *mail_fetch_message (MAILSTREAM *stream,unsigned long msgno,
|
yuuji@0
|
1644 unsigned long *len,long flags);
|
yuuji@0
|
1645 char *mail_fetch_header (MAILSTREAM *stream,unsigned long msgno,char *section,
|
yuuji@0
|
1646 STRINGLIST *lines,unsigned long *len,long flags);
|
yuuji@0
|
1647 char *mail_fetch_text (MAILSTREAM *stream,unsigned long msgno,char *section,
|
yuuji@0
|
1648 unsigned long *len,long flags);
|
yuuji@0
|
1649 char *mail_fetch_mime (MAILSTREAM *stream,unsigned long msgno,char *section,
|
yuuji@0
|
1650 unsigned long *len,long flags);
|
yuuji@0
|
1651 char *mail_fetch_body (MAILSTREAM *stream,unsigned long msgno,char *section,
|
yuuji@0
|
1652 unsigned long *len,long flags);
|
yuuji@0
|
1653 long mail_partial_text (MAILSTREAM *stream,unsigned long msgno,char *section,
|
yuuji@0
|
1654 unsigned long first,unsigned long last,long flags);
|
yuuji@0
|
1655 long mail_partial_body (MAILSTREAM *stream,unsigned long msgno,char *section,
|
yuuji@0
|
1656 unsigned long first,unsigned long last,long flags);
|
yuuji@0
|
1657 char *mail_fetch_text_return (GETS_DATA *md,SIZEDTEXT *t,unsigned long *len);
|
yuuji@0
|
1658 char *mail_fetch_string_return (GETS_DATA *md,STRING *bs,unsigned long i,
|
yuuji@0
|
1659 unsigned long *len,long flags);
|
yuuji@0
|
1660 long mail_read (void *stream,unsigned long size,char *buffer);
|
yuuji@0
|
1661 unsigned long mail_uid (MAILSTREAM *stream,unsigned long msgno);
|
yuuji@0
|
1662 unsigned long mail_msgno (MAILSTREAM *stream,unsigned long uid);
|
yuuji@0
|
1663 void mail_fetchfrom (char *s,MAILSTREAM *stream,unsigned long msgno,
|
yuuji@0
|
1664 long length);
|
yuuji@0
|
1665 void mail_fetchsubject (char *s,MAILSTREAM *stream,unsigned long msgno,
|
yuuji@0
|
1666 long length);
|
yuuji@0
|
1667 MESSAGECACHE *mail_elt (MAILSTREAM *stream,unsigned long msgno);
|
yuuji@0
|
1668 void mail_flag (MAILSTREAM *stream,char *sequence,char *flag,long flags);
|
yuuji@0
|
1669 long mail_search_full (MAILSTREAM *stream,char *charset,SEARCHPGM *pgm,
|
yuuji@0
|
1670 long flags);
|
yuuji@0
|
1671 long mail_search_default (MAILSTREAM *stream,char *charset,SEARCHPGM *pgm,
|
yuuji@0
|
1672 long flags);
|
yuuji@0
|
1673 long mail_ping (MAILSTREAM *stream);
|
yuuji@0
|
1674 void mail_check (MAILSTREAM *stream);
|
yuuji@0
|
1675 long mail_expunge_full (MAILSTREAM *stream,char *sequence,long options);
|
yuuji@0
|
1676 long mail_copy_full (MAILSTREAM *stream,char *sequence,char *mailbox,
|
yuuji@0
|
1677 long options);
|
yuuji@0
|
1678 long mail_append_full (MAILSTREAM *stream,char *mailbox,char *flags,char *date,
|
yuuji@0
|
1679 STRING *message);
|
yuuji@0
|
1680 long mail_append_multiple (MAILSTREAM *stream,char *mailbox,append_t af,
|
yuuji@0
|
1681 void *data);
|
yuuji@0
|
1682 void mail_gc (MAILSTREAM *stream,long gcflags);
|
yuuji@0
|
1683 void mail_gc_msg (MESSAGE *msg,long gcflags);
|
yuuji@0
|
1684 void mail_gc_body (BODY *body);
|
yuuji@0
|
1685
|
yuuji@0
|
1686 BODY *mail_body (MAILSTREAM *stream,unsigned long msgno,
|
yuuji@0
|
1687 unsigned char *section);
|
yuuji@0
|
1688 char *mail_date (char *string,MESSAGECACHE *elt);
|
yuuji@0
|
1689 char *mail_cdate (char *string,MESSAGECACHE *elt);
|
yuuji@0
|
1690 long mail_parse_date (MESSAGECACHE *elt,unsigned char *string);
|
yuuji@0
|
1691 void mail_exists (MAILSTREAM *stream,unsigned long nmsgs);
|
yuuji@0
|
1692 void mail_recent (MAILSTREAM *stream,unsigned long recent);
|
yuuji@0
|
1693 void mail_expunged (MAILSTREAM *stream,unsigned long msgno);
|
yuuji@0
|
1694 void mail_lock (MAILSTREAM *stream);
|
yuuji@0
|
1695 void mail_unlock (MAILSTREAM *stream);
|
yuuji@0
|
1696 void mail_debug (MAILSTREAM *stream);
|
yuuji@0
|
1697 void mail_nodebug (MAILSTREAM *stream);
|
yuuji@0
|
1698 void mail_dlog (char *string,long flag);
|
yuuji@0
|
1699 long mail_match_lines (STRINGLIST *lines,STRINGLIST *msglines,long flags);
|
yuuji@0
|
1700 unsigned long mail_filter (char *text,unsigned long len,STRINGLIST *lines,
|
yuuji@0
|
1701 long flags);
|
yuuji@0
|
1702 long mail_search_msg (MAILSTREAM *stream,unsigned long msgno,char *section,
|
yuuji@0
|
1703 SEARCHPGM *pgm);
|
yuuji@0
|
1704 long mail_search_header_text (char *s,STRINGLIST *st);
|
yuuji@0
|
1705 long mail_search_header (SIZEDTEXT *hdr,STRINGLIST *st);
|
yuuji@0
|
1706 long mail_search_text (MAILSTREAM *stream,unsigned long msgno,char *section,
|
yuuji@0
|
1707 STRINGLIST *st,long flags);
|
yuuji@0
|
1708 long mail_search_body (MAILSTREAM *stream,unsigned long msgno,BODY *body,
|
yuuji@0
|
1709 char *prefix,unsigned long section,long flags);
|
yuuji@0
|
1710 long mail_search_string (SIZEDTEXT *s,char *charset,STRINGLIST **st);
|
yuuji@0
|
1711 long mail_search_string_work (SIZEDTEXT *s,STRINGLIST **st);
|
yuuji@0
|
1712 long mail_search_keyword (MAILSTREAM *stream,MESSAGECACHE *elt,STRINGLIST *st,
|
yuuji@0
|
1713 long flag);
|
yuuji@0
|
1714 long mail_search_addr (ADDRESS *adr,STRINGLIST *st);
|
yuuji@0
|
1715 char *mail_search_gets (readfn_t f,void *stream,unsigned long size,
|
yuuji@0
|
1716 GETS_DATA *md);
|
yuuji@0
|
1717 SEARCHPGM *mail_criteria (char *criteria);
|
yuuji@0
|
1718 int mail_criteria_date (unsigned short *date,char **r);
|
yuuji@0
|
1719 int mail_criteria_string (STRINGLIST **s,char **r);
|
yuuji@0
|
1720 unsigned short mail_shortdate (unsigned int year,unsigned int month,
|
yuuji@0
|
1721 unsigned int day);
|
yuuji@0
|
1722 SEARCHSET *mail_parse_set (char *s,char **ret);
|
yuuji@0
|
1723 SEARCHSET *mail_append_set (SEARCHSET *set,unsigned long msgno);
|
yuuji@0
|
1724 unsigned long *mail_sort (MAILSTREAM *stream,char *charset,SEARCHPGM *spg,
|
yuuji@0
|
1725 SORTPGM *pgm,long flags);
|
yuuji@0
|
1726 unsigned long *mail_sort_cache (MAILSTREAM *stream,SORTPGM *pgm,SORTCACHE **sc,
|
yuuji@0
|
1727 long flags);
|
yuuji@0
|
1728 unsigned long *mail_sort_msgs (MAILSTREAM *stream,char *charset,SEARCHPGM *spg,
|
yuuji@0
|
1729 SORTPGM *pgm,long flags);
|
yuuji@0
|
1730 SORTCACHE **mail_sort_loadcache (MAILSTREAM *stream,SORTPGM *pgm);
|
yuuji@0
|
1731 unsigned int mail_strip_subject (char *t,char **ret);
|
yuuji@0
|
1732 char *mail_strip_subject_wsp (char *s);
|
yuuji@0
|
1733 char *mail_strip_subject_blob (char *s);
|
yuuji@0
|
1734 int mail_sort_compare (const void *a1,const void *a2);
|
yuuji@0
|
1735 unsigned long mail_longdate (MESSAGECACHE *elt);
|
yuuji@0
|
1736 THREADNODE *mail_thread (MAILSTREAM *stream,char *type,char *charset,
|
yuuji@0
|
1737 SEARCHPGM *spg,long flags);
|
yuuji@0
|
1738 THREADNODE *mail_thread_msgs (MAILSTREAM *stream,char *type,char *charset,
|
yuuji@0
|
1739 SEARCHPGM *spg,long flags,sorter_t sorter);
|
yuuji@0
|
1740 THREADNODE *mail_thread_orderedsubject (MAILSTREAM *stream,char *charset,
|
yuuji@0
|
1741 SEARCHPGM *spg,long flags,
|
yuuji@0
|
1742 sorter_t sorter);
|
yuuji@0
|
1743 THREADNODE *mail_thread_references (MAILSTREAM *stream,char *charset,
|
yuuji@0
|
1744 SEARCHPGM *spg,long flags,
|
yuuji@0
|
1745 sorter_t sorter);
|
yuuji@0
|
1746 void mail_thread_loadcache (MAILSTREAM *stream,unsigned long uid,OVERVIEW *ov,
|
yuuji@0
|
1747 unsigned long msgno);
|
yuuji@0
|
1748 char *mail_thread_parse_msgid (char *s,char **ss);
|
yuuji@0
|
1749 STRINGLIST *mail_thread_parse_references (char *s,long flag);
|
yuuji@0
|
1750 long mail_thread_check_child (container_t mother,container_t daughter);
|
yuuji@0
|
1751 container_t mail_thread_prune_dummy (container_t msg,container_t ane);
|
yuuji@0
|
1752 container_t mail_thread_prune_dummy_work (container_t msg,container_t ane);
|
yuuji@0
|
1753 THREADNODE *mail_thread_c2node (MAILSTREAM *stream,container_t con,long flags);
|
yuuji@0
|
1754 THREADNODE *mail_thread_sort (THREADNODE *thr,THREADNODE **tc);
|
yuuji@0
|
1755 int mail_thread_compare_date (const void *a1,const void *a2);
|
yuuji@0
|
1756 long mail_sequence (MAILSTREAM *stream,unsigned char *sequence);
|
yuuji@0
|
1757 long mail_uid_sequence (MAILSTREAM *stream,unsigned char *sequence);
|
yuuji@0
|
1758 long mail_parse_flags (MAILSTREAM *stream,char *flag,unsigned long *uf);
|
yuuji@0
|
1759 long mail_usable_network_stream (MAILSTREAM *stream,char *name);
|
yuuji@0
|
1760
|
yuuji@0
|
1761 MESSAGECACHE *mail_new_cache_elt (unsigned long msgno);
|
yuuji@0
|
1762 ENVELOPE *mail_newenvelope (void);
|
yuuji@0
|
1763 ADDRESS *mail_newaddr (void);
|
yuuji@0
|
1764 BODY *mail_newbody (void);
|
yuuji@0
|
1765 BODY *mail_initbody (BODY *body);
|
yuuji@0
|
1766 PARAMETER *mail_newbody_parameter (void);
|
yuuji@0
|
1767 PART *mail_newbody_part (void);
|
yuuji@0
|
1768 MESSAGE *mail_newmsg (void);
|
yuuji@0
|
1769 STRINGLIST *mail_newstringlist (void);
|
yuuji@0
|
1770 SEARCHPGM *mail_newsearchpgm (void);
|
yuuji@0
|
1771 SEARCHHEADER *mail_newsearchheader (char *line,char *text);
|
yuuji@0
|
1772 SEARCHSET *mail_newsearchset (void);
|
yuuji@0
|
1773 SEARCHOR *mail_newsearchor (void);
|
yuuji@0
|
1774 SEARCHPGMLIST *mail_newsearchpgmlist (void);
|
yuuji@0
|
1775 SORTPGM *mail_newsortpgm (void);
|
yuuji@0
|
1776 THREADNODE *mail_newthreadnode (SORTCACHE *sc);
|
yuuji@0
|
1777 ACLLIST *mail_newacllist (void);
|
yuuji@0
|
1778 QUOTALIST *mail_newquotalist (void);
|
yuuji@0
|
1779 void mail_free_body (BODY **body);
|
yuuji@0
|
1780 void mail_free_body_data (BODY *body);
|
yuuji@0
|
1781 void mail_free_body_parameter (PARAMETER **parameter);
|
yuuji@0
|
1782 void mail_free_body_part (PART **part);
|
yuuji@0
|
1783 void mail_free_cache (MAILSTREAM *stream);
|
yuuji@0
|
1784 void mail_free_elt (MESSAGECACHE **elt);
|
yuuji@0
|
1785 void mail_free_envelope (ENVELOPE **env);
|
yuuji@0
|
1786 void mail_free_address (ADDRESS **address);
|
yuuji@0
|
1787 void mail_free_stringlist (STRINGLIST **string);
|
yuuji@0
|
1788 void mail_free_searchpgm (SEARCHPGM **pgm);
|
yuuji@0
|
1789 void mail_free_searchheader (SEARCHHEADER **hdr);
|
yuuji@0
|
1790 void mail_free_searchset (SEARCHSET **set);
|
yuuji@0
|
1791 void mail_free_searchor (SEARCHOR **orl);
|
yuuji@0
|
1792 void mail_free_searchpgmlist (SEARCHPGMLIST **pgl);
|
yuuji@0
|
1793 void mail_free_namespace (NAMESPACE **n);
|
yuuji@0
|
1794 void mail_free_sortpgm (SORTPGM **pgm);
|
yuuji@0
|
1795 void mail_free_threadnode (THREADNODE **thr);
|
yuuji@0
|
1796 void mail_free_acllist (ACLLIST **al);
|
yuuji@0
|
1797 void mail_free_quotalist (QUOTALIST **ql);
|
yuuji@0
|
1798 void auth_link (AUTHENTICATOR *auth);
|
yuuji@0
|
1799 char *mail_auth (char *mechanism,authresponse_t resp,int argc,char *argv[]);
|
yuuji@0
|
1800 AUTHENTICATOR *mail_lookup_auth (unsigned long i);
|
yuuji@0
|
1801 unsigned int mail_lookup_auth_name (char *mechanism,long flags);
|
yuuji@0
|
1802
|
yuuji@0
|
1803 NETSTREAM *net_open (NETMBX *mb,NETDRIVER *dv,unsigned long port,
|
yuuji@0
|
1804 NETDRIVER *ssld,char *ssls,unsigned long sslp);
|
yuuji@0
|
1805 NETSTREAM *net_open_work (NETDRIVER *dv,char *host,char *service,
|
yuuji@0
|
1806 unsigned long port,unsigned long portoverride,
|
yuuji@0
|
1807 unsigned long flags);
|
yuuji@0
|
1808 NETSTREAM *net_aopen (NETDRIVER *dv,NETMBX *mb,char *service,char *usrbuf);
|
yuuji@0
|
1809 char *net_getline (NETSTREAM *stream);
|
yuuji@0
|
1810 /* stream must be void* for use as readfn_t */
|
yuuji@0
|
1811 long net_getbuffer (void *stream,unsigned long size,char *buffer);
|
yuuji@0
|
1812 long net_soutr (NETSTREAM *stream,char *string);
|
yuuji@0
|
1813 long net_sout (NETSTREAM *stream,char *string,unsigned long size);
|
yuuji@0
|
1814 void net_close (NETSTREAM *stream);
|
yuuji@0
|
1815 char *net_host (NETSTREAM *stream);
|
yuuji@0
|
1816 char *net_remotehost (NETSTREAM *stream);
|
yuuji@0
|
1817 unsigned long net_port (NETSTREAM *stream);
|
yuuji@0
|
1818 char *net_localhost (NETSTREAM *stream);
|
yuuji@0
|
1819
|
yuuji@0
|
1820 long sm_subscribe (char *mailbox);
|
yuuji@0
|
1821 long sm_unsubscribe (char *mailbox);
|
yuuji@0
|
1822 char *sm_read (void **sdb);
|
yuuji@0
|
1823
|
yuuji@0
|
1824 void ssl_onceonlyinit (void);
|
yuuji@0
|
1825 char *ssl_start_tls (char *s);
|
yuuji@0
|
1826 void ssl_server_init (char *server);
|
yuuji@0
|
1827
|
yuuji@0
|
1828
|
yuuji@0
|
1829 /* Server I/O functions */
|
yuuji@0
|
1830
|
yuuji@0
|
1831 int PBIN (void);
|
yuuji@0
|
1832 char *PSIN (char *s,int n);
|
yuuji@0
|
1833 long PSINR (char *s,unsigned long n);
|
yuuji@0
|
1834 int PBOUT (int c);
|
yuuji@0
|
1835 long INWAIT (long seconds);
|
yuuji@0
|
1836 int PSOUT (char *s);
|
yuuji@0
|
1837 int PSOUTR (SIZEDTEXT *s);
|
yuuji@0
|
1838 int PFLUSH (void);
|