Mercurial > hg > nginx
annotate src/mail/ngx_mail.h @ 1723:9b047c9e96c1 stable-0.5
r1587, r1588, r1589, r1590, r1592, r1599, r1629, r1636, r1674, r1681,
r1682, r1683 merge:
typo and style fixes
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 12 Dec 2007 20:49:45 +0000 |
parents | ed9cd1702f7a |
children |
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 |
1621
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
76 |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
77 typedef struct ngx_mail_protocol_s ngx_mail_protocol_t; |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
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 |
1621
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
80 typedef struct { |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
81 ngx_mail_protocol_t *protocol; |
521 | 82 |
1621
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
83 ngx_msec_t timeout; |
521 | 84 |
587 | 85 ngx_flag_t so_keepalive; |
86 | |
1621
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
87 ngx_str_t server_name; |
527 | 88 |
1621
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
89 u_char *file_name; |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
90 ngx_int_t line; |
527 | 91 |
521 | 92 /* server ctx */ |
1136 | 93 ngx_mail_conf_ctx_t *ctx; |
94 } ngx_mail_core_srv_conf_t; | |
521 | 95 |
96 | |
527 | 97 typedef enum { |
421
01456a419cf9
nginx-0.0.10-2004-09-10-18:32:02 import
Igor Sysoev <igor@sysoev.ru>
parents:
419
diff
changeset
|
98 ngx_pop3_start = 0, |
527 | 99 ngx_pop3_user, |
809 | 100 ngx_pop3_passwd, |
101 ngx_pop3_auth_login_username, | |
102 ngx_pop3_auth_login_password, | |
103 ngx_pop3_auth_plain, | |
104 ngx_pop3_auth_cram_md5 | |
1723
9b047c9e96c1
r1587, r1588, r1589, r1590, r1592, r1599, r1629, r1636, r1674, r1681,
Igor Sysoev <igor@sysoev.ru>
parents:
1621
diff
changeset
|
105 } 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
|
106 |
01456a419cf9
nginx-0.0.10-2004-09-10-18:32:02 import
Igor Sysoev <igor@sysoev.ru>
parents:
419
diff
changeset
|
107 |
1136 | 108 typedef enum { |
109 ngx_imap_start = 0, | |
1502 | 110 ngx_imap_auth_login_username, |
111 ngx_imap_auth_login_password, | |
112 ngx_imap_auth_plain, | |
113 ngx_imap_auth_cram_md5, | |
1136 | 114 ngx_imap_login, |
115 ngx_imap_user, | |
116 ngx_imap_passwd | |
117 } ngx_imap_state_e; | |
118 | |
119 | |
120 typedef enum { | |
121 ngx_smtp_start = 0, | |
122 ngx_smtp_auth_login_username, | |
123 ngx_smtp_auth_login_password, | |
124 ngx_smtp_auth_plain, | |
125 ngx_smtp_auth_cram_md5, | |
126 ngx_smtp_helo, | |
127 ngx_smtp_noxclient, | |
128 ngx_smtp_xclient | |
129 } ngx_smtp_state_e; | |
130 | |
131 | |
418
cf072d26d6d6
nginx-0.0.10-2004-09-08-09:18:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
132 typedef struct { |
521 | 133 ngx_peer_connection_t upstream; |
134 ngx_buf_t *buffer; | |
1136 | 135 } ngx_mail_proxy_ctx_t; |
521 | 136 |
137 | |
138 typedef struct { | |
1136 | 139 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
|
140 |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
141 ngx_connection_t *connection; |
521 | 142 |
539 | 143 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
|
144 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
|
145 |
521 | 146 void **ctx; |
147 void **main_conf; | |
148 void **srv_conf; | |
149 | |
1136 | 150 ngx_mail_proxy_ctx_t *proxy; |
521 | 151 |
1136 | 152 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
|
153 |
1621
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
154 unsigned protocol:3; |
539 | 155 unsigned blocked:1; |
156 unsigned quit:1; | |
527 | 157 unsigned quoted:1; |
543 | 158 unsigned backslash:1; |
159 unsigned no_sync_literal:1; | |
641 | 160 unsigned starttls:1; |
1136 | 161 unsigned esmtp:1; |
809 | 162 unsigned auth_method:2; |
883 | 163 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
|
164 |
422
edaefb2a20fc
nginx-0.0.10-2004-09-12-00:22:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
421
diff
changeset
|
165 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
|
166 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
|
167 |
800 | 168 ngx_str_t salt; |
527 | 169 ngx_str_t tag; |
539 | 170 ngx_str_t tagged_line; |
1621
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
171 ngx_str_t text; |
527 | 172 |
641 | 173 ngx_str_t *addr_text; |
1136 | 174 ngx_str_t smtp_helo; |
641 | 175 |
419
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
176 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
|
177 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
|
178 |
527 | 179 ngx_uint_t login_attempt; |
180 | |
1621
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
181 /* 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
|
182 |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
183 ngx_uint_t state; |
527 | 184 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
|
185 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
|
186 u_char *arg_end; |
527 | 187 ngx_uint_t literal_len; |
1136 | 188 } 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
|
189 |
cf072d26d6d6
nginx-0.0.10-2004-09-08-09:18:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
190 |
541 | 191 typedef struct { |
583 | 192 ngx_str_t *client; |
1136 | 193 ngx_mail_session_t *session; |
194 } ngx_mail_log_ctx_t; | |
541 | 195 |
196 | |
1502 | 197 #define NGX_POP3_USER 1 |
198 #define NGX_POP3_PASS 2 | |
199 #define NGX_POP3_CAPA 3 | |
200 #define NGX_POP3_QUIT 4 | |
201 #define NGX_POP3_NOOP 5 | |
202 #define NGX_POP3_STLS 6 | |
203 #define NGX_POP3_APOP 7 | |
204 #define NGX_POP3_AUTH 8 | |
205 #define NGX_POP3_STAT 9 | |
206 #define NGX_POP3_LIST 10 | |
207 #define NGX_POP3_RETR 11 | |
208 #define NGX_POP3_DELE 12 | |
209 #define NGX_POP3_RSET 13 | |
210 #define NGX_POP3_TOP 14 | |
211 #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
|
212 |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
213 |
1502 | 214 #define NGX_IMAP_LOGIN 1 |
215 #define NGX_IMAP_LOGOUT 2 | |
216 #define NGX_IMAP_CAPABILITY 3 | |
217 #define NGX_IMAP_NOOP 4 | |
218 #define NGX_IMAP_STARTTLS 5 | |
800 | 219 |
1502 | 220 #define NGX_IMAP_NEXT 6 |
221 | |
222 #define NGX_IMAP_AUTHENTICATE 7 | |
527 | 223 |
800 | 224 |
1502 | 225 #define NGX_SMTP_HELO 1 |
226 #define NGX_SMTP_EHLO 2 | |
227 #define NGX_SMTP_AUTH 3 | |
228 #define NGX_SMTP_QUIT 4 | |
229 #define NGX_SMTP_NOOP 5 | |
230 #define NGX_SMTP_MAIL 6 | |
231 #define NGX_SMTP_RSET 7 | |
232 #define NGX_SMTP_RCPT 8 | |
233 #define NGX_SMTP_DATA 9 | |
234 #define NGX_SMTP_VRFY 10 | |
235 #define NGX_SMTP_EXPN 11 | |
236 #define NGX_SMTP_HELP 12 | |
237 #define NGX_SMTP_STARTTLS 13 | |
527 | 238 |
239 | |
1136 | 240 #define NGX_MAIL_AUTH_PLAIN 0 |
241 #define NGX_MAIL_AUTH_LOGIN 1 | |
242 #define NGX_MAIL_AUTH_APOP 2 | |
243 #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
|
244 |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
245 |
1136 | 246 #define NGX_MAIL_AUTH_PLAIN_ENABLED 0x0002 |
247 #define NGX_MAIL_AUTH_LOGIN_ENABLED 0x0004 | |
248 #define NGX_MAIL_AUTH_APOP_ENABLED 0x0008 | |
249 #define NGX_MAIL_AUTH_CRAM_MD5_ENABLED 0x0010 | |
521 | 250 |
251 | |
1136 | 252 #define NGX_MAIL_PARSE_INVALID_COMMAND 20 |
521 | 253 |
254 | |
1621
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
255 typedef void (*ngx_mail_init_session_pt)(ngx_mail_session_t *s, |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
256 ngx_connection_t *c); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
257 typedef void (*ngx_mail_init_protocol_pt)(ngx_event_t *rev); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
258 typedef void (*ngx_mail_auth_state_pt)(ngx_event_t *rev); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
259 typedef ngx_int_t (*ngx_mail_parse_command_pt)(ngx_mail_session_t *s); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
260 |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
261 |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
262 struct ngx_mail_protocol_s { |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
263 ngx_str_t name; |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
264 in_port_t port[4]; |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
265 ngx_uint_t type; |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
266 |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
267 ngx_mail_init_session_pt init_session; |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
268 ngx_mail_init_protocol_pt init_protocol; |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
269 ngx_mail_parse_command_pt parse_command; |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
270 ngx_mail_auth_state_pt auth_state; |
1136 | 271 |
1621
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
272 ngx_str_t internal_server_error; |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
273 }; |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
274 |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
275 |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
276 typedef struct { |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
277 ngx_mail_protocol_t *protocol; |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
278 |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
279 void *(*create_main_conf)(ngx_conf_t *cf); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
280 char *(*init_main_conf)(ngx_conf_t *cf, void *conf); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
281 |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
282 void *(*create_srv_conf)(ngx_conf_t *cf); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
283 char *(*merge_srv_conf)(ngx_conf_t *cf, void *prev, |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
284 void *conf); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
285 } ngx_mail_module_t; |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
286 |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
287 |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
288 #define NGX_MAIL_MODULE 0x4C49414D /* "MAIL" */ |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
289 |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
290 #define NGX_MAIL_MAIN_CONF 0x02000000 |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
291 #define NGX_MAIL_SRV_CONF 0x04000000 |
1136 | 292 |
293 | |
294 #define NGX_MAIL_MAIN_CONF_OFFSET offsetof(ngx_mail_conf_ctx_t, main_conf) | |
295 #define NGX_MAIL_SRV_CONF_OFFSET offsetof(ngx_mail_conf_ctx_t, srv_conf) | |
296 | |
297 | |
298 #define ngx_mail_get_module_ctx(s, module) (s)->ctx[module.ctx_index] | |
299 #define ngx_mail_set_ctx(s, c, module) s->ctx[module.ctx_index] = c; | |
300 #define ngx_mail_delete_ctx(s, module) s->ctx[module.ctx_index] = NULL; | |
521 | 301 |
302 | |
1136 | 303 #define ngx_mail_get_module_main_conf(s, module) \ |
521 | 304 (s)->main_conf[module.ctx_index] |
1136 | 305 #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
|
306 |
1136 | 307 #define ngx_mail_conf_get_module_main_conf(cf, module) \ |
308 ((ngx_mail_conf_ctx_t *) cf->ctx)->main_conf[module.ctx_index] | |
1501 | 309 #define ngx_mail_conf_get_module_srv_conf(cf, module) \ |
310 ((ngx_mail_conf_ctx_t *) cf->ctx)->srv_conf[module.ctx_index] | |
641 | 311 |
423
fda5987b188d
nginx-0.0.10-2004-09-13-20:18:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
422
diff
changeset
|
312 |
1621
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
313 #if (NGX_MAIL_SSL) |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
314 void ngx_mail_starttls_handler(ngx_event_t *rev); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
315 ngx_int_t ngx_mail_starttls_only(ngx_mail_session_t *s, ngx_connection_t *c); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
316 #endif |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
317 |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
318 |
1136 | 319 void ngx_mail_init_connection(ngx_connection_t *c); |
1621
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
320 |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
321 ngx_int_t ngx_mail_salt(ngx_mail_session_t *s, ngx_connection_t *c, |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
322 ngx_mail_core_srv_conf_t *cscf); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
323 ngx_int_t ngx_mail_auth_plain(ngx_mail_session_t *s, ngx_connection_t *c, |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
324 ngx_uint_t n); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
325 ngx_int_t ngx_mail_auth_login_username(ngx_mail_session_t *s, |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
326 ngx_connection_t *c); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
327 ngx_int_t ngx_mail_auth_login_password(ngx_mail_session_t *s, |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
328 ngx_connection_t *c); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
329 ngx_int_t ngx_mail_auth_cram_md5_salt(ngx_mail_session_t *s, |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
330 ngx_connection_t *c, char *prefix, size_t len); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
331 ngx_int_t ngx_mail_auth_cram_md5(ngx_mail_session_t *s, ngx_connection_t *c); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
332 ngx_int_t ngx_mail_auth_parse(ngx_mail_session_t *s, ngx_connection_t *c); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
333 |
1136 | 334 void ngx_mail_send(ngx_event_t *wev); |
1621
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
335 ngx_int_t ngx_mail_read_command(ngx_mail_session_t *s, ngx_connection_t *c); |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
336 void ngx_mail_auth(ngx_mail_session_t *s, ngx_connection_t *c); |
1136 | 337 void ngx_mail_close_connection(ngx_connection_t *c); |
338 void ngx_mail_session_internal_server_error(ngx_mail_session_t *s); | |
1621
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
339 u_char *ngx_mail_log_error(ngx_log_t *log, u_char *buf, size_t len); |
417
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
340 |
1621
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
341 |
ed9cd1702f7a
r1477, r1478, r1479, r1480, r1481, r1482, r1483, r1484, r1485, r1486,
Igor Sysoev <igor@sysoev.ru>
parents:
1502
diff
changeset
|
342 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
|
343 |
417
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
344 |
521 | 345 /* STUB */ |
1136 | 346 void ngx_mail_proxy_init(ngx_mail_session_t *s, ngx_peer_addr_t *peer); |
347 void ngx_mail_auth_http_init(ngx_mail_session_t *s); | |
521 | 348 /**/ |
349 | |
350 | |
1136 | 351 extern ngx_uint_t ngx_mail_max_module; |
352 extern ngx_module_t ngx_mail_core_module; | |
521 | 353 |
354 | |
1136 | 355 #endif /* _NGX_MAIL_H_INCLUDED_ */ |