Mercurial > hg > nginx-quic
annotate src/mail/ngx_mail.h @ 6698:e8d4c9e9682a
Removed influence of some options on structures.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Tue, 20 Sep 2016 12:30:52 +0300 |
parents | 3d5202c71f94 |
children | cebf5fed00bf |
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 |
4412 | 4 * Copyright (C) Nginx, Inc. |
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
|
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 |
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
|
7 |
1136 | 8 #ifndef _NGX_MAIL_H_INCLUDED_ |
9 #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
|
10 |
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 |
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
12 #include <ngx_config.h> |
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
13 #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
|
14 #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
|
15 #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
|
16 |
1136 | 17 #if (NGX_MAIL_SSL) |
18 #include <ngx_mail_ssl_module.h> | |
539 | 19 #endif |
20 | |
21 | |
417
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
22 |
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
23 typedef struct { |
583 | 24 void **main_conf; |
25 void **srv_conf; | |
1136 | 26 } ngx_mail_conf_ctx_t; |
521 | 27 |
28 | |
29 typedef struct { | |
6560
c90cf79d0e1d
Renamed "u" to "sockaddr" in listen options types.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6559
diff
changeset
|
30 ngx_sockaddr_t sockaddr; |
2855
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
31 socklen_t socklen; |
641 | 32 |
33 /* server ctx */ | |
1136 | 34 ngx_mail_conf_ctx_t *ctx; |
641 | 35 |
36 unsigned bind:1; | |
2855
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
37 unsigned wildcard:1; |
2224 | 38 #if (NGX_MAIL_SSL) |
39 unsigned ssl:1; | |
40 #endif | |
2855
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
41 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY) |
4771
bdcdbdf35b52
Core: ipv6only is now on by default.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
42 unsigned ipv6only:1; |
2855
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
43 #endif |
4323
c4513d4dd024
Added the "so_keepalive=" parameter to the "listen" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
3269
diff
changeset
|
44 unsigned so_keepalive:2; |
c4513d4dd024
Added the "so_keepalive=" parameter to the "listen" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
3269
diff
changeset
|
45 #if (NGX_HAVE_KEEPALIVE_TUNABLE) |
c4513d4dd024
Added the "so_keepalive=" parameter to the "listen" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
3269
diff
changeset
|
46 int tcp_keepidle; |
c4513d4dd024
Added the "so_keepalive=" parameter to the "listen" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
3269
diff
changeset
|
47 int tcp_keepintvl; |
c4513d4dd024
Added the "so_keepalive=" parameter to the "listen" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
3269
diff
changeset
|
48 int tcp_keepcnt; |
c4513d4dd024
Added the "so_keepalive=" parameter to the "listen" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
3269
diff
changeset
|
49 #endif |
6173 | 50 int backlog; |
1136 | 51 } ngx_mail_listen_t; |
641 | 52 |
53 | |
54 typedef struct { | |
1136 | 55 ngx_mail_conf_ctx_t *ctx; |
641 | 56 ngx_str_t addr_text; |
2224 | 57 #if (NGX_MAIL_SSL) |
58 ngx_uint_t ssl; /* unsigned ssl:1; */ | |
59 #endif | |
2855
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
60 } ngx_mail_addr_conf_t; |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
61 |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
62 typedef struct { |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
63 in_addr_t addr; |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
64 ngx_mail_addr_conf_t conf; |
1136 | 65 } ngx_mail_in_addr_t; |
641 | 66 |
67 | |
2855
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
68 #if (NGX_HAVE_INET6) |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
69 |
641 | 70 typedef struct { |
2855
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
71 struct in6_addr addr6; |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
72 ngx_mail_addr_conf_t conf; |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
73 } ngx_mail_in6_addr_t; |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
74 |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
75 #endif |
641 | 76 |
77 | |
78 typedef struct { | |
2855
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
79 /* ngx_mail_in_addr_t or ngx_mail_in6_addr_t */ |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
80 void *addrs; |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
81 ngx_uint_t naddrs; |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
82 } ngx_mail_port_t; |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
83 |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
84 |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
85 typedef struct { |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
86 int family; |
641 | 87 in_port_t port; |
2855
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
88 ngx_array_t addrs; /* array of ngx_mail_conf_addr_t */ |
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
89 } ngx_mail_conf_port_t; |
641 | 90 |
91 | |
92 typedef struct { | |
6171
f61049c80458
Mail: embed ngx_mail_listen_t into ngx_mail_conf_addr_t.
Ruslan Ermilov <ru@nginx.com>
parents:
6141
diff
changeset
|
93 ngx_mail_listen_t opt; |
2855
a96a8c916b0c
mail proxy listen IPv6 support
Igor Sysoev <igor@sysoev.ru>
parents:
2497
diff
changeset
|
94 } ngx_mail_conf_addr_t; |
641 | 95 |
96 | |
97 typedef struct { | |
1136 | 98 ngx_array_t servers; /* ngx_mail_core_srv_conf_t */ |
99 ngx_array_t listen; /* ngx_mail_listen_t */ | |
100 } ngx_mail_core_main_conf_t; | |
521 | 101 |
102 | |
1136 | 103 #define NGX_MAIL_POP3_PROTOCOL 0 |
104 #define NGX_MAIL_IMAP_PROTOCOL 1 | |
105 #define NGX_MAIL_SMTP_PROTOCOL 2 | |
521 | 106 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
107 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
108 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
|
109 |
418
cf072d26d6d6
nginx-0.0.10-2004-09-08-09:18:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
110 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
111 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
|
112 ngx_mail_protocol_t *protocol; |
521 | 113 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
114 ngx_msec_t timeout; |
1892
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
115 ngx_msec_t resolver_timeout; |
521 | 116 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
117 ngx_str_t server_name; |
527 | 118 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
119 u_char *file_name; |
6656
a2f57dfa65a9
Fixed wrong type of the "line" field.
Roman Arutyunyan <arut@nginx.com>
parents:
6560
diff
changeset
|
120 ngx_uint_t line; |
527 | 121 |
1892
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
122 ngx_resolver_t *resolver; |
6130 | 123 ngx_log_t *error_log; |
1892
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
124 |
521 | 125 /* server ctx */ |
1136 | 126 ngx_mail_conf_ctx_t *ctx; |
6657
3d5202c71f94
Ensure "listen" exists in a mail or stream server (ticket #1049).
Roman Arutyunyan <arut@nginx.com>
parents:
6656
diff
changeset
|
127 |
3d5202c71f94
Ensure "listen" exists in a mail or stream server (ticket #1049).
Roman Arutyunyan <arut@nginx.com>
parents:
6656
diff
changeset
|
128 ngx_uint_t listen; /* unsigned listen:1; */ |
1136 | 129 } ngx_mail_core_srv_conf_t; |
521 | 130 |
131 | |
527 | 132 typedef enum { |
421
01456a419cf9
nginx-0.0.10-2004-09-10-18:32:02 import
Igor Sysoev <igor@sysoev.ru>
parents:
419
diff
changeset
|
133 ngx_pop3_start = 0, |
527 | 134 ngx_pop3_user, |
809 | 135 ngx_pop3_passwd, |
136 ngx_pop3_auth_login_username, | |
137 ngx_pop3_auth_login_password, | |
138 ngx_pop3_auth_plain, | |
139 ngx_pop3_auth_cram_md5 | |
1673 | 140 } 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
|
141 |
01456a419cf9
nginx-0.0.10-2004-09-10-18:32:02 import
Igor Sysoev <igor@sysoev.ru>
parents:
419
diff
changeset
|
142 |
1136 | 143 typedef enum { |
144 ngx_imap_start = 0, | |
1323 | 145 ngx_imap_auth_login_username, |
146 ngx_imap_auth_login_password, | |
147 ngx_imap_auth_plain, | |
148 ngx_imap_auth_cram_md5, | |
1136 | 149 ngx_imap_login, |
150 ngx_imap_user, | |
151 ngx_imap_passwd | |
152 } ngx_imap_state_e; | |
153 | |
154 | |
155 typedef enum { | |
156 ngx_smtp_start = 0, | |
157 ngx_smtp_auth_login_username, | |
158 ngx_smtp_auth_login_password, | |
159 ngx_smtp_auth_plain, | |
160 ngx_smtp_auth_cram_md5, | |
161 ngx_smtp_helo, | |
2309 | 162 ngx_smtp_helo_xclient, |
163 ngx_smtp_helo_from, | |
164 ngx_smtp_xclient, | |
165 ngx_smtp_xclient_from, | |
2497 | 166 ngx_smtp_xclient_helo, |
2309 | 167 ngx_smtp_from, |
168 ngx_smtp_to | |
1136 | 169 } ngx_smtp_state_e; |
170 | |
171 | |
418
cf072d26d6d6
nginx-0.0.10-2004-09-08-09:18:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
172 typedef struct { |
521 | 173 ngx_peer_connection_t upstream; |
174 ngx_buf_t *buffer; | |
1136 | 175 } ngx_mail_proxy_ctx_t; |
521 | 176 |
177 | |
178 typedef struct { | |
1136 | 179 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
|
180 |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
181 ngx_connection_t *connection; |
521 | 182 |
539 | 183 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
|
184 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
|
185 |
521 | 186 void **ctx; |
187 void **main_conf; | |
188 void **srv_conf; | |
189 | |
1892
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
190 ngx_resolver_ctx_t *resolver_ctx; |
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
191 |
1136 | 192 ngx_mail_proxy_ctx_t *proxy; |
521 | 193 |
1136 | 194 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
|
195 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
196 unsigned protocol:3; |
539 | 197 unsigned blocked:1; |
198 unsigned quit:1; | |
527 | 199 unsigned quoted:1; |
543 | 200 unsigned backslash:1; |
201 unsigned no_sync_literal:1; | |
641 | 202 unsigned starttls:1; |
1136 | 203 unsigned esmtp:1; |
2309 | 204 unsigned auth_method:3; |
883 | 205 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
|
206 |
422
edaefb2a20fc
nginx-0.0.10-2004-09-12-00:22:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
421
diff
changeset
|
207 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
|
208 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
|
209 |
800 | 210 ngx_str_t salt; |
527 | 211 ngx_str_t tag; |
539 | 212 ngx_str_t tagged_line; |
1476
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
213 ngx_str_t text; |
527 | 214 |
641 | 215 ngx_str_t *addr_text; |
1892
057d362ee50e
resolver in smtp proxy module
Igor Sysoev <igor@sysoev.ru>
parents:
1673
diff
changeset
|
216 ngx_str_t host; |
1136 | 217 ngx_str_t smtp_helo; |
2309 | 218 ngx_str_t smtp_from; |
219 ngx_str_t smtp_to; | |
641 | 220 |
5398
04e43d03e153
Mail: smtp pipelining support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4771
diff
changeset
|
221 ngx_str_t cmd; |
04e43d03e153
Mail: smtp pipelining support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4771
diff
changeset
|
222 |
419
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
223 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
|
224 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
|
225 |
527 | 226 ngx_uint_t login_attempt; |
227 | |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
228 /* 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
|
229 |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
230 ngx_uint_t state; |
527 | 231 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
|
232 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
|
233 u_char *arg_end; |
527 | 234 ngx_uint_t literal_len; |
1136 | 235 } 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
|
236 |
cf072d26d6d6
nginx-0.0.10-2004-09-08-09:18:51 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
237 |
541 | 238 typedef struct { |
583 | 239 ngx_str_t *client; |
1136 | 240 ngx_mail_session_t *session; |
241 } ngx_mail_log_ctx_t; | |
541 | 242 |
243 | |
1323 | 244 #define NGX_POP3_USER 1 |
245 #define NGX_POP3_PASS 2 | |
246 #define NGX_POP3_CAPA 3 | |
247 #define NGX_POP3_QUIT 4 | |
248 #define NGX_POP3_NOOP 5 | |
249 #define NGX_POP3_STLS 6 | |
250 #define NGX_POP3_APOP 7 | |
251 #define NGX_POP3_AUTH 8 | |
252 #define NGX_POP3_STAT 9 | |
253 #define NGX_POP3_LIST 10 | |
254 #define NGX_POP3_RETR 11 | |
255 #define NGX_POP3_DELE 12 | |
256 #define NGX_POP3_RSET 13 | |
257 #define NGX_POP3_TOP 14 | |
258 #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
|
259 |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
260 |
1323 | 261 #define NGX_IMAP_LOGIN 1 |
262 #define NGX_IMAP_LOGOUT 2 | |
263 #define NGX_IMAP_CAPABILITY 3 | |
264 #define NGX_IMAP_NOOP 4 | |
265 #define NGX_IMAP_STARTTLS 5 | |
800 | 266 |
1323 | 267 #define NGX_IMAP_NEXT 6 |
268 | |
269 #define NGX_IMAP_AUTHENTICATE 7 | |
527 | 270 |
800 | 271 |
1323 | 272 #define NGX_SMTP_HELO 1 |
273 #define NGX_SMTP_EHLO 2 | |
274 #define NGX_SMTP_AUTH 3 | |
275 #define NGX_SMTP_QUIT 4 | |
276 #define NGX_SMTP_NOOP 5 | |
277 #define NGX_SMTP_MAIL 6 | |
278 #define NGX_SMTP_RSET 7 | |
279 #define NGX_SMTP_RCPT 8 | |
280 #define NGX_SMTP_DATA 9 | |
281 #define NGX_SMTP_VRFY 10 | |
282 #define NGX_SMTP_EXPN 11 | |
283 #define NGX_SMTP_HELP 12 | |
284 #define NGX_SMTP_STARTTLS 13 | |
527 | 285 |
286 | |
2495
a59b26eee816
compatibility with Microsoft's
Igor Sysoev <igor@sysoev.ru>
parents:
2309
diff
changeset
|
287 #define NGX_MAIL_AUTH_PLAIN 0 |
a59b26eee816
compatibility with Microsoft's
Igor Sysoev <igor@sysoev.ru>
parents:
2309
diff
changeset
|
288 #define NGX_MAIL_AUTH_LOGIN 1 |
a59b26eee816
compatibility with Microsoft's
Igor Sysoev <igor@sysoev.ru>
parents:
2309
diff
changeset
|
289 #define NGX_MAIL_AUTH_LOGIN_USERNAME 2 |
a59b26eee816
compatibility with Microsoft's
Igor Sysoev <igor@sysoev.ru>
parents:
2309
diff
changeset
|
290 #define NGX_MAIL_AUTH_APOP 3 |
a59b26eee816
compatibility with Microsoft's
Igor Sysoev <igor@sysoev.ru>
parents:
2309
diff
changeset
|
291 #define NGX_MAIL_AUTH_CRAM_MD5 4 |
a59b26eee816
compatibility with Microsoft's
Igor Sysoev <igor@sysoev.ru>
parents:
2309
diff
changeset
|
292 #define NGX_MAIL_AUTH_NONE 5 |
419
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
293 |
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
418
diff
changeset
|
294 |
1136 | 295 #define NGX_MAIL_AUTH_PLAIN_ENABLED 0x0002 |
296 #define NGX_MAIL_AUTH_LOGIN_ENABLED 0x0004 | |
297 #define NGX_MAIL_AUTH_APOP_ENABLED 0x0008 | |
298 #define NGX_MAIL_AUTH_CRAM_MD5_ENABLED 0x0010 | |
2309 | 299 #define NGX_MAIL_AUTH_NONE_ENABLED 0x0020 |
521 | 300 |
301 | |
1136 | 302 #define NGX_MAIL_PARSE_INVALID_COMMAND 20 |
521 | 303 |
304 | |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
305 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
|
306 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
|
307 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
|
308 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
|
309 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
|
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 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
312 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
|
313 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
|
314 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
|
315 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
|
316 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
317 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
|
318 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
|
319 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
|
320 ngx_mail_auth_state_pt auth_state; |
1136 | 321 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
322 ngx_str_t internal_server_error; |
5989
ec01b1d1fff1
Mail: client SSL certificates support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5398
diff
changeset
|
323 ngx_str_t cert_error; |
ec01b1d1fff1
Mail: client SSL certificates support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5398
diff
changeset
|
324 ngx_str_t no_cert; |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
325 }; |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
326 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
327 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
328 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
|
329 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
|
330 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
331 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
|
332 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
|
333 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
334 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
|
335 char *(*merge_srv_conf)(ngx_conf_t *cf, void *prev, |
6474 | 336 void *conf); |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
337 } 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
|
338 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
339 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
340 #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
|
341 |
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
342 #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
|
343 #define NGX_MAIL_SRV_CONF 0x04000000 |
1136 | 344 |
345 | |
346 #define NGX_MAIL_MAIN_CONF_OFFSET offsetof(ngx_mail_conf_ctx_t, main_conf) | |
347 #define NGX_MAIL_SRV_CONF_OFFSET offsetof(ngx_mail_conf_ctx_t, srv_conf) | |
348 | |
349 | |
350 #define ngx_mail_get_module_ctx(s, module) (s)->ctx[module.ctx_index] | |
351 #define ngx_mail_set_ctx(s, c, module) s->ctx[module.ctx_index] = c; | |
352 #define ngx_mail_delete_ctx(s, module) s->ctx[module.ctx_index] = NULL; | |
521 | 353 |
354 | |
1136 | 355 #define ngx_mail_get_module_main_conf(s, module) \ |
521 | 356 (s)->main_conf[module.ctx_index] |
1136 | 357 #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
|
358 |
1136 | 359 #define ngx_mail_conf_get_module_main_conf(cf, module) \ |
360 ((ngx_mail_conf_ctx_t *) cf->ctx)->main_conf[module.ctx_index] | |
1322 | 361 #define ngx_mail_conf_get_module_srv_conf(cf, module) \ |
362 ((ngx_mail_conf_ctx_t *) cf->ctx)->srv_conf[module.ctx_index] | |
641 | 363 |
1476
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
364 |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
365 #if (NGX_MAIL_SSL) |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
366 void ngx_mail_starttls_handler(ngx_event_t *rev); |
1479 | 367 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
|
368 #endif |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
369 |
423
fda5987b188d
nginx-0.0.10-2004-09-13-20:18:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
422
diff
changeset
|
370 |
1136 | 371 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
|
372 |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
373 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
|
374 ngx_mail_core_srv_conf_t *cscf); |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
375 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
|
376 ngx_uint_t n); |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
377 ngx_int_t ngx_mail_auth_login_username(ngx_mail_session_t *s, |
2495
a59b26eee816
compatibility with Microsoft's
Igor Sysoev <igor@sysoev.ru>
parents:
2309
diff
changeset
|
378 ngx_connection_t *c, ngx_uint_t n); |
1476
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
379 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
|
380 ngx_connection_t *c); |
1479 | 381 ngx_int_t ngx_mail_auth_cram_md5_salt(ngx_mail_session_t *s, |
382 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
|
383 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
|
384 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
|
385 |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
386 void ngx_mail_send(ngx_event_t *wev); |
1482 | 387 ngx_int_t ngx_mail_read_command(ngx_mail_session_t *s, ngx_connection_t *c); |
388 void ngx_mail_auth(ngx_mail_session_t *s, ngx_connection_t *c); | |
1136 | 389 void ngx_mail_close_connection(ngx_connection_t *c); |
390 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
|
391 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
|
392 |
67578e966dcc
split pop3, imap, and smtp handlers
Igor Sysoev <igor@sysoev.ru>
parents:
1323
diff
changeset
|
393 |
1487
f69493e8faab
ngx_mail_pop3_module, ngx_mail_imap_module, and ngx_mail_smtp_module
Igor Sysoev <igor@sysoev.ru>
parents:
1482
diff
changeset
|
394 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
|
395 |
417
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
396 |
521 | 397 /* STUB */ |
3269
f0d596e84634
rename ngx_peer_addr_t to ngx_addr_t
Igor Sysoev <igor@sysoev.ru>
parents:
2855
diff
changeset
|
398 void ngx_mail_proxy_init(ngx_mail_session_t *s, ngx_addr_t *peer); |
1136 | 399 void ngx_mail_auth_http_init(ngx_mail_session_t *s); |
521 | 400 /**/ |
401 | |
402 | |
1136 | 403 extern ngx_uint_t ngx_mail_max_module; |
404 extern ngx_module_t ngx_mail_core_module; | |
521 | 405 |
406 | |
1136 | 407 #endif /* _NGX_MAIL_H_INCLUDED_ */ |