blob: eb12b6790fb77c91bb27a73e1661576dbeaea6df [file] [log] [blame]
Igor Sysoev9e511812004-08-31 19:05:39 +00001
2#include <ngx_config.h>
3#include <ngx_core.h>
4#include <ngx_event.h>
Igor Sysoev59cf56c2004-09-07 15:29:22 +00005#include <ngx_imap.h>
6
7
8static char *ngx_imap_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
Igor Sysoev9e511812004-08-31 19:05:39 +00009
10
11static ngx_command_t ngx_imap_commands[] = {
12
13 { ngx_string("imap"),
14 NGX_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
15 ngx_imap_block,
16 0,
17 0,
18 NULL },
19
20 ngx_null_command
21};
22
23
24static ngx_core_module_t ngx_imap_module_ctx = {
25 ngx_string("imap"),
26 NULL,
27 NULL
28};
29
30
31ngx_module_t ngx_imap_module = {
32 NGX_MODULE,
33 &ngx_imap_module_ctx, /* module context */
34 ngx_imap_commands, /* module directives */
35 NGX_CORE_MODULE, /* module type */
36 NULL, /* init module */
Igor Sysoev59cf56c2004-09-07 15:29:22 +000037 NULL /* init process */
Igor Sysoev9e511812004-08-31 19:05:39 +000038};
Igor Sysoev59cf56c2004-09-07 15:29:22 +000039
40
41static char *ngx_imap_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
42{
43 ngx_listening_t *ls;
44
45 /* STUB */
46
47 ls = ngx_listening_inet_stream_socket(cf, 0, 8110);
48 if (ls == NULL) {
49 return NGX_CONF_ERROR;
50 }
51
52 ls->backlog = -1;
Igor Sysoev2e6ba932004-09-09 15:40:48 +000053 ls->addr_ntop = 1;
Igor Sysoev59cf56c2004-09-07 15:29:22 +000054 ls->handler = ngx_imap_init_connection;
55 ls->pool_size = 16384;
56 /* ls->post_accept_timeout = 0; */
57 ls->log = cf->cycle->new_log;
58
59 /* */
60
61 return NGX_CONF_OK;
62}