14 static void *ngx_mail_core_create_main_conf(
ngx_conf_t *cf);
15 static void *ngx_mail_core_create_srv_conf(
ngx_conf_t *cf);
16 static char *ngx_mail_core_merge_srv_conf(
ngx_conf_t *cf,
void *parent,
30 "so_keepalive\" parameter of the \"listen"
52 ngx_mail_core_protocol,
62 &ngx_conf_deprecated_so_keepalive },
80 ngx_mail_core_resolver,
99 ngx_mail_core_create_main_conf,
102 ngx_mail_core_create_srv_conf,
103 ngx_mail_core_merge_srv_conf
109 &ngx_mail_core_module_ctx,
110 ngx_mail_core_commands,
124 ngx_mail_core_create_main_conf(
ngx_conf_t *cf)
180 ngx_mail_core_merge_srv_conf(
ngx_conf_t *cf,
void *parent,
void *child)
200 "unknown mail protocol for server in %s:%ui",
297 struct sockaddr_in *sin;
300 struct sockaddr_in6 *sin6;
313 "%s in \"%V\" of the \"listen\" directive",
326 sa = (
struct sockaddr *) ls[i].sockaddr;
328 if (sa->sa_family != u.
family) {
332 switch (sa->sa_family) {
336 off = offsetof(
struct sockaddr_in6, sin6_addr);
338 sin6 = (
struct sockaddr_in6 *) sa;
339 port = sin6->sin6_port;
343 #if (NGX_HAVE_UNIX_DOMAIN)
345 off = offsetof(
struct sockaddr_un, sun_path);
346 len =
sizeof(((
struct sockaddr_un *) sa)->sun_path);
352 off = offsetof(
struct sockaddr_in, sin_addr);
354 sin = (
struct sockaddr_in *) sa;
355 port = sin->sin_port;
363 if (port != u.
port) {
368 "duplicate \"%V\" address and port pair", &u.
url);
385 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
417 if (
ngx_strncmp(value[i].data,
"ipv6only=o", 10) == 0) {
418 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
422 sa = (
struct sockaddr *) ls->
sockaddr;
424 if (sa->sa_family == AF_INET6) {
426 if (
ngx_strcmp(&value[i].data[10],
"n") == 0) {
429 }
else if (
ngx_strcmp(&value[i].data[10],
"ff") == 0) {
434 "invalid ipv6only flags \"%s\"",
445 "ipv6only is not supported "
446 "on addr \"%*s\", ignored", len, buf);
452 "bind ipv6only is not supported "
464 "the \"ssl\" parameter requires "
465 "ngx_mail_ssl_module");
470 if (
ngx_strncmp(value[i].data,
"so_keepalive=", 13) == 0) {
472 if (
ngx_strcmp(&value[i].data[13],
"on") == 0) {
475 }
else if (
ngx_strcmp(&value[i].data[13],
"off") == 0) {
480 #if (NGX_HAVE_KEEPALIVE_TUNABLE)
487 p = ngx_strlchr(s.
data, end,
':');
496 if (ls->tcp_keepidle == (time_t)
NGX_ERROR) {
497 goto invalid_so_keepalive;
501 s.
data = (p < end) ? (p + 1) : end;
503 p = ngx_strlchr(s.
data, end,
':');
512 if (ls->tcp_keepintvl == (time_t)
NGX_ERROR) {
513 goto invalid_so_keepalive;
517 s.
data = (p < end) ? (p + 1) : end;
524 goto invalid_so_keepalive;
528 if (ls->tcp_keepidle == 0 && ls->tcp_keepintvl == 0
529 && ls->tcp_keepcnt == 0)
531 goto invalid_so_keepalive;
539 "the \"so_keepalive\" parameter accepts "
540 "only \"on\" or \"off\" on this platform");
550 #if (NGX_HAVE_KEEPALIVE_TUNABLE)
551 invalid_so_keepalive:
554 "invalid so_keepalive value: \"%s\"",
561 "the invalid \"%V\" parameter", &value[i]);
597 "unknown protocol \"%V\"", &value[1]);
612 return "is duplicate";