# Mail proxy module - http auth - BUG : bad Auth-Method returned

**URL:** <https://www.ruby-forum.com/t/mail-proxy-module-http-auth-bug-bad-auth-method-returned/168075>\
**Category:** NGINX\
**Created:** [May 15, 2009, 3:19pm UTC](https://www.ruby-forum.com/t/mail-proxy-module-http-auth-bug-bad-auth-method-returned/168075 "2009-05-15T15:19:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_LSSSScaille](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@Simon\_LSSSScaille](https://www.ruby-forum.com/u/Simon_LSSSScaille)\
**Post date:** [May 15, 2009, 3:19pm UTC](https://www.ruby-forum.com/t/mail-proxy-module-http-auth-bug-bad-auth-method-returned/168075/1 "2009-05-15T15:19:37Z")

</div>

I forgot to say that this bug is present too in the stable release (i.e  
nginx-0.6.36)  
When authenticate mechanism such as apop or cram-md5 are used, the  
Auth-Method header sent to backend mismatch the auth method used.

e.g With cram-md5 mechanism  
GET / HTTP/1.0  
Host: localhost  
Auth-Method: none  
Auth-User: login  
Auth-Pass: 3874a80406c560adb1c11853c266a44e  
Auth-Salt: [2086279695.1240477831@localhost](mailto:2086279695.1240477831@localhost)  
Auth-Protocol: imap  
Auth-Login-Attempt: 1  
Client-IP: 127.0.0.1

e.g With apop mechanism  
GET / HTTP/1.0  
Host: localhost  
Auth-Method: cram-md5  
Auth-User: login  
Auth-Pass: password  
Auth-Protocol: pop3  
Auth-Login-Attempt: 1  
Client-IP: 127.0.0.1

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.

Here comes the patch :

— ngx\_mail\_auth\_http\_module.c 2009-05-15 14:58:39.000000000 +0200  
+++ old 2009-05-15 14:58:35.000000000 +0200  
@@ -140,7 +140,6 @@  
static ngx\_str\_t ngx\_mail\_auth\_http\_method[] = {  
ngx\_string(“plain”),  
ngx\_string(“plain”),

- ngx\_string(“plain”),  
ngx\_string(“apop”),  
ngx\_string(“cram-md5”)  
};

–  
(Logo EmisFr)  
_Simon LECAILLE_  
EmisFR  
/Infogérance, Sécurité et Serveurs, Développements métier et spécifiques/  
10 rue Mazagran, 54000 NANCY, France

> **[ZENITIQUE - La zénitude informatique - Votre service informatique](https://zenitique.fr/)**
>
> Parce que l’informatique est votre outil de travail quotidien, notre métier est de faire en sorte que cet outil soit toujours opérationnel.

Tel/Fax.: +33.3 83 32 25 75
