mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
Mail: make it possible to disable SASL EXTERNAL.
This commit is contained in:
parent
b580770f3a
commit
b5a3cc3781
@ -356,6 +356,8 @@ ngx_mail_imap_authenticate(ngx_mail_session_t *s, ngx_connection_t *c)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
iscf = ngx_mail_get_module_srv_conf(s, ngx_mail_imap_module);
|
||||||
|
|
||||||
rc = ngx_mail_auth_parse(s, c);
|
rc = ngx_mail_auth_parse(s, c);
|
||||||
|
|
||||||
switch (rc) {
|
switch (rc) {
|
||||||
@ -383,8 +385,6 @@ ngx_mail_imap_authenticate(ngx_mail_session_t *s, ngx_connection_t *c)
|
|||||||
|
|
||||||
case NGX_MAIL_AUTH_CRAM_MD5:
|
case NGX_MAIL_AUTH_CRAM_MD5:
|
||||||
|
|
||||||
iscf = ngx_mail_get_module_srv_conf(s, ngx_mail_imap_module);
|
|
||||||
|
|
||||||
if (!(iscf->auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED)) {
|
if (!(iscf->auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED)) {
|
||||||
return NGX_MAIL_PARSE_INVALID_COMMAND;
|
return NGX_MAIL_PARSE_INVALID_COMMAND;
|
||||||
}
|
}
|
||||||
@ -406,6 +406,10 @@ ngx_mail_imap_authenticate(ngx_mail_session_t *s, ngx_connection_t *c)
|
|||||||
|
|
||||||
case NGX_MAIL_AUTH_EXTERNAL:
|
case NGX_MAIL_AUTH_EXTERNAL:
|
||||||
|
|
||||||
|
if (!(iscf->auth_methods & NGX_MAIL_AUTH_EXTERNAL_ENABLED)) {
|
||||||
|
return NGX_MAIL_PARSE_INVALID_COMMAND;
|
||||||
|
}
|
||||||
|
|
||||||
ngx_str_set(&s->out, imap_username);
|
ngx_str_set(&s->out, imap_username);
|
||||||
s->mail_state = ngx_imap_auth_external;
|
s->mail_state = ngx_imap_auth_external;
|
||||||
|
|
||||||
|
@ -501,6 +501,10 @@ ngx_mail_pop3_auth(ngx_mail_session_t *s, ngx_connection_t *c)
|
|||||||
|
|
||||||
case NGX_MAIL_AUTH_EXTERNAL:
|
case NGX_MAIL_AUTH_EXTERNAL:
|
||||||
|
|
||||||
|
if (!(pscf->auth_methods & NGX_MAIL_AUTH_EXTERNAL_ENABLED)) {
|
||||||
|
return NGX_MAIL_PARSE_INVALID_COMMAND;
|
||||||
|
}
|
||||||
|
|
||||||
ngx_str_set(&s->out, pop3_username);
|
ngx_str_set(&s->out, pop3_username);
|
||||||
s->mail_state = ngx_pop3_auth_external;
|
s->mail_state = ngx_pop3_auth_external;
|
||||||
|
|
||||||
|
@ -609,6 +609,8 @@ ngx_mail_smtp_auth(ngx_mail_session_t *s, ngx_connection_t *c)
|
|||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module);
|
||||||
|
|
||||||
rc = ngx_mail_auth_parse(s, c);
|
rc = ngx_mail_auth_parse(s, c);
|
||||||
|
|
||||||
switch (rc) {
|
switch (rc) {
|
||||||
@ -636,8 +638,6 @@ ngx_mail_smtp_auth(ngx_mail_session_t *s, ngx_connection_t *c)
|
|||||||
|
|
||||||
case NGX_MAIL_AUTH_CRAM_MD5:
|
case NGX_MAIL_AUTH_CRAM_MD5:
|
||||||
|
|
||||||
sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module);
|
|
||||||
|
|
||||||
if (!(sscf->auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED)) {
|
if (!(sscf->auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED)) {
|
||||||
return NGX_MAIL_PARSE_INVALID_COMMAND;
|
return NGX_MAIL_PARSE_INVALID_COMMAND;
|
||||||
}
|
}
|
||||||
@ -659,6 +659,10 @@ ngx_mail_smtp_auth(ngx_mail_session_t *s, ngx_connection_t *c)
|
|||||||
|
|
||||||
case NGX_MAIL_AUTH_EXTERNAL:
|
case NGX_MAIL_AUTH_EXTERNAL:
|
||||||
|
|
||||||
|
if (!(sscf->auth_methods & NGX_MAIL_AUTH_EXTERNAL_ENABLED)) {
|
||||||
|
return NGX_MAIL_PARSE_INVALID_COMMAND;
|
||||||
|
}
|
||||||
|
|
||||||
ngx_str_set(&s->out, smtp_username);
|
ngx_str_set(&s->out, smtp_username);
|
||||||
s->mail_state = ngx_smtp_auth_external;
|
s->mail_state = ngx_smtp_auth_external;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user