Mercurial > hg > nginx-quic
annotate src/mail/ngx_mail.h @ 2462:90d5ddfedbb1
use GetFileAttributesEx() instead of GetFileAttributes()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 21 Jan 2009 15:56:29 +0000 |
parents | 8156bc03982a |
children | a59b26eee816 |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
424
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
424
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
424
diff
changeset
|
4 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
424
diff
changeset
|
5 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
424
diff
changeset
|
6 |
1136 | 7 #ifndef _NGX_MAIL_H_INCLUDED_ |
8 #define _NGX_MAIL_H_INCLUDED_ | |
417
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 |
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 #include <ngx_config.h> |
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
12 #include <ngx_core.h> |
419
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
13 #include <ngx_event.h> |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
14 #include <ngx_event_connect.h> |
417
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
15 |
1136 | 16 #if (NGX_MAIL_SSL) |
17 #include <ngx_mail_ssl_module.h> | |
539 | 18 #endif |
19 | |
20 | |
417
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
21 |
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
22 typedef struct { |
583 | 23 void **main_conf; |
24 void **srv_conf; | |
1136 | 25 } ngx_mail_conf_ctx_t; |
521 | 26 |
27 | |
28 typedef struct { | |
641 | 29 in_addr_t addr; |
30 in_port_t port; | |
31 int family; | |
32 | |
33 /* server ctx */ | |
1136 | 34 ngx_mail_conf_ctx_t *ctx; |
641 | 35 |
36 unsigned bind:1; | |
2224 | 37 #if (NGX_MAIL_SSL) |
38 unsigned ssl:1; | |
39 #endif | |
1136 | 40 } ngx_mail_listen_t; |
641 | 41 |
42 | |
43 typedef struct { | |
44 in_addr_t addr; | |
1136 | 45 ngx_mail_conf_ctx_t *ctx; |
641 | 46 ngx_str_t addr_text; |
2224 | 47 #if (NGX_MAIL_SSL) |
48 ngx_uint_t ssl; /* unsigned ssl:1; */ | |
49 #endif | |
1136 | 50 } ngx_mail_in_addr_t; |
641 | 51 |
52 | |
53 typedef struct { | |
1136 | 54 ngx_mail_in_addr_t *addrs; /* array of ngx_mail_in_addr_t */ |
641 | 55 ngx_uint_t naddrs; |
1136 | 56 } ngx_mail_in_port_t; |
641 | 57 |
58 | |
59 typedef struct { | |
60 in_port_t port; | |
1136 | 61 ngx_array_t addrs; /* array of ngx_mail_conf_in_addr_t */ |
62 } ngx_mail_conf_in_port_t; | |
641 | 63 |
64 | |
65 typedef struct { | |
66 in_addr_t addr; | |
1136 | 67 ngx_mail_conf_ctx_t *ctx; |
641 | 68 unsigned bind:1; |
2224 | 69 #if (NGX_MAIL_SSL) |
70 unsigned ssl:1; | |
71 #endif | |
1136 | 72 } ngx_mail_conf_in_addr_t; |
641 | 73 |
74 | |
75 typedef struct { | |
1136 | 76 ngx_array_t servers; /* ngx_mail_core_srv_conf_t */ |
77 ngx_array_t listen; /* ngx_mail_listen_t */ | |
78 } ngx_mail_core_main_conf_t; | |
521 | 79 |
80 | |
1136 | 81 #define NGX_MAIL_POP3_PROTOCOL 0 |
82 #define NGX_MAIL_IMAP_PROTOCOL 1 | |
83 #define NGX_MAIL_SMTP_PROTOCOL 2 | |
521 | 84 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
85 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
86 typedef struct ngx_mail_protocol_s ngx_mail_protocol_t; |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
87 |
418
cf072d26d6d6
nginx-0.0.10-2004-09-08-09:18:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
88 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
89 typedef struct { |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
90 ngx_mail_protocol_t *protocol; |
521 | 91 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
92 ngx_msec_t timeout; |
1892
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
93 ngx_msec_t resolver_timeout; |
521 | 94 |
587 | 95 ngx_flag_t so_keepalive; |
96 | |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
97 ngx_str_t server_name; |
527 | 98 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
99 u_char *file_name; |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
100 ngx_int_t line; |
527 | 101 |
1892
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
102 ngx_resolver_t *resolver; |
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
103 |
521 | 104 /* server ctx */ |
1136 | 105 ngx_mail_conf_ctx_t *ctx; |
106 } ngx_mail_core_srv_conf_t; | |
521 | 107 |
108 | |
527 | 109 typedef enum { |
421
01456a419cf9
nginx-0.0.10-2004-09-10-18:32:02 import
Igor Sysoev <igor@sysoev.ru>
parents:
419
diff
changeset
|
110 ngx_pop3_start = 0, |
527 | 111 ngx_pop3_user, |
809 | 112 ngx_pop3_passwd, |
113 ngx_pop3_auth_login_username, | |
114 ngx_pop3_auth_login_password, | |
115 ngx_pop3_auth_plain, | |
116 ngx_pop3_auth_cram_md5 | |
1673 | 117 } ngx_pop3_state_e; |
421
01456a419cf9
nginx-0.0.10-2004-09-10-18:32:02 import
Igor Sysoev <igor@sysoev.ru>
parents:
419
diff
changeset
|
118 |
01456a419cf9
nginx-0.0.10-2004-09-10-18:32:02 import
Igor Sysoev <igor@sysoev.ru>
parents:
419
diff
changeset
|
119 |
1136 | 120 typedef enum { |
121 ngx_imap_start = 0, | |
1323 | 122 ngx_imap_auth_login_username, |
123 ngx_imap_auth_login_password, | |
124 ngx_imap_auth_plain, | |
125 ngx_imap_auth_cram_md5, | |
1136 | 126 ngx_imap_login, |
127 ngx_imap_user, | |
128 ngx_imap_passwd | |
129 } ngx_imap_state_e; | |
130 | |
131 | |
132 typedef enum { | |
133 ngx_smtp_start = 0, | |
134 ngx_smtp_auth_login_username, | |
135 ngx_smtp_auth_login_password, | |
136 ngx_smtp_auth_plain, | |
137 ngx_smtp_auth_cram_md5, | |
138 ngx_smtp_helo, | |
2309 | 139 ngx_smtp_helo_xclient, |
140 ngx_smtp_helo_from, | |
141 ngx_smtp_xclient, | |
142 ngx_smtp_xclient_from, | |
143 ngx_smtp_from, | |
144 ngx_smtp_to | |
1136 | 145 } ngx_smtp_state_e; |
146 | |
147 | |
418
cf072d26d6d6
nginx-0.0.10-2004-09-08-09:18:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
148 typedef struct { |
521 | 149 ngx_peer_connection_t upstream; |
150 ngx_buf_t *buffer; | |
1136 | 151 } ngx_mail_proxy_ctx_t; |
521 | 152 |
153 | |
154 typedef struct { | |
1136 | 155 uint32_t signature; /* "MAIL" */ |
419
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
156 |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
157 ngx_connection_t *connection; |
521 | 158 |
539 | 159 ngx_str_t out; |
419
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
160 ngx_buf_t *buffer; |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
161 |
521 | 162 void **ctx; |
163 void **main_conf; | |
164 void **srv_conf; | |
165 | |
1892
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
166 ngx_resolver_ctx_t *resolver_ctx; |
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
167 |
1136 | 168 ngx_mail_proxy_ctx_t *proxy; |
521 | 169 |
1136 | 170 ngx_uint_t mail_state; |
421
01456a419cf9
nginx-0.0.10-2004-09-10-18:32:02 import
Igor Sysoev <igor@sysoev.ru>
parents:
419
diff
changeset
|
171 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
172 unsigned protocol:3; |
539 | 173 unsigned blocked:1; |
174 unsigned quit:1; | |
527 | 175 unsigned quoted:1; |
543 | 176 unsigned backslash:1; |
177 unsigned no_sync_literal:1; | |
641 | 178 unsigned starttls:1; |
1136 | 179 unsigned esmtp:1; |
2309 | 180 unsigned auth_method:3; |
883 | 181 unsigned auth_wait:1; |
418
cf072d26d6d6
nginx-0.0.10-2004-09-08-09:18:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
182 |
422
edaefb2a20fc
nginx-0.0.10-2004-09-12-00:22:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
421
diff
changeset
|
183 ngx_str_t login; |
edaefb2a20fc
nginx-0.0.10-2004-09-12-00:22:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
421
diff
changeset
|
184 ngx_str_t passwd; |
edaefb2a20fc
nginx-0.0.10-2004-09-12-00:22:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
421
diff
changeset
|
185 |
800 | 186 ngx_str_t salt; |
527 | 187 ngx_str_t tag; |
539 | 188 ngx_str_t tagged_line; |
1476
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
189 ngx_str_t text; |
527 | 190 |
641 | 191 ngx_str_t *addr_text; |
1892
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
192 ngx_str_t host; |
1136 | 193 ngx_str_t smtp_helo; |
2309 | 194 ngx_str_t smtp_from; |
195 ngx_str_t smtp_to; | |
641 | 196 |
419
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
197 ngx_uint_t command; |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
198 ngx_array_t args; |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
199 |
527 | 200 ngx_uint_t login_attempt; |
201 | |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
202 /* used to parse POP3/IMAP/SMTP command */ |
419
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
203 |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
204 ngx_uint_t state; |
527 | 205 u_char *cmd_start; |
419
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
206 u_char *arg_start; |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
207 u_char *arg_end; |
527 | 208 ngx_uint_t literal_len; |
1136 | 209 } ngx_mail_session_t; |
418
cf072d26d6d6
nginx-0.0.10-2004-09-08-09:18:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
210 |
cf072d26d6d6
nginx-0.0.10-2004-09-08-09:18:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
211 |
541 | 212 typedef struct { |
583 | 213 ngx_str_t *client; |
1136 | 214 ngx_mail_session_t *session; |
215 } ngx_mail_log_ctx_t; | |
541 | 216 |
217 | |
1323 | 218 #define NGX_POP3_USER 1 |
219 #define NGX_POP3_PASS 2 | |
220 #define NGX_POP3_CAPA 3 | |
221 #define NGX_POP3_QUIT 4 | |
222 #define NGX_POP3_NOOP 5 | |
223 #define NGX_POP3_STLS 6 | |
224 #define NGX_POP3_APOP 7 | |
225 #define NGX_POP3_AUTH 8 | |
226 #define NGX_POP3_STAT 9 | |
227 #define NGX_POP3_LIST 10 | |
228 #define NGX_POP3_RETR 11 | |
229 #define NGX_POP3_DELE 12 | |
230 #define NGX_POP3_RSET 13 | |
231 #define NGX_POP3_TOP 14 | |
232 #define NGX_POP3_UIDL 15 | |
419
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
233 |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
234 |
1323 | 235 #define NGX_IMAP_LOGIN 1 |
236 #define NGX_IMAP_LOGOUT 2 | |
237 #define NGX_IMAP_CAPABILITY 3 | |
238 #define NGX_IMAP_NOOP 4 | |
239 #define NGX_IMAP_STARTTLS 5 | |
800 | 240 |
1323 | 241 #define NGX_IMAP_NEXT 6 |
242 | |
243 #define NGX_IMAP_AUTHENTICATE 7 | |
527 | 244 |
800 | 245 |
1323 | 246 #define NGX_SMTP_HELO 1 |
247 #define NGX_SMTP_EHLO 2 | |
248 #define NGX_SMTP_AUTH 3 | |
249 #define NGX_SMTP_QUIT 4 | |
250 #define NGX_SMTP_NOOP 5 | |
251 #define NGX_SMTP_MAIL 6 | |
252 #define NGX_SMTP_RSET 7 | |
253 #define NGX_SMTP_RCPT 8 | |
254 #define NGX_SMTP_DATA 9 | |
255 #define NGX_SMTP_VRFY 10 | |
256 #define NGX_SMTP_EXPN 11 | |
257 #define NGX_SMTP_HELP 12 | |
258 #define NGX_SMTP_STARTTLS 13 | |
527 | 259 |
260 | |
1136 | 261 #define NGX_MAIL_AUTH_PLAIN 0 |
262 #define NGX_MAIL_AUTH_LOGIN 1 | |
263 #define NGX_MAIL_AUTH_APOP 2 | |
264 #define NGX_MAIL_AUTH_CRAM_MD5 3 | |
2309 | 265 #define NGX_MAIL_AUTH_NONE 4 |
419
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
266 |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
267 |
1136 | 268 #define NGX_MAIL_AUTH_PLAIN_ENABLED 0x0002 |
269 #define NGX_MAIL_AUTH_LOGIN_ENABLED 0x0004 | |
270 #define NGX_MAIL_AUTH_APOP_ENABLED 0x0008 | |
271 #define NGX_MAIL_AUTH_CRAM_MD5_ENABLED 0x0010 | |
2309 | 272 #define NGX_MAIL_AUTH_NONE_ENABLED 0x0020 |
521 | 273 |
274 | |
1136 | 275 #define NGX_MAIL_PARSE_INVALID_COMMAND 20 |
521 | 276 |
277 | |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
278 typedef void (*ngx_mail_init_session_pt)(ngx_mail_session_t *s, |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
279 ngx_connection_t *c); |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
280 typedef void (*ngx_mail_init_protocol_pt)(ngx_event_t *rev); |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
281 typedef void (*ngx_mail_auth_state_pt)(ngx_event_t *rev); |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
282 typedef ngx_int_t (*ngx_mail_parse_command_pt)(ngx_mail_session_t *s); |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
283 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
284 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
285 struct ngx_mail_protocol_s { |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
286 ngx_str_t name; |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
287 in_port_t port[4]; |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
288 ngx_uint_t type; |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
289 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
290 ngx_mail_init_session_pt init_session; |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
291 ngx_mail_init_protocol_pt init_protocol; |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
292 ngx_mail_parse_command_pt parse_command; |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
293 ngx_mail_auth_state_pt auth_state; |
1136 | 294 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
295 ngx_str_t internal_server_error; |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
296 }; |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
297 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
298 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
299 typedef struct { |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
300 ngx_mail_protocol_t *protocol; |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
301 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
302 void *(*create_main_conf)(ngx_conf_t *cf); |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
303 char *(*init_main_conf)(ngx_conf_t *cf, void *conf); |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
304 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
305 void *(*create_srv_conf)(ngx_conf_t *cf); |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
306 char *(*merge_srv_conf)(ngx_conf_t *cf, void *prev, |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
307 void *conf); |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
308 } ngx_mail_module_t; |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
309 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
310 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
311 #define NGX_MAIL_MODULE 0x4C49414D /* "MAIL" */ |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
312 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
313 #define NGX_MAIL_MAIN_CONF 0x02000000 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
314 #define NGX_MAIL_SRV_CONF 0x04000000 |
1136 | 315 |
316 | |
317 #define NGX_MAIL_MAIN_CONF_OFFSET offsetof(ngx_mail_conf_ctx_t, main_conf) | |
318 #define NGX_MAIL_SRV_CONF_OFFSET offsetof(ngx_mail_conf_ctx_t, srv_conf) | |
319 | |
320 | |
321 #define ngx_mail_get_module_ctx(s, module) (s)->ctx[module.ctx_index] | |
322 #define ngx_mail_set_ctx(s, c, module) s->ctx[module.ctx_index] = c; | |
323 #define ngx_mail_delete_ctx(s, module) s->ctx[module.ctx_index] = NULL; | |
521 | 324 |
325 | |
1136 | 326 #define ngx_mail_get_module_main_conf(s, module) \ |
521 | 327 (s)->main_conf[module.ctx_index] |
1136 | 328 #define ngx_mail_get_module_srv_conf(s, module) (s)->srv_conf[module.ctx_index] |
423
fda5987b188d
nginx-0.0.10-2004-09-13-20:18:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
422
diff
changeset
|
329 |
1136 | 330 #define ngx_mail_conf_get_module_main_conf(cf, module) \ |
331 ((ngx_mail_conf_ctx_t *) cf->ctx)->main_conf[module.ctx_index] | |
1322 | 332 #define ngx_mail_conf_get_module_srv_conf(cf, module) \ |
333 ((ngx_mail_conf_ctx_t *) cf->ctx)->srv_conf[module.ctx_index] | |
641 | 334 |
1476
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
335 |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
336 #if (NGX_MAIL_SSL) |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
337 void ngx_mail_starttls_handler(ngx_event_t *rev); |
1479 | 338 ngx_int_t ngx_mail_starttls_only(ngx_mail_session_t *s, ngx_connection_t *c); |
1476
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
339 #endif |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
340 |
423
fda5987b188d
nginx-0.0.10-2004-09-13-20:18:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
422
diff
changeset
|
341 |
1136 | 342 void ngx_mail_init_connection(ngx_connection_t *c); |
1476
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
343 |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
344 ngx_int_t ngx_mail_salt(ngx_mail_session_t *s, ngx_connection_t *c, |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
345 ngx_mail_core_srv_conf_t *cscf); |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
346 ngx_int_t ngx_mail_auth_plain(ngx_mail_session_t *s, ngx_connection_t *c, |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
347 ngx_uint_t n); |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
348 ngx_int_t ngx_mail_auth_login_username(ngx_mail_session_t *s, |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
349 ngx_connection_t *c); |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
350 ngx_int_t ngx_mail_auth_login_password(ngx_mail_session_t *s, |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
351 ngx_connection_t *c); |
1479 | 352 ngx_int_t ngx_mail_auth_cram_md5_salt(ngx_mail_session_t *s, |
353 ngx_connection_t *c, char *prefix, size_t len); | |
1476
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
354 ngx_int_t ngx_mail_auth_cram_md5(ngx_mail_session_t *s, ngx_connection_t *c); |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
355 ngx_int_t ngx_mail_auth_parse(ngx_mail_session_t *s, ngx_connection_t *c); |
1476
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
356 |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
357 void ngx_mail_send(ngx_event_t *wev); |
1482 | 358 ngx_int_t ngx_mail_read_command(ngx_mail_session_t *s, ngx_connection_t *c); |
359 void ngx_mail_auth(ngx_mail_session_t *s, ngx_connection_t *c); | |
1136 | 360 void ngx_mail_close_connection(ngx_connection_t *c); |
361 void ngx_mail_session_internal_server_error(ngx_mail_session_t *s); | |
1476
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
362 u_char *ngx_mail_log_error(ngx_log_t *log, u_char *buf, size_t len); |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
363 |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
364 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
365 char *ngx_mail_capabilities(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); |
419
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
366 |
417
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
367 |
521 | 368 /* STUB */ |
1136 | 369 void ngx_mail_proxy_init(ngx_mail_session_t *s, ngx_peer_addr_t *peer); |
370 void ngx_mail_auth_http_init(ngx_mail_session_t *s); | |
521 | 371 /**/ |
372 | |
373 | |
1136 | 374 extern ngx_uint_t ngx_mail_max_module; |
375 extern ngx_module_t ngx_mail_core_module; | |
521 | 376 |
377 | |
1136 | 378 #endif /* _NGX_MAIL_H_INCLUDED_ */ |