comparison src/mail/ngx_mail.h @ 1476:67578e966dcc

split pop3, imap, and smtp handlers
author Igor Sysoev <igor@sysoev.ru>
date Thu, 13 Sep 2007 20:13:18 +0000
parents c4b2c893989d
children 59e1caf2be94
comparison
equal deleted inserted replaced
1475:732fe8258857 1476:67578e966dcc
194 ngx_str_t passwd; 194 ngx_str_t passwd;
195 195
196 ngx_str_t salt; 196 ngx_str_t salt;
197 ngx_str_t tag; 197 ngx_str_t tag;
198 ngx_str_t tagged_line; 198 ngx_str_t tagged_line;
199 ngx_str_t text;
199 200
200 ngx_str_t *addr_text; 201 ngx_str_t *addr_text;
201 ngx_str_t smtp_helo; 202 ngx_str_t smtp_helo;
202 203
203 ngx_uint_t command; 204 ngx_uint_t command;
301 #define ngx_mail_conf_get_module_main_conf(cf, module) \ 302 #define ngx_mail_conf_get_module_main_conf(cf, module) \
302 ((ngx_mail_conf_ctx_t *) cf->ctx)->main_conf[module.ctx_index] 303 ((ngx_mail_conf_ctx_t *) cf->ctx)->main_conf[module.ctx_index]
303 #define ngx_mail_conf_get_module_srv_conf(cf, module) \ 304 #define ngx_mail_conf_get_module_srv_conf(cf, module) \
304 ((ngx_mail_conf_ctx_t *) cf->ctx)->srv_conf[module.ctx_index] 305 ((ngx_mail_conf_ctx_t *) cf->ctx)->srv_conf[module.ctx_index]
305 306
307 typedef void (*ngx_mail_init_session_pt)(ngx_mail_session_t *s,
308 ngx_connection_t *c);
309 typedef void (*ngx_mail_init_protocol_pt)(ngx_event_t *rev);
310 typedef ngx_int_t (*ngx_mail_parse_pt)(ngx_mail_session_t *s);
311
312
313 #if (NGX_MAIL_SSL)
314 void ngx_mail_starttls_handler(ngx_event_t *rev);
315 #endif
316
306 317
307 void ngx_mail_init_connection(ngx_connection_t *c); 318 void ngx_mail_init_connection(ngx_connection_t *c);
308 void ngx_mail_send(ngx_event_t *wev); 319
309 void ngx_pop3_auth_state(ngx_event_t *rev); 320 void ngx_pop3_auth_state(ngx_event_t *rev);
310 void ngx_imap_auth_state(ngx_event_t *rev); 321 void ngx_imap_auth_state(ngx_event_t *rev);
311 void ngx_smtp_auth_state(ngx_event_t *rev); 322 void ngx_smtp_auth_state(ngx_event_t *rev);
323
324 ngx_int_t ngx_mail_salt(ngx_mail_session_t *s, ngx_connection_t *c,
325 ngx_mail_core_srv_conf_t *cscf);
326 ngx_int_t ngx_mail_auth_plain(ngx_mail_session_t *s, ngx_connection_t *c,
327 ngx_uint_t n);
328 ngx_int_t ngx_mail_auth_login_username(ngx_mail_session_t *s,
329 ngx_connection_t *c);
330 ngx_int_t ngx_mail_auth_login_password(ngx_mail_session_t *s,
331 ngx_connection_t *c);
332 ngx_int_t ngx_mail_auth_cram_md5(ngx_mail_session_t *s, ngx_connection_t *c);
333
334 void ngx_mail_send(ngx_event_t *wev);
335 ngx_int_t ngx_mail_read_command(ngx_mail_session_t *s);
336 void ngx_mail_auth(ngx_mail_session_t *s);
312 void ngx_mail_close_connection(ngx_connection_t *c); 337 void ngx_mail_close_connection(ngx_connection_t *c);
313 void ngx_mail_session_internal_server_error(ngx_mail_session_t *s); 338 void ngx_mail_session_internal_server_error(ngx_mail_session_t *s);
339 u_char *ngx_mail_log_error(ngx_log_t *log, u_char *buf, size_t len);
340
341
342 void ngx_mail_pop3_init_session(ngx_mail_session_t *s, ngx_connection_t *c);
343 void ngx_mail_imap_init_session(ngx_mail_session_t *s, ngx_connection_t *c);
344 void ngx_mail_smtp_init_session(ngx_mail_session_t *s, ngx_connection_t *c);
345
346 void ngx_mail_pop3_init_protocol(ngx_event_t *rev);
347 void ngx_mail_imap_init_protocol(ngx_event_t *rev);
348 void ngx_mail_smtp_init_protocol(ngx_event_t *rev);
314 349
315 ngx_int_t ngx_pop3_parse_command(ngx_mail_session_t *s); 350 ngx_int_t ngx_pop3_parse_command(ngx_mail_session_t *s);
316 ngx_int_t ngx_imap_parse_command(ngx_mail_session_t *s); 351 ngx_int_t ngx_imap_parse_command(ngx_mail_session_t *s);
317 ngx_int_t ngx_smtp_parse_command(ngx_mail_session_t *s); 352 ngx_int_t ngx_smtp_parse_command(ngx_mail_session_t *s);
318 353