Klaus Demo nginx / b5a3cc3
Mail: make it possible to disable SASL EXTERNAL. Sergey Kandaurov 5 years ago
3 changed file(s) with 16 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
355355 }
356356 #endif
357357
358 iscf = ngx_mail_get_module_srv_conf(s, ngx_mail_imap_module);
359
358360 rc = ngx_mail_auth_parse(s, c);
359361
360362 switch (rc) {
381383 return NGX_OK;
382384
383385 case NGX_MAIL_AUTH_CRAM_MD5:
384
385 iscf = ngx_mail_get_module_srv_conf(s, ngx_mail_imap_module);
386386
387387 if (!(iscf->auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED)) {
388388 return NGX_MAIL_PARSE_INVALID_COMMAND;
404404 return NGX_ERROR;
405405
406406 case NGX_MAIL_AUTH_EXTERNAL:
407
408 if (!(iscf->auth_methods & NGX_MAIL_AUTH_EXTERNAL_ENABLED)) {
409 return NGX_MAIL_PARSE_INVALID_COMMAND;
410 }
407411
408412 ngx_str_set(&s->out, imap_username);
409413 s->mail_state = ngx_imap_auth_external;
500500
501501 case NGX_MAIL_AUTH_EXTERNAL:
502502
503 if (!(pscf->auth_methods & NGX_MAIL_AUTH_EXTERNAL_ENABLED)) {
504 return NGX_MAIL_PARSE_INVALID_COMMAND;
505 }
506
503507 ngx_str_set(&s->out, pop3_username);
504508 s->mail_state = ngx_pop3_auth_external;
505509
608608 return NGX_OK;
609609 }
610610
611 sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module);
612
611613 rc = ngx_mail_auth_parse(s, c);
612614
613615 switch (rc) {
634636 return NGX_OK;
635637
636638 case NGX_MAIL_AUTH_CRAM_MD5:
637
638 sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module);
639639
640640 if (!(sscf->auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED)) {
641641 return NGX_MAIL_PARSE_INVALID_COMMAND;
657657 return NGX_ERROR;
658658
659659 case NGX_MAIL_AUTH_EXTERNAL:
660
661 if (!(sscf->auth_methods & NGX_MAIL_AUTH_EXTERNAL_ENABLED)) {
662 return NGX_MAIL_PARSE_INVALID_COMMAND;
663 }
660664
661665 ngx_str_set(&s->out, smtp_username);
662666 s->mail_state = ngx_smtp_auth_external;