15 static void *ngx_mail_pop3_create_srv_conf(
ngx_conf_t *cf);
16 static char *ngx_mail_pop3_merge_srv_conf(
ngx_conf_t *cf,
void *parent,
20 static ngx_str_t ngx_mail_pop3_default_capabilities[] = {
36 static ngx_str_t ngx_mail_pop3_auth_plain_capability =
43 static ngx_str_t ngx_mail_pop3_auth_cram_md5_capability =
79 &ngx_mail_pop3_auth_methods },
86 &ngx_mail_pop3_protocol,
91 ngx_mail_pop3_create_srv_conf,
92 ngx_mail_pop3_merge_srv_conf
98 &ngx_mail_pop3_module_ctx,
99 ngx_mail_pop3_commands,
133 ngx_mail_pop3_merge_srv_conf(
ngx_conf_t *cf,
void *parent,
void *child)
139 size_t size, stls_only_size;
154 for (d = ngx_mail_pop3_default_capabilities; d->
len; d++) {
164 size =
sizeof(
"+OK Capability list follows" CRLF) - 1
165 +
sizeof(
"." CRLF) - 1;
167 stls_only_size = size +
sizeof(
"STLS" CRLF) - 1;
171 size += c[
i].len +
sizeof(
CRLF) - 1;
177 stls_only_size += c[
i].len +
sizeof(
CRLF) - 1;
181 size +=
sizeof(
"SASL LOGIN PLAIN CRAM-MD5" CRLF) - 1;
184 size +=
sizeof(
"SASL LOGIN PLAIN" CRLF) - 1;
196 sizeof(
"+OK Capability list follows" CRLF) - 1);
200 *p++ =
CR; *p++ =
LF;
205 sizeof(
"SASL LOGIN PLAIN CRAM-MD5" CRLF) - 1);
209 sizeof(
"SASL LOGIN PLAIN" CRLF) - 1);
212 *p++ =
'.'; *p++ =
CR; *p =
LF;
215 size +=
sizeof(
"STLS" CRLF) - 1;
229 *p++ =
'.'; *p++ =
CR; *p =
LF;
249 sizeof(
"+OK Capability list follows" CRLF) - 1);
257 *p++ =
CR; *p++ =
LF;
261 *p++ =
'.'; *p++ =
CR; *p =
LF;