Mercurial > hg > nginx-quic
annotate src/mail/ngx_mail.h @ 2325:50be8dd53d5e stable-0.6
r2205 merge:
fix divide by zero if max_fails=0
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 20 Nov 2008 17:16:39 +0000 |
parents | 057d362ee50e |
children | 109849282793 62c95a6b143b |
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; | |
1136 | 37 } ngx_mail_listen_t; |
641 | 38 |
39 | |
40 typedef struct { | |
41 in_addr_t addr; | |
1136 | 42 ngx_mail_conf_ctx_t *ctx; |
641 | 43 ngx_str_t addr_text; |
1136 | 44 } ngx_mail_in_addr_t; |
641 | 45 |
46 | |
47 typedef struct { | |
1136 | 48 ngx_mail_in_addr_t *addrs; /* array of ngx_mail_in_addr_t */ |
641 | 49 ngx_uint_t naddrs; |
1136 | 50 } ngx_mail_in_port_t; |
641 | 51 |
52 | |
53 typedef struct { | |
54 in_port_t port; | |
1136 | 55 ngx_array_t addrs; /* array of ngx_mail_conf_in_addr_t */ |
56 } ngx_mail_conf_in_port_t; | |
641 | 57 |
58 | |
59 typedef struct { | |
60 in_addr_t addr; | |
1136 | 61 ngx_mail_conf_ctx_t *ctx; |
641 | 62 unsigned bind:1; |
1136 | 63 } ngx_mail_conf_in_addr_t; |
641 | 64 |
65 | |
66 typedef struct { | |
1136 | 67 ngx_array_t servers; /* ngx_mail_core_srv_conf_t */ |
68 ngx_array_t listen; /* ngx_mail_listen_t */ | |
69 } ngx_mail_core_main_conf_t; | |
521 | 70 |
71 | |
1136 | 72 #define NGX_MAIL_POP3_PROTOCOL 0 |
73 #define NGX_MAIL_IMAP_PROTOCOL 1 | |
74 #define NGX_MAIL_SMTP_PROTOCOL 2 | |
521 | 75 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
76 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
77 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
|
78 |
418
cf072d26d6d6
nginx-0.0.10-2004-09-08-09:18:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
79 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
80 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
|
81 ngx_mail_protocol_t *protocol; |
521 | 82 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
83 ngx_msec_t timeout; |
1892
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
84 ngx_msec_t resolver_timeout; |
521 | 85 |
587 | 86 ngx_flag_t so_keepalive; |
87 | |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
88 ngx_str_t server_name; |
527 | 89 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
90 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
|
91 ngx_int_t line; |
527 | 92 |
1892
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
93 ngx_resolver_t *resolver; |
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
94 |
521 | 95 /* server ctx */ |
1136 | 96 ngx_mail_conf_ctx_t *ctx; |
97 } ngx_mail_core_srv_conf_t; | |
521 | 98 |
99 | |
527 | 100 typedef enum { |
421
01456a419cf9
nginx-0.0.10-2004-09-10-18:32:02 import
Igor Sysoev <igor@sysoev.ru>
parents:
419
diff
changeset
|
101 ngx_pop3_start = 0, |
527 | 102 ngx_pop3_user, |
809 | 103 ngx_pop3_passwd, |
104 ngx_pop3_auth_login_username, | |
105 ngx_pop3_auth_login_password, | |
106 ngx_pop3_auth_plain, | |
107 ngx_pop3_auth_cram_md5 | |
1673 | 108 } 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
|
109 |
01456a419cf9
nginx-0.0.10-2004-09-10-18:32:02 import
Igor Sysoev <igor@sysoev.ru>
parents:
419
diff
changeset
|
110 |
1136 | 111 typedef enum { |
112 ngx_imap_start = 0, | |
1323 | 113 ngx_imap_auth_login_username, |
114 ngx_imap_auth_login_password, | |
115 ngx_imap_auth_plain, | |
116 ngx_imap_auth_cram_md5, | |
1136 | 117 ngx_imap_login, |
118 ngx_imap_user, | |
119 ngx_imap_passwd | |
120 } ngx_imap_state_e; | |
121 | |
122 | |
123 typedef enum { | |
124 ngx_smtp_start = 0, | |
125 ngx_smtp_auth_login_username, | |
126 ngx_smtp_auth_login_password, | |
127 ngx_smtp_auth_plain, | |
128 ngx_smtp_auth_cram_md5, | |
129 ngx_smtp_helo, | |
130 ngx_smtp_noxclient, | |
131 ngx_smtp_xclient | |
132 } ngx_smtp_state_e; | |
133 | |
134 | |
418
cf072d26d6d6
nginx-0.0.10-2004-09-08-09:18:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
135 typedef struct { |
521 | 136 ngx_peer_connection_t upstream; |
137 ngx_buf_t *buffer; | |
1136 | 138 } ngx_mail_proxy_ctx_t; |
521 | 139 |
140 | |
141 typedef struct { | |
1136 | 142 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
|
143 |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
144 ngx_connection_t *connection; |
521 | 145 |
539 | 146 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
|
147 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
|
148 |
521 | 149 void **ctx; |
150 void **main_conf; | |
151 void **srv_conf; | |
152 | |
1892
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
153 ngx_resolver_ctx_t *resolver_ctx; |
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
154 |
1136 | 155 ngx_mail_proxy_ctx_t *proxy; |
521 | 156 |
1136 | 157 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
|
158 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
159 unsigned protocol:3; |
539 | 160 unsigned blocked:1; |
161 unsigned quit:1; | |
527 | 162 unsigned quoted:1; |
543 | 163 unsigned backslash:1; |
164 unsigned no_sync_literal:1; | |
641 | 165 unsigned starttls:1; |
1136 | 166 unsigned esmtp:1; |
809 | 167 unsigned auth_method:2; |
883 | 168 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
|
169 |
422
edaefb2a20fc
nginx-0.0.10-2004-09-12-00:22:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
421
diff
changeset
|
170 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
|
171 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
|
172 |
800 | 173 ngx_str_t salt; |
527 | 174 ngx_str_t tag; |
539 | 175 ngx_str_t tagged_line; |
1476
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
176 ngx_str_t text; |
527 | 177 |
641 | 178 ngx_str_t *addr_text; |
1892
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
179 ngx_str_t host; |
1136 | 180 ngx_str_t smtp_helo; |
641 | 181 |
419
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
182 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
|
183 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
|
184 |
527 | 185 ngx_uint_t login_attempt; |
186 | |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
187 /* 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
|
188 |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
189 ngx_uint_t state; |
527 | 190 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
|
191 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
|
192 u_char *arg_end; |
527 | 193 ngx_uint_t literal_len; |
1136 | 194 } 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
|
195 |
cf072d26d6d6
nginx-0.0.10-2004-09-08-09:18:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
196 |
541 | 197 typedef struct { |
583 | 198 ngx_str_t *client; |
1136 | 199 ngx_mail_session_t *session; |
200 } ngx_mail_log_ctx_t; | |
541 | 201 |
202 | |
1323 | 203 #define NGX_POP3_USER 1 |
204 #define NGX_POP3_PASS 2 | |
205 #define NGX_POP3_CAPA 3 | |
206 #define NGX_POP3_QUIT 4 | |
207 #define NGX_POP3_NOOP 5 | |
208 #define NGX_POP3_STLS 6 | |
209 #define NGX_POP3_APOP 7 | |
210 #define NGX_POP3_AUTH 8 | |
211 #define NGX_POP3_STAT 9 | |
212 #define NGX_POP3_LIST 10 | |
213 #define NGX_POP3_RETR 11 | |
214 #define NGX_POP3_DELE 12 | |
215 #define NGX_POP3_RSET 13 | |
216 #define NGX_POP3_TOP 14 | |
217 #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
|
218 |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
219 |
1323 | 220 #define NGX_IMAP_LOGIN 1 |
221 #define NGX_IMAP_LOGOUT 2 | |
222 #define NGX_IMAP_CAPABILITY 3 | |
223 #define NGX_IMAP_NOOP 4 | |
224 #define NGX_IMAP_STARTTLS 5 | |
800 | 225 |
1323 | 226 #define NGX_IMAP_NEXT 6 |
227 | |
228 #define NGX_IMAP_AUTHENTICATE 7 | |
527 | 229 |
800 | 230 |
1323 | 231 #define NGX_SMTP_HELO 1 |
232 #define NGX_SMTP_EHLO 2 | |
233 #define NGX_SMTP_AUTH 3 | |
234 #define NGX_SMTP_QUIT 4 | |
235 #define NGX_SMTP_NOOP 5 | |
236 #define NGX_SMTP_MAIL 6 | |
237 #define NGX_SMTP_RSET 7 | |
238 #define NGX_SMTP_RCPT 8 | |
239 #define NGX_SMTP_DATA 9 | |
240 #define NGX_SMTP_VRFY 10 | |
241 #define NGX_SMTP_EXPN 11 | |
242 #define NGX_SMTP_HELP 12 | |
243 #define NGX_SMTP_STARTTLS 13 | |
527 | 244 |
245 | |
1136 | 246 #define NGX_MAIL_AUTH_PLAIN 0 |
247 #define NGX_MAIL_AUTH_LOGIN 1 | |
248 #define NGX_MAIL_AUTH_APOP 2 | |
249 #define NGX_MAIL_AUTH_CRAM_MD5 3 | |
419
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
250 |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
251 |
1136 | 252 #define NGX_MAIL_AUTH_PLAIN_ENABLED 0x0002 |
253 #define NGX_MAIL_AUTH_LOGIN_ENABLED 0x0004 | |
254 #define NGX_MAIL_AUTH_APOP_ENABLED 0x0008 | |
255 #define NGX_MAIL_AUTH_CRAM_MD5_ENABLED 0x0010 | |
521 | 256 |
257 | |
1136 | 258 #define NGX_MAIL_PARSE_INVALID_COMMAND 20 |
521 | 259 |
260 | |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
261 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
|
262 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
|
263 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
|
264 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
|
265 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
|
266 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
267 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
268 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
|
269 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
|
270 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
|
271 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
|
272 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
273 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
|
274 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
|
275 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
|
276 ngx_mail_auth_state_pt auth_state; |
1136 | 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 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
|
279 }; |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
280 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
281 |
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 struct { |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
283 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
|
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 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
|
286 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
|
287 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
288 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
|
289 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
|
290 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
|
291 } 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
|
292 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
293 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
294 #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
|
295 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
296 #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
|
297 #define NGX_MAIL_SRV_CONF 0x04000000 |
1136 | 298 |
299 | |
300 #define NGX_MAIL_MAIN_CONF_OFFSET offsetof(ngx_mail_conf_ctx_t, main_conf) | |
301 #define NGX_MAIL_SRV_CONF_OFFSET offsetof(ngx_mail_conf_ctx_t, srv_conf) | |
302 | |
303 | |
304 #define ngx_mail_get_module_ctx(s, module) (s)->ctx[module.ctx_index] | |
305 #define ngx_mail_set_ctx(s, c, module) s->ctx[module.ctx_index] = c; | |
306 #define ngx_mail_delete_ctx(s, module) s->ctx[module.ctx_index] = NULL; | |
521 | 307 |
308 | |
1136 | 309 #define ngx_mail_get_module_main_conf(s, module) \ |
521 | 310 (s)->main_conf[module.ctx_index] |
1136 | 311 #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
|
312 |
1136 | 313 #define ngx_mail_conf_get_module_main_conf(cf, module) \ |
314 ((ngx_mail_conf_ctx_t *) cf->ctx)->main_conf[module.ctx_index] | |
1322 | 315 #define ngx_mail_conf_get_module_srv_conf(cf, module) \ |
316 ((ngx_mail_conf_ctx_t *) cf->ctx)->srv_conf[module.ctx_index] | |
641 | 317 |
1476
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
318 |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
319 #if (NGX_MAIL_SSL) |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
320 void ngx_mail_starttls_handler(ngx_event_t *rev); |
1479 | 321 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
|
322 #endif |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
323 |
423
fda5987b188d
nginx-0.0.10-2004-09-13-20:18:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
422
diff
changeset
|
324 |
1136 | 325 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
|
326 |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
327 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
|
328 ngx_mail_core_srv_conf_t *cscf); |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
329 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
|
330 ngx_uint_t n); |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
331 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
|
332 ngx_connection_t *c); |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
333 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
|
334 ngx_connection_t *c); |
1479 | 335 ngx_int_t ngx_mail_auth_cram_md5_salt(ngx_mail_session_t *s, |
336 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
|
337 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
|
338 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
|
339 |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
340 void ngx_mail_send(ngx_event_t *wev); |
1482 | 341 ngx_int_t ngx_mail_read_command(ngx_mail_session_t *s, ngx_connection_t *c); |
342 void ngx_mail_auth(ngx_mail_session_t *s, ngx_connection_t *c); | |
1136 | 343 void ngx_mail_close_connection(ngx_connection_t *c); |
344 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
|
345 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
|
346 |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
347 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
348 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
|
349 |
417
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
350 |
521 | 351 /* STUB */ |
1136 | 352 void ngx_mail_proxy_init(ngx_mail_session_t *s, ngx_peer_addr_t *peer); |
353 void ngx_mail_auth_http_init(ngx_mail_session_t *s); | |
521 | 354 /**/ |
355 | |
356 | |
1136 | 357 extern ngx_uint_t ngx_mail_max_module; |
358 extern ngx_module_t ngx_mail_core_module; | |
521 | 359 |
360 | |
1136 | 361 #endif /* _NGX_MAIL_H_INCLUDED_ */ |