Mail proxy module - http auth - BUG : bad Auth-Method returned
mdounin at mdounin.ru
Fri Apr 24 14:48:32 MSD 2009
On Fri, Apr 24, 2009 at 02:08:19PM +0400, Igor Sysoev wrote:
> On Fri, Apr 24, 2009 at 12:27:53PM +0400, Maxim Dounin wrote:
> > Hello!
> > On Fri, Apr 24, 2009 at 10:06:44AM +0200, Simon L??caille wrote:
> > > When authenticate mechanism such as apop or cram-md5 are used, the
> > > Auth-Method header sent to backend mismatch the auth method used.
> > [...]
> > > Actually the array ngx_mail_auth_http_method contained less values
> > > than it should.
> > > So the index pointed to the wrong string when the auth_method attribute
> > > is used is several structures.
> > > One occurrence of "plain" was missing.
> > Yes, thank you.
> > To Igor: one more correct aproach would be to move
> > NGX_MAIL_AUTH_LOGIN_USERNAME to the last, as it was originally in
> > my patch.
> But in in this case the "Auth-Method" for NGX_MAIL_AUTH_LOGIN_USERNAME will
> be empty, is not it ?
No. NGX_MAIL_AUTH_LOGIN_USERNAME can't appear in s->auth_method
with current code (and NGX_MAIL_AUTH_LOGIN too, actually), it will
$ grep 'auth_method = ' *
ngx_mail_auth_http_module.c: s->auth_method = NGX_MAIL_AUTH_PLAIN;
ngx_mail_handler.c: s->auth_method = NGX_MAIL_AUTH_CRAM_MD5;
ngx_mail_pop3_handler.c: s->auth_method = NGX_MAIL_AUTH_APOP;
ngx_mail_smtp_handler.c: s->auth_method = NGX_MAIL_AUTH_NONE;
But I actually think it's better to explicitly set appropriate
constant in ngx_mail_auth_http_method as in Simon's patch. Or
even move this array into ngx_mail.h to make sure they will be edited
together in the future.
More information about the nginx