summaryrefslogtreecommitdiffhomepage
path: root/src/mail/ngx_mail.h
diff options
context:
space:
mode:
authorRob N ★ <robn@fastmail.com>2016-10-08 18:05:00 +1100
committerRob N ★ <robn@fastmail.com>2016-10-08 18:05:00 +1100
commit66c23edf6308867572d5c4b8341e7a3fe7e97864 (patch)
treeef7915e431e44d1394d27d3fb70cdcb0d893e467 /src/mail/ngx_mail.h
parenta747089a1dd63f323111c82000debfd83a5e6719 (diff)
downloadnginx-66c23edf6308867572d5c4b8341e7a3fe7e97864.tar.gz
nginx-66c23edf6308867572d5c4b8341e7a3fe7e97864.tar.bz2
Mail: support SASL EXTERNAL (RFC 4422).
This is needed to allow TLS client certificate auth to work. With ssl_verify_client configured, the auth daemon can choose to allow the connection to proceed based on the certificate data. This has been tested with Thunderbird for IMAP only. I've not yet found a client that will do client certificate auth for POP3 or SMTP, and the method is not really documented anywhere that I can find. That said, its simple enough that the way I've done is probably right.
Diffstat (limited to 'src/mail/ngx_mail.h')
-rw-r--r--src/mail/ngx_mail.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mail/ngx_mail.h b/src/mail/ngx_mail.h
index c30af35c9..600250820 100644
--- a/src/mail/ngx_mail.h
+++ b/src/mail/ngx_mail.h
@@ -132,7 +132,8 @@ typedef enum {
ngx_pop3_auth_login_username,
ngx_pop3_auth_login_password,
ngx_pop3_auth_plain,
- ngx_pop3_auth_cram_md5
+ ngx_pop3_auth_cram_md5,
+ ngx_pop3_auth_external
} ngx_pop3_state_e;
@@ -142,6 +143,7 @@ typedef enum {
ngx_imap_auth_login_password,
ngx_imap_auth_plain,
ngx_imap_auth_cram_md5,
+ ngx_imap_auth_external,
ngx_imap_login,
ngx_imap_user,
ngx_imap_passwd
@@ -154,6 +156,7 @@ typedef enum {
ngx_smtp_auth_login_password,
ngx_smtp_auth_plain,
ngx_smtp_auth_cram_md5,
+ ngx_smtp_auth_external,
ngx_smtp_helo,
ngx_smtp_helo_xclient,
ngx_smtp_helo_from,
@@ -285,14 +288,16 @@ typedef struct {
#define NGX_MAIL_AUTH_LOGIN_USERNAME 2
#define NGX_MAIL_AUTH_APOP 3
#define NGX_MAIL_AUTH_CRAM_MD5 4
-#define NGX_MAIL_AUTH_NONE 5
+#define NGX_MAIL_AUTH_EXTERNAL 5
+#define NGX_MAIL_AUTH_NONE 6
#define NGX_MAIL_AUTH_PLAIN_ENABLED 0x0002
#define NGX_MAIL_AUTH_LOGIN_ENABLED 0x0004
#define NGX_MAIL_AUTH_APOP_ENABLED 0x0008
#define NGX_MAIL_AUTH_CRAM_MD5_ENABLED 0x0010
-#define NGX_MAIL_AUTH_NONE_ENABLED 0x0020
+#define NGX_MAIL_AUTH_EXTERNAL_ENABLED 0x0020
+#define NGX_MAIL_AUTH_NONE_ENABLED 0x0040
#define NGX_MAIL_PARSE_INVALID_COMMAND 20
@@ -377,6 +382,8 @@ ngx_int_t ngx_mail_auth_login_password(ngx_mail_session_t *s,
ngx_int_t ngx_mail_auth_cram_md5_salt(ngx_mail_session_t *s,
ngx_connection_t *c, char *prefix, size_t len);
ngx_int_t ngx_mail_auth_cram_md5(ngx_mail_session_t *s, ngx_connection_t *c);
+ngx_int_t ngx_mail_auth_external(ngx_mail_session_t *s, ngx_connection_t *c,
+ ngx_uint_t n);
ngx_int_t ngx_mail_auth_parse(ngx_mail_session_t *s, ngx_connection_t *c);
void ngx_mail_send(ngx_event_t *wev);