The following issue has been CLOSED 
====================================================================== 
http://www.dbmail.org/mantis/view.php?id=237 
====================================================================== 
Reported By:                jnorell
Assigned To:                ilja
====================================================================== 
Project:                    DBMail
Issue ID:                   237
Category:                   POP3 daemon
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             03-Aug-05 16:52 CEST
Last Modified:              23-Aug-05 10:32 CEST
====================================================================== 
Summary:                    pop3 AUTH should return -ERR
Description: 
I ran across exactly the same issue mentioned in
http://twister.fastxs.net/pipermail/dbmail-dev/2004-May/003852.html
recently, while setting up an openwebmail installation,
so I did a bit of looking into it.

>From rfc 1734:

             If the requested 
             authentication mechanism is not supported, the server
             should reject the AUTH command by sending a negative
             response.

dbmail-pop3d doesn't support any AUTH mechanisms, so any requested
should return some -ERR (which 2.0.x and 2.1.x do, but not 1.2.x).
Nowhere does it allow an "AUTH" command without naming a mechanism,
so doing so should also return an -ERR.  So in pop3.c, this section:

        case POP3_AUTH:
                {
                        if (session->state != POP3_AUTHORIZATION_STATE)
                                return pop3_error(session, stream,
                                                  "-ERR wrong command
mode, sir\r\n");
                        /* if we get anything but the naked "auth"
command,
                         * we return an error */
                        if (value != NULL) 
                                return pop3_error(session, stream,
                                                  "-ERR unknown
authorization mechanism\r\n");
                        
                        fprintf((FILE *) stream,
                                "+OK List of supported mechanisms\r\n"
                                "X-NONE-SO-USE-APOP\r\n.\r\n");
                        return 1;
                }

should change to something more like:

        case POP3_AUTH:
                {
                        if (session->state != POP3_AUTHORIZATION_STATE)
                                return pop3_error(session, stream,
                                                  "-ERR wrong command
mode, sir\r\n");
                        fprintf((FILE *) stream,
                                "-ERR AUTH command not supported.\r\n");
                        return 1;
                }


1.2.x source is almost that already, just need to change the
+OK message to the above -ERR message.  That should fix
openwebmail and probably some others.
====================================================================== 

---------------------------------------------------------------------- 
 ilja - 15-Aug-05 13:24  
---------------------------------------------------------------------- 
The RFC does indeed state that a bare AUTH command without any parameters
isn't valid and should return a -ERR response. However, from looking
around for some info, I've found that MS Outlook does use AUTH to get a
list of authentication mechanisms that the server supports. 

What is the problem with keeping the code as it is?

Ilja 

---------------------------------------------------------------------- 
 jnorell - 16-Aug-05 00:38  
---------------------------------------------------------------------- 
The problem is dbmail's non-compliant behavior breaks some
clients (not suprising).  It's unusable for openwebmail
(which I would argue is almost as much openwebmail's fault
for it's method of processing POP3 responses), and the
same issue came up in the past with netscape (where a
colleague just patched his source locally and didn't file
a bug .. was in 2.0 series).

dbmail returnning -ERR there is the right thing to do,
which itsself is enough to fix it in my opinion, and
should not cause a problem with Outlook's non-compliant
behavior. 

---------------------------------------------------------------------- 
 ilja - 16-Aug-05 10:14  
---------------------------------------------------------------------- 
Before changing this behaviour, we should test if it still works for
Outlook then. Although Outlook's behaviour isn't right according to the
RFC, we shouldn't break it. If it doesn't break Outlook, I see no reason
to keep the code as it is.

Anyway, I don't have Outlook here, can anybody test this? 

---------------------------------------------------------------------- 
 ilja - 16-Aug-05 10:54  
---------------------------------------------------------------------- 
I've attached a file (pop3.diff)  with the diff that should be applied to
change this behaviour 

---------------------------------------------------------------------- 
 jnorell - 16-Aug-05 16:43  
---------------------------------------------------------------------- 
I patched our pop3 daemons about 2 weeks back, when I filed this bug, and
our userbase is probably 85+% Outlook Express, and I'd guess maybe 5-10%
Outlook, and I've heard no complaints.  This is how ours reports:

$ telnet mail.kci.net 110
Trying 64.187.64.9...
Connected to mail1.kci.net.
Escape character is '^]'.
+OK DBMAIL pop3 server ready to rock
<[EMAIL PROTECTED]>
AUTH
-ERR AUTH not supported, use USER or APOP
quit
+OK see ya later
Connection closed by foreign host. 

---------------------------------------------------------------------- 
 ilja - 16-Aug-05 16:48  
---------------------------------------------------------------------- 
In that case I see no objection in changing the source. I'll go ahead and
fix it in SVN tomorrow. 

---------------------------------------------------------------------- 
 ilja - 23-Aug-05 10:32  
---------------------------------------------------------------------- 
resolved in SVN for 1.2.x, 2.0.x, and 2.1.x 

---------------------------------------------------------------------- 
 ilja - 23-Aug-05 10:32  
---------------------------------------------------------------------- 
closed as fixed 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
03-Aug-05 16:52 jnorell        New Issue                                    
15-Aug-05 13:24 ilja           Note Added: 0000824                          
16-Aug-05 00:38 jnorell        Note Added: 0000825                          
16-Aug-05 10:14 ilja           Note Added: 0000826                          
16-Aug-05 10:53 ilja           File Added: pop3.diff                        
16-Aug-05 10:54 ilja           Note Added: 0000827                          
16-Aug-05 16:43 jnorell        Note Added: 0000829                          
16-Aug-05 16:48 ilja           Note Added: 0000830                          
16-Aug-05 16:48 ilja           Status                   new => assigned     
16-Aug-05 16:48 ilja           Assigned To               => ilja            
23-Aug-05 10:32 ilja           Status                   assigned => resolved
23-Aug-05 10:32 ilja           Resolution               open => fixed       
23-Aug-05 10:32 ilja           Note Added: 0000870                          
23-Aug-05 10:32 ilja           Status                   resolved => closed  
23-Aug-05 10:32 ilja           Note Added: 0000871                          
======================================================================

Reply via email to