annotate src/imap/ngx_imap.h @ 132:91372f004adf NGINX_0_3_13

nginx 0.3.13 *) Feature: the IMAP/POP3 proxy supports STARTTLS and STLS. *) Bugfix: the IMAP/POP3 proxy did not work with the select, poll, and /dev/poll methods. *) Bugfix: in SSI handling. *) Bugfix: now Solaris sendfilev() is not used to transfer the client request body to FastCGI-server via the unix domain socket. *) Bugfix: the "auth_basic" directive did not disable the authorization; bug appeared in 0.3.11.
author Igor Sysoev <http://sysoev.ru>
date Mon, 05 Dec 2005 00:00:00 +0300
parents e85dca77c46a
children 3656228c0b56
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
1
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
2 /*
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
3 * Copyright (C) Igor Sysoev
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
4 */
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
5
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
6
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
7 #ifndef _NGX_IMAP_H_INCLUDED_
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
8 #define _NGX_IMAP_H_INCLUDED_
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
9
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
10
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
11 #include <ngx_config.h>
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
12 #include <ngx_core.h>
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
13 #include <ngx_event.h>
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
14 #include <ngx_event_connect.h>
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
15
88
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
16 #if (NGX_IMAP_SSL)
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
17 #include <ngx_imap_ssl_module.h>
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
18 #endif
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
19
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
20
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
21
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
22 typedef struct {
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
23 void **main_conf;
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
24 void **srv_conf;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
25 } ngx_imap_conf_ctx_t;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
26
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
27
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
28 typedef struct {
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
29 ngx_array_t servers; /* ngx_imap_core_srv_conf_t */
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
30 } ngx_imap_core_main_conf_t;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
31
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
32
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
33 #define NGX_IMAP_POP3_PROTOCOL 0
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
34 #define NGX_IMAP_IMAP_PROTOCOL 1
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
35
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
36 typedef struct {
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
37 ngx_msec_t timeout;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
38
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
39 size_t imap_client_buffer_size;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
40
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
41 ngx_uint_t protocol;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
42
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
43 ngx_str_t pop3_capability;
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
44 ngx_str_t pop3_starttls_capability;
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
45 ngx_str_t imap_capability;
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
46 ngx_str_t imap_starttls_capability;
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
47 ngx_str_t imap_starttls_only_capability;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
48
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
49 ngx_array_t pop3_capabilities;
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
50 ngx_array_t imap_capabilities;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
51
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
52 /* server ctx */
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
53 ngx_imap_conf_ctx_t *ctx;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
54 } ngx_imap_core_srv_conf_t;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
55
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
56
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
57 typedef struct {
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
58 void *(*create_main_conf)(ngx_conf_t *cf);
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
59 char *(*init_main_conf)(ngx_conf_t *cf, void *conf);
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
60
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
61 void *(*create_srv_conf)(ngx_conf_t *cf);
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
62 char *(*merge_srv_conf)(ngx_conf_t *cf, void *prev,
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
63 void *conf);
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
64 } ngx_imap_module_t;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
65
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
66
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
67 typedef enum {
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
68 ngx_imap_start = 0,
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
69 ngx_imap_login,
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
70 ngx_imap_user,
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
71 ngx_imap_passwd,
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
72 } ngx_imap_state_e;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
73
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
74
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
75 typedef enum {
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
76 ngx_pop3_start = 0,
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
77 ngx_pop3_user,
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
78 ngx_pop3_passwd
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
79 } ngx_po3_state_e;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
80
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
81
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
82 typedef struct {
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
83 ngx_peer_connection_t upstream;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
84 ngx_buf_t *buffer;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
85 } ngx_imap_proxy_ctx_t;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
86
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
87
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
88 typedef struct {
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
89 uint32_t signature; /* "IMAP" */
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
90
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
91 ngx_connection_t *connection;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
92
88
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
93 ngx_str_t out;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
94 ngx_buf_t *buffer;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
95
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
96 void **ctx;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
97 void **main_conf;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
98 void **srv_conf;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
99
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
100 ngx_imap_proxy_ctx_t *proxy;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
101
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
102 ngx_uint_t imap_state;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
103
88
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
104 unsigned blocked:1;
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
105 unsigned quit:1;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
106 unsigned protocol:1;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
107 unsigned quoted:1;
92
45945fa8b8ba nginx 0.2.0
Igor Sysoev <http://sysoev.ru>
parents: 90
diff changeset
108 unsigned backslash:1;
45945fa8b8ba nginx 0.2.0
Igor Sysoev <http://sysoev.ru>
parents: 90
diff changeset
109 unsigned no_sync_literal:1;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
110
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
111 ngx_str_t login;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
112 ngx_str_t passwd;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
113
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
114 ngx_str_t tag;
88
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
115 ngx_str_t tagged_line;
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
116
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
117 ngx_uint_t command;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
118 ngx_array_t args;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
119
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
120 ngx_uint_t login_attempt;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
121
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
122 /* used to parse IMAP/POP3 command */
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
123
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
124 ngx_uint_t state;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
125 u_char *cmd_start;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
126 u_char *arg_start;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
127 u_char *arg_end;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
128 ngx_uint_t literal_len;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
129 } ngx_imap_session_t;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
130
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
131
90
71c46860eb55 nginx 0.1.45
Igor Sysoev <http://sysoev.ru>
parents: 88
diff changeset
132 typedef struct {
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
133 ngx_str_t *client;
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
134 ngx_imap_session_t *session;
90
71c46860eb55 nginx 0.1.45
Igor Sysoev <http://sysoev.ru>
parents: 88
diff changeset
135 } ngx_imap_log_ctx_t;
71c46860eb55 nginx 0.1.45
Igor Sysoev <http://sysoev.ru>
parents: 88
diff changeset
136
71c46860eb55 nginx 0.1.45
Igor Sysoev <http://sysoev.ru>
parents: 88
diff changeset
137
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
138 #define NGX_POP3_USER 1
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
139 #define NGX_POP3_PASS 2
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
140 #define NGX_POP3_CAPA 3
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
141 #define NGX_POP3_QUIT 4
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
142 #define NGX_POP3_NOOP 5
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
143 #define NGX_POP3_STLS 6
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
144 #define NGX_POP3_APOP 7
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
145 #define NGX_POP3_STAT 8
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
146 #define NGX_POP3_LIST 9
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
147 #define NGX_POP3_RETR 10
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
148 #define NGX_POP3_DELE 11
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
149 #define NGX_POP3_RSET 12
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
150 #define NGX_POP3_TOP 13
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
151 #define NGX_POP3_UIDL 14
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
152
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
153
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
154 #define NGX_IMAP_LOGIN 1
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
155 #define NGX_IMAP_LOGOUT 2
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
156 #define NGX_IMAP_CAPABILITY 3
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
157 #define NGX_IMAP_NOOP 4
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
158 #define NGX_IMAP_STARTTLS 5
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
159
132
91372f004adf nginx 0.3.13
Igor Sysoev <http://sysoev.ru>
parents: 120
diff changeset
160 #define NGX_IMAP_NEXT 6
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
161
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
162
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
163 #define NGX_IMAP_PARSE_INVALID_COMMAND 20
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
164
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
165
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
166 #define NGX_IMAP_MODULE 0x50414D49 /* "IMAP" */
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
167
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
168 #define NGX_IMAP_MAIN_CONF 0x02000000
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
169 #define NGX_IMAP_SRV_CONF 0x04000000
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
170
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
171
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
172 #define NGX_IMAP_MAIN_CONF_OFFSET offsetof(ngx_imap_conf_ctx_t, main_conf)
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
173 #define NGX_IMAP_SRV_CONF_OFFSET offsetof(ngx_imap_conf_ctx_t, srv_conf)
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
174
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
175
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
176 #define ngx_imap_get_module_ctx(s, module) (s)->ctx[module.ctx_index]
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
177 #define ngx_imap_set_ctx(s, c, module) s->ctx[module.ctx_index] = c;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
178 #define ngx_imap_delete_ctx(s, module) s->ctx[module.ctx_index] = NULL;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
179
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
180
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
181 #define ngx_imap_get_module_main_conf(s, module) \
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
182 (s)->main_conf[module.ctx_index]
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
183 #define ngx_imap_get_module_srv_conf(s, module) (s)->srv_conf[module.ctx_index]
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
184
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
185
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
186 void ngx_imap_init_connection(ngx_connection_t *c);
88
e916a291e9aa nginx 0.1.44
Igor Sysoev <http://sysoev.ru>
parents: 76
diff changeset
187 void ngx_imap_send(ngx_event_t *wev);
76
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
188 void ngx_imap_auth_state(ngx_event_t *rev);
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
189 void ngx_pop3_auth_state(ngx_event_t *rev);
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
190 void ngx_imap_close_connection(ngx_connection_t *c);
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
191 void ngx_imap_session_internal_server_error(ngx_imap_session_t *s);
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
192
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
193 ngx_int_t ngx_imap_parse_command(ngx_imap_session_t *s);
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
194 ngx_int_t ngx_pop3_parse_command(ngx_imap_session_t *s);
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
195
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
196
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
197 /* STUB */
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
198 void ngx_imap_proxy_init(ngx_imap_session_t *s, ngx_peers_t *peers);
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
199 void ngx_imap_auth_http_init(ngx_imap_session_t *s);
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
200 /**/
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
201
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
202
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
203 extern ngx_uint_t ngx_imap_max_module;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
204 extern ngx_module_t ngx_imap_core_module;
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
205
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
206
da9a3b14312d nginx 0.1.38
Igor Sysoev <http://sysoev.ru>
parents:
diff changeset
207 #endif /* _NGX_IMAP_H_INCLUDED_ */