OAUTHBEARER and XOAUTH2 support for nginx mail proxy module

Robert Mueller robm at fastmailteam.com
Mon May 13 05:40:22 UTC 2024


Hi

I have a patch that adds OAUTHBEARER and XOAUTH2 support to the nginx mail proxy module. We've now been using a slightly updated version of the patch for well over a year at fastmail.com and it's been stable. 

As well as the implementation patch, I also have:
1. A set of patches against the test suite to test the new code fairly well
2. A patch to the test suite to optionally allow running nginx under valgrind to test for any unexpected memory accesses, leaks, etc
3. A small patch that makes nginx mail proxy run clean under valgrind
4. A small fix to the IMAP mail proxy module to correctly clear the tag if there's an incomplete next line after a failure

One thing I don't have is a patch to the documentation. The auth server may return an additional optional response
header `Auth-Error-Sasl`. It's expected in the auth failure case that the backend auth server will generate a base64 encoded JSON object that conforms to the error reporting in https://datatracker.ietf.org/doc/html/rfc7628#section-3.2.2 in this header.

# TEST_NGINX_VALGRIND=1 prove mail_*
mail_auth_sasl.t ............ ok     
mail_auth_wait.t ............ ok   
mail_capability.t ........... ok     
mail_error_log.t ............ ok     
mail_imap_ssl.t ............. ok     
mail_imap.t ................. ok     
mail_max_errors.t ........... ok     
mail_pop3.t ................. ok     
mail_proxy_protocol.t ....... ok     
mail_proxy_smtp_auth.t ...... ok   
mail_proxy_timeout.t ........ ok     
mail_resolver.t ............. ok     
mail_smtp_greeting_delay.t .. ok   
mail_smtp.t ................. ok     
mail_smtp_xclient.t ......... ok   
mail_ssl_conf_command.t ..... ok   
mail_ssl_session_reuse.t .... ok   
mail_ssl.t .................. ok     
All tests successful.
Files=18, Tests=318, 71 wallclock secs ( 0.08 usr  0.02 sys + 26.03 cusr  1.36 csys = 27.49 CPU)
Result: PASS

Cheers

Rob Mueller
robm at fastmailteam.com



More information about the nginx-devel mailing list