annotate src/mail/ngx_mail.h @ 660:d0f7a625f27c NGINX_1_1_14

nginx 1.1.14 *) Feature: multiple "limit_req" limits may be used simultaneously. *) Bugfix: in error handling while connecting to a backend. Thanks to Piotr Sikora. *) Bugfix: in AIO error handling on FreeBSD. *) Bugfix: in the OpenSSL library initialization. *) Bugfix: the "proxy_redirect" directives might not be correctly inherited. *) Bugfix: memory leak during reconfiguration if the "pcre_jit" directive was used.
author Igor Sysoev <http://sysoev.ru>
date Mon, 30 Jan 2012 00:00:00 +0400
parents 753f505670e0
children 5cb5db9975ba
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
1
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
2 /*
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
3 * Copyright (C) Igor Sysoev
660
d0f7a625f27c nginx 1.1.14
Igor Sysoev <http://sysoev.ru>
parents: 654
diff changeset
4 * Copyright (C) Nginx, Inc.
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
5 */
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
6
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
7
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
8 #ifndef _NGX_MAIL_H_INCLUDED_
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
9 #define _NGX_MAIL_H_INCLUDED_
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
10
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
11
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
12 #include <ngx_config.h>
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
13 #include <ngx_core.h>
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
14 #include <ngx_event.h>
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
15 #include <ngx_event_connect.h>
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
16
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
17 #if (NGX_MAIL_SSL)
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
18 #include <ngx_mail_ssl_module.h>
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
19 #endif
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
20
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
21
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
22
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
23 typedef struct {
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
24 void **main_conf;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
25 void **srv_conf;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
26 } ngx_mail_conf_ctx_t;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
27
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
28
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
29 typedef struct {
492
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
30 u_char sockaddr[NGX_SOCKADDRLEN];
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
31 socklen_t socklen;
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
32
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
33 /* server ctx */
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
34 ngx_mail_conf_ctx_t *ctx;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
35
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
36 unsigned bind:1;
492
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
37 unsigned wildcard:1;
404
a094317ba307 nginx 0.7.14
Igor Sysoev <http://sysoev.ru>
parents: 366
diff changeset
38 #if (NGX_MAIL_SSL)
a094317ba307 nginx 0.7.14
Igor Sysoev <http://sysoev.ru>
parents: 366
diff changeset
39 unsigned ssl:1;
a094317ba307 nginx 0.7.14
Igor Sysoev <http://sysoev.ru>
parents: 366
diff changeset
40 #endif
492
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
41 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
42 unsigned ipv6only:2;
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
43 #endif
654
753f505670e0 nginx 1.1.11
Igor Sysoev <http://sysoev.ru>
parents: 540
diff changeset
44 unsigned so_keepalive:2;
753f505670e0 nginx 1.1.11
Igor Sysoev <http://sysoev.ru>
parents: 540
diff changeset
45 #if (NGX_HAVE_KEEPALIVE_TUNABLE)
753f505670e0 nginx 1.1.11
Igor Sysoev <http://sysoev.ru>
parents: 540
diff changeset
46 int tcp_keepidle;
753f505670e0 nginx 1.1.11
Igor Sysoev <http://sysoev.ru>
parents: 540
diff changeset
47 int tcp_keepintvl;
753f505670e0 nginx 1.1.11
Igor Sysoev <http://sysoev.ru>
parents: 540
diff changeset
48 int tcp_keepcnt;
753f505670e0 nginx 1.1.11
Igor Sysoev <http://sysoev.ru>
parents: 540
diff changeset
49 #endif
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
50 } ngx_mail_listen_t;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
51
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
52
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
53 typedef struct {
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
54 ngx_mail_conf_ctx_t *ctx;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
55 ngx_str_t addr_text;
404
a094317ba307 nginx 0.7.14
Igor Sysoev <http://sysoev.ru>
parents: 366
diff changeset
56 #if (NGX_MAIL_SSL)
a094317ba307 nginx 0.7.14
Igor Sysoev <http://sysoev.ru>
parents: 366
diff changeset
57 ngx_uint_t ssl; /* unsigned ssl:1; */
a094317ba307 nginx 0.7.14
Igor Sysoev <http://sysoev.ru>
parents: 366
diff changeset
58 #endif
492
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
59 } ngx_mail_addr_conf_t;
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
60
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
61 typedef struct {
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
62 in_addr_t addr;
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
63 ngx_mail_addr_conf_t conf;
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
64 } ngx_mail_in_addr_t;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
65
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
66
492
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
67 #if (NGX_HAVE_INET6)
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
68
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
69 typedef struct {
492
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
70 struct in6_addr addr6;
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
71 ngx_mail_addr_conf_t conf;
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
72 } ngx_mail_in6_addr_t;
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
73
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
74 #endif
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
75
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
76
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
77 typedef struct {
492
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
78 /* ngx_mail_in_addr_t or ngx_mail_in6_addr_t */
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
79 void *addrs;
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
80 ngx_uint_t naddrs;
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
81 } ngx_mail_port_t;
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
82
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
83
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
84 typedef struct {
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
85 int family;
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
86 in_port_t port;
492
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
87 ngx_array_t addrs; /* array of ngx_mail_conf_addr_t */
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
88 } ngx_mail_conf_port_t;
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
89
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
90
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
91 typedef struct {
492
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
92 struct sockaddr *sockaddr;
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
93 socklen_t socklen;
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
94
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
95 ngx_mail_conf_ctx_t *ctx;
492
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
96
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
97 unsigned bind:1;
492
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
98 unsigned wildcard:1;
404
a094317ba307 nginx 0.7.14
Igor Sysoev <http://sysoev.ru>
parents: 366
diff changeset
99 #if (NGX_MAIL_SSL)
a094317ba307 nginx 0.7.14
Igor Sysoev <http://sysoev.ru>
parents: 366
diff changeset
100 unsigned ssl:1;
a094317ba307 nginx 0.7.14
Igor Sysoev <http://sysoev.ru>
parents: 366
diff changeset
101 #endif
492
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
102 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
103 unsigned ipv6only:2;
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
104 #endif
654
753f505670e0 nginx 1.1.11
Igor Sysoev <http://sysoev.ru>
parents: 540
diff changeset
105 unsigned so_keepalive:2;
753f505670e0 nginx 1.1.11
Igor Sysoev <http://sysoev.ru>
parents: 540
diff changeset
106 #if (NGX_HAVE_KEEPALIVE_TUNABLE)
753f505670e0 nginx 1.1.11
Igor Sysoev <http://sysoev.ru>
parents: 540
diff changeset
107 int tcp_keepidle;
753f505670e0 nginx 1.1.11
Igor Sysoev <http://sysoev.ru>
parents: 540
diff changeset
108 int tcp_keepintvl;
753f505670e0 nginx 1.1.11
Igor Sysoev <http://sysoev.ru>
parents: 540
diff changeset
109 int tcp_keepcnt;
753f505670e0 nginx 1.1.11
Igor Sysoev <http://sysoev.ru>
parents: 540
diff changeset
110 #endif
492
98143f74eb3d nginx 0.7.58
Igor Sysoev <http://sysoev.ru>
parents: 444
diff changeset
111 } ngx_mail_conf_addr_t;
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
112
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
113
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
114 typedef struct {
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
115 ngx_array_t servers; /* ngx_mail_core_srv_conf_t */
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
116 ngx_array_t listen; /* ngx_mail_listen_t */
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
117 } ngx_mail_core_main_conf_t;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
118
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
119
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
120 #define NGX_MAIL_POP3_PROTOCOL 0
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
121 #define NGX_MAIL_IMAP_PROTOCOL 1
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
122 #define NGX_MAIL_SMTP_PROTOCOL 2
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
123
336
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
124
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
125 typedef struct ngx_mail_protocol_s ngx_mail_protocol_t;
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
126
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
127
336
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
128 typedef struct {
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
129 ngx_mail_protocol_t *protocol;
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
130
336
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
131 ngx_msec_t timeout;
366
babd3d9efb62 nginx 0.6.27
Igor Sysoev <http://sysoev.ru>
parents: 354
diff changeset
132 ngx_msec_t resolver_timeout;
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
133
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
134 ngx_flag_t so_keepalive;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
135
336
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
136 ngx_str_t server_name;
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
137
336
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
138 u_char *file_name;
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
139 ngx_int_t line;
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
140
366
babd3d9efb62 nginx 0.6.27
Igor Sysoev <http://sysoev.ru>
parents: 354
diff changeset
141 ngx_resolver_t *resolver;
babd3d9efb62 nginx 0.6.27
Igor Sysoev <http://sysoev.ru>
parents: 354
diff changeset
142
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
143 /* server ctx */
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
144 ngx_mail_conf_ctx_t *ctx;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
145 } ngx_mail_core_srv_conf_t;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
146
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
147
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
148 typedef enum {
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
149 ngx_pop3_start = 0,
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
150 ngx_pop3_user,
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
151 ngx_pop3_passwd,
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
152 ngx_pop3_auth_login_username,
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
153 ngx_pop3_auth_login_password,
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
154 ngx_pop3_auth_plain,
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
155 ngx_pop3_auth_cram_md5
354
583decdb82a4 nginx 0.6.21
Igor Sysoev <http://sysoev.ru>
parents: 336
diff changeset
156 } ngx_pop3_state_e;
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
157
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
158
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
159 typedef enum {
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
160 ngx_imap_start = 0,
322
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
161 ngx_imap_auth_login_username,
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
162 ngx_imap_auth_login_password,
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
163 ngx_imap_auth_plain,
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
164 ngx_imap_auth_cram_md5,
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
165 ngx_imap_login,
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
166 ngx_imap_user,
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
167 ngx_imap_passwd
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
168 } ngx_imap_state_e;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
169
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
170
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
171 typedef enum {
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
172 ngx_smtp_start = 0,
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
173 ngx_smtp_auth_login_username,
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
174 ngx_smtp_auth_login_password,
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
175 ngx_smtp_auth_plain,
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
176 ngx_smtp_auth_cram_md5,
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
177 ngx_smtp_helo,
420
ad0a34a8efa6 nginx 0.7.22
Igor Sysoev <http://sysoev.ru>
parents: 404
diff changeset
178 ngx_smtp_helo_xclient,
ad0a34a8efa6 nginx 0.7.22
Igor Sysoev <http://sysoev.ru>
parents: 404
diff changeset
179 ngx_smtp_helo_from,
ad0a34a8efa6 nginx 0.7.22
Igor Sysoev <http://sysoev.ru>
parents: 404
diff changeset
180 ngx_smtp_xclient,
ad0a34a8efa6 nginx 0.7.22
Igor Sysoev <http://sysoev.ru>
parents: 404
diff changeset
181 ngx_smtp_xclient_from,
444
33394d1255b0 nginx 0.7.34
Igor Sysoev <http://sysoev.ru>
parents: 420
diff changeset
182 ngx_smtp_xclient_helo,
420
ad0a34a8efa6 nginx 0.7.22
Igor Sysoev <http://sysoev.ru>
parents: 404
diff changeset
183 ngx_smtp_from,
ad0a34a8efa6 nginx 0.7.22
Igor Sysoev <http://sysoev.ru>
parents: 404
diff changeset
184 ngx_smtp_to
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
185 } ngx_smtp_state_e;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
186
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
187
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
188 typedef struct {
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
189 ngx_peer_connection_t upstream;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
190 ngx_buf_t *buffer;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
191 } ngx_mail_proxy_ctx_t;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
192
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
193
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
194 typedef struct {
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
195 uint32_t signature; /* "MAIL" */
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
196
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
197 ngx_connection_t *connection;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
198
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
199 ngx_str_t out;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
200 ngx_buf_t *buffer;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
201
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
202 void **ctx;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
203 void **main_conf;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
204 void **srv_conf;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
205
366
babd3d9efb62 nginx 0.6.27
Igor Sysoev <http://sysoev.ru>
parents: 354
diff changeset
206 ngx_resolver_ctx_t *resolver_ctx;
babd3d9efb62 nginx 0.6.27
Igor Sysoev <http://sysoev.ru>
parents: 354
diff changeset
207
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
208 ngx_mail_proxy_ctx_t *proxy;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
209
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
210 ngx_uint_t mail_state;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
211
336
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
212 unsigned protocol:3;
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
213 unsigned blocked:1;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
214 unsigned quit:1;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
215 unsigned quoted:1;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
216 unsigned backslash:1;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
217 unsigned no_sync_literal:1;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
218 unsigned starttls:1;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
219 unsigned esmtp:1;
420
ad0a34a8efa6 nginx 0.7.22
Igor Sysoev <http://sysoev.ru>
parents: 404
diff changeset
220 unsigned auth_method:3;
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
221 unsigned auth_wait:1;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
222
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
223 ngx_str_t login;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
224 ngx_str_t passwd;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
225
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
226 ngx_str_t salt;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
227 ngx_str_t tag;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
228 ngx_str_t tagged_line;
336
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
229 ngx_str_t text;
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
230
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
231 ngx_str_t *addr_text;
366
babd3d9efb62 nginx 0.6.27
Igor Sysoev <http://sysoev.ru>
parents: 354
diff changeset
232 ngx_str_t host;
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
233 ngx_str_t smtp_helo;
420
ad0a34a8efa6 nginx 0.7.22
Igor Sysoev <http://sysoev.ru>
parents: 404
diff changeset
234 ngx_str_t smtp_from;
ad0a34a8efa6 nginx 0.7.22
Igor Sysoev <http://sysoev.ru>
parents: 404
diff changeset
235 ngx_str_t smtp_to;
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
236
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
237 ngx_uint_t command;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
238 ngx_array_t args;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
239
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
240 ngx_uint_t login_attempt;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
241
336
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
242 /* used to parse POP3/IMAP/SMTP command */
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
243
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
244 ngx_uint_t state;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
245 u_char *cmd_start;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
246 u_char *arg_start;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
247 u_char *arg_end;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
248 ngx_uint_t literal_len;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
249 } ngx_mail_session_t;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
250
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
251
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
252 typedef struct {
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
253 ngx_str_t *client;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
254 ngx_mail_session_t *session;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
255 } ngx_mail_log_ctx_t;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
256
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
257
322
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
258 #define NGX_POP3_USER 1
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
259 #define NGX_POP3_PASS 2
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
260 #define NGX_POP3_CAPA 3
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
261 #define NGX_POP3_QUIT 4
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
262 #define NGX_POP3_NOOP 5
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
263 #define NGX_POP3_STLS 6
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
264 #define NGX_POP3_APOP 7
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
265 #define NGX_POP3_AUTH 8
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
266 #define NGX_POP3_STAT 9
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
267 #define NGX_POP3_LIST 10
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
268 #define NGX_POP3_RETR 11
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
269 #define NGX_POP3_DELE 12
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
270 #define NGX_POP3_RSET 13
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
271 #define NGX_POP3_TOP 14
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
272 #define NGX_POP3_UIDL 15
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
273
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
274
322
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
275 #define NGX_IMAP_LOGIN 1
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
276 #define NGX_IMAP_LOGOUT 2
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
277 #define NGX_IMAP_CAPABILITY 3
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
278 #define NGX_IMAP_NOOP 4
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
279 #define NGX_IMAP_STARTTLS 5
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
280
322
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
281 #define NGX_IMAP_NEXT 6
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
282
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
283 #define NGX_IMAP_AUTHENTICATE 7
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
284
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
285
322
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
286 #define NGX_SMTP_HELO 1
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
287 #define NGX_SMTP_EHLO 2
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
288 #define NGX_SMTP_AUTH 3
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
289 #define NGX_SMTP_QUIT 4
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
290 #define NGX_SMTP_NOOP 5
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
291 #define NGX_SMTP_MAIL 6
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
292 #define NGX_SMTP_RSET 7
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
293 #define NGX_SMTP_RCPT 8
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
294 #define NGX_SMTP_DATA 9
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
295 #define NGX_SMTP_VRFY 10
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
296 #define NGX_SMTP_EXPN 11
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
297 #define NGX_SMTP_HELP 12
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
298 #define NGX_SMTP_STARTTLS 13
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
299
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
300
444
33394d1255b0 nginx 0.7.34
Igor Sysoev <http://sysoev.ru>
parents: 420
diff changeset
301 #define NGX_MAIL_AUTH_PLAIN 0
33394d1255b0 nginx 0.7.34
Igor Sysoev <http://sysoev.ru>
parents: 420
diff changeset
302 #define NGX_MAIL_AUTH_LOGIN 1
33394d1255b0 nginx 0.7.34
Igor Sysoev <http://sysoev.ru>
parents: 420
diff changeset
303 #define NGX_MAIL_AUTH_LOGIN_USERNAME 2
33394d1255b0 nginx 0.7.34
Igor Sysoev <http://sysoev.ru>
parents: 420
diff changeset
304 #define NGX_MAIL_AUTH_APOP 3
33394d1255b0 nginx 0.7.34
Igor Sysoev <http://sysoev.ru>
parents: 420
diff changeset
305 #define NGX_MAIL_AUTH_CRAM_MD5 4
33394d1255b0 nginx 0.7.34
Igor Sysoev <http://sysoev.ru>
parents: 420
diff changeset
306 #define NGX_MAIL_AUTH_NONE 5
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
307
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
308
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
309 #define NGX_MAIL_AUTH_PLAIN_ENABLED 0x0002
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
310 #define NGX_MAIL_AUTH_LOGIN_ENABLED 0x0004
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
311 #define NGX_MAIL_AUTH_APOP_ENABLED 0x0008
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
312 #define NGX_MAIL_AUTH_CRAM_MD5_ENABLED 0x0010
420
ad0a34a8efa6 nginx 0.7.22
Igor Sysoev <http://sysoev.ru>
parents: 404
diff changeset
313 #define NGX_MAIL_AUTH_NONE_ENABLED 0x0020
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
314
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
315
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
316 #define NGX_MAIL_PARSE_INVALID_COMMAND 20
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
317
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
318
336
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
319 typedef void (*ngx_mail_init_session_pt)(ngx_mail_session_t *s,
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
320 ngx_connection_t *c);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
321 typedef void (*ngx_mail_init_protocol_pt)(ngx_event_t *rev);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
322 typedef void (*ngx_mail_auth_state_pt)(ngx_event_t *rev);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
323 typedef ngx_int_t (*ngx_mail_parse_command_pt)(ngx_mail_session_t *s);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
324
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
325
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
326 struct ngx_mail_protocol_s {
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
327 ngx_str_t name;
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
328 in_port_t port[4];
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
329 ngx_uint_t type;
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
330
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
331 ngx_mail_init_session_pt init_session;
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
332 ngx_mail_init_protocol_pt init_protocol;
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
333 ngx_mail_parse_command_pt parse_command;
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
334 ngx_mail_auth_state_pt auth_state;
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
335
336
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
336 ngx_str_t internal_server_error;
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
337 };
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
338
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
339
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
340 typedef struct {
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
341 ngx_mail_protocol_t *protocol;
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
342
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
343 void *(*create_main_conf)(ngx_conf_t *cf);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
344 char *(*init_main_conf)(ngx_conf_t *cf, void *conf);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
345
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
346 void *(*create_srv_conf)(ngx_conf_t *cf);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
347 char *(*merge_srv_conf)(ngx_conf_t *cf, void *prev,
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
348 void *conf);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
349 } ngx_mail_module_t;
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
350
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
351
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
352 #define NGX_MAIL_MODULE 0x4C49414D /* "MAIL" */
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
353
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
354 #define NGX_MAIL_MAIN_CONF 0x02000000
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
355 #define NGX_MAIL_SRV_CONF 0x04000000
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
356
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
357
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
358 #define NGX_MAIL_MAIN_CONF_OFFSET offsetof(ngx_mail_conf_ctx_t, main_conf)
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
359 #define NGX_MAIL_SRV_CONF_OFFSET offsetof(ngx_mail_conf_ctx_t, srv_conf)
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
360
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
361
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
362 #define ngx_mail_get_module_ctx(s, module) (s)->ctx[module.ctx_index]
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
363 #define ngx_mail_set_ctx(s, c, module) s->ctx[module.ctx_index] = c;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
364 #define ngx_mail_delete_ctx(s, module) s->ctx[module.ctx_index] = NULL;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
365
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
366
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
367 #define ngx_mail_get_module_main_conf(s, module) \
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
368 (s)->main_conf[module.ctx_index]
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
369 #define ngx_mail_get_module_srv_conf(s, module) (s)->srv_conf[module.ctx_index]
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
370
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
371 #define ngx_mail_conf_get_module_main_conf(cf, module) \
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
372 ((ngx_mail_conf_ctx_t *) cf->ctx)->main_conf[module.ctx_index]
322
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
373 #define ngx_mail_conf_get_module_srv_conf(cf, module) \
d16d691432c9 nginx 0.6.5
Igor Sysoev <http://sysoev.ru>
parents: 290
diff changeset
374 ((ngx_mail_conf_ctx_t *) cf->ctx)->srv_conf[module.ctx_index]
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
375
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
376
336
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
377 #if (NGX_MAIL_SSL)
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
378 void ngx_mail_starttls_handler(ngx_event_t *rev);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
379 ngx_int_t ngx_mail_starttls_only(ngx_mail_session_t *s, ngx_connection_t *c);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
380 #endif
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
381
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
382
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
383 void ngx_mail_init_connection(ngx_connection_t *c);
336
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
384
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
385 ngx_int_t ngx_mail_salt(ngx_mail_session_t *s, ngx_connection_t *c,
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
386 ngx_mail_core_srv_conf_t *cscf);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
387 ngx_int_t ngx_mail_auth_plain(ngx_mail_session_t *s, ngx_connection_t *c,
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
388 ngx_uint_t n);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
389 ngx_int_t ngx_mail_auth_login_username(ngx_mail_session_t *s,
444
33394d1255b0 nginx 0.7.34
Igor Sysoev <http://sysoev.ru>
parents: 420
diff changeset
390 ngx_connection_t *c, ngx_uint_t n);
336
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
391 ngx_int_t ngx_mail_auth_login_password(ngx_mail_session_t *s,
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
392 ngx_connection_t *c);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
393 ngx_int_t ngx_mail_auth_cram_md5_salt(ngx_mail_session_t *s,
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
394 ngx_connection_t *c, char *prefix, size_t len);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
395 ngx_int_t ngx_mail_auth_cram_md5(ngx_mail_session_t *s, ngx_connection_t *c);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
396 ngx_int_t ngx_mail_auth_parse(ngx_mail_session_t *s, ngx_connection_t *c);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
397
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
398 void ngx_mail_send(ngx_event_t *wev);
336
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
399 ngx_int_t ngx_mail_read_command(ngx_mail_session_t *s, ngx_connection_t *c);
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
400 void ngx_mail_auth(ngx_mail_session_t *s, ngx_connection_t *c);
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
401 void ngx_mail_close_connection(ngx_connection_t *c);
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
402 void ngx_mail_session_internal_server_error(ngx_mail_session_t *s);
336
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
403 u_char *ngx_mail_log_error(ngx_log_t *log, u_char *buf, size_t len);
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
404
336
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
405
1c519aff5c0c nginx 0.6.12
Igor Sysoev <http://sysoev.ru>
parents: 322
diff changeset
406 char *ngx_mail_capabilities(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
407
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
408
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
409 /* STUB */
540
c04fa65fe604 nginx 0.8.22
Igor Sysoev <http://sysoev.ru>
parents: 492
diff changeset
410 void ngx_mail_proxy_init(ngx_mail_session_t *s, ngx_addr_t *peer);
290
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
411 void ngx_mail_auth_http_init(ngx_mail_session_t *s);
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
412 /**/
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
413
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
414
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
415 extern ngx_uint_t ngx_mail_max_module;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
416 extern ngx_module_t ngx_mail_core_module;
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
417
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
418
f745bf973510 nginx 0.5.15
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
419 #endif /* _NGX_MAIL_H_INCLUDED_ */