Issue 105669 - OOo does not wait for server response when sending E-mailmerge with AUTH-CRAMMD5
Summary: OOo does not wait for server response when sending E-mailmerge with AUTH-CRAMMD5
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: configuration (show other issues)
Version: OOo 3.1
Hardware: PC Windows XP
: P3 Trivial (vote)
Target Milestone: ---
Assignee: h.ilter
QA Contact: issues@sw
URL:
Keywords:
: 112804 (view as issue list)
Depends on:
Blocks:
 
Reported: 2009-10-07 07:27 UTC by pgru
Modified: 2017-05-20 11:41 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
replacement for testing (11.40 KB, text/plain)
2009-11-02 12:21 UTC, caolanm
no flags Details
force the encoding as ascii to get hmac to play fair (1.21 KB, patch)
2009-11-02 12:21 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description pgru 2009-10-07 07:27:54 UTC
I was trying to send a serial letter and Open Office does not wait for the
server response and sends "mail from", then the server closes the connection
because OO does not perform accordingly to RFC. Please see below the correct
CRAM-MD5 Authentification 


Log:
T 86.59.10.180:54756 -> 89.207.144.23:25 [A]
  ..):(.                                                                       
                                                                               
        
-> openoffice verbindet sich zum Server
T 89.207.144.23:25 -> 86.59.10.180:54756 [AP]
  220 p0006.netstorage.at ESMTP..                                              
                                                                               
        
<- Server antwortet
T 86.59.10.180:54756 -> 89.207.144.23:25 [AP]
  ehlo if-PC.xip.at..                                                          
                                                                               
        
-> openoffice melde sich
T 89.207.144.23:25 -> 86.59.10.180:54756 [AP]
  250-p0006.netstorage.at..                                                    
                                                                               
        
<- Server antwortet
T 86.59.10.180:54756 -> 89.207.144.23:25 [A]
  ....z.                                                                       
                                                                               
        
-> openoffice
T 89.207.144.23:25 -> 86.59.10.180:54756 [AP]
  250-AUTH=LOGIN CRAM-MD5 PLAIN..250-AUTH LOGIN CRAM-MD5
PLAIN..250-STARTTLS..250-PIPELINING..250 8BITMIME..                            
                               
<- Server schlaegt Authentifizierungsvarianten vor
T 86.59.10.180:54756 -> 89.207.144.23:25 [AP]
  AUTH CRAM-MD5..                                                              
                                                                               
        
-> openoffice waehlt CRAM-MD5
T 89.207.144.23:25 -> 86.59.10.180:54756 [AP]
  334 PDMyNDMuMTI1NDg0MTE2NkBwMDAwNi5uZXRzdG9yYWdlLmF0Pg==..                   
                                                                               
        
<- Server sendet Key
T 86.59.10.180:54756 -> 89.207.144.23:25 [A]
  ...db.                                                                       
                                                                               
        
-> openoffice sollte auf den Key antworten
   und das Server-OK abwarteten.
T 86.59.10.180:54756 -> 89.207.144.23:25 [AP]
  mail FROM:<test1@cimmic.com>..                                               
                                                                               
        
-> openoffice wartet nicht die Serverantwort ab und
   sendet "mail From"
T 89.207.144.23:25 -> 86.59.10.180:54756 [AP]
  535 malformed input..                                                        
                                                                               
        
<- Server schliesst die Verbindung da openoffice sich nicht RFC konform verhaelt.

So sollte eine korrekte CRAM-MD5 Authentifizierung aussehen:
Server: 220 mail.zeitform.de ESMTP
Client: EHLO my.host.com
Server: 250-mail.zeitform.de
        250-AUTH LOGIN CRAM-MD5 PLAIN
        250-AUTH=LOGIN CRAM-MD5 PLAIN
        250-PIPELINING
        250 8BITMIME
Client: AUTH CRAM-MD5
Server: 334 PDQwMzYuMTA3NjMyNDM4MUBndWlsZGVuc3Rlcm4uemVpdGZvcm0uZGU+
Client: YmVudXR6ZXJAemVpdGZvcm0uZGUgMmQ5MzczZGZkOTFlMmU2NjMxYzhlMWFkNjk4MzRmYWQ=
Server: 235 ok, go ahead (#2.0.0)

Sie koennen hier diesen Bug bei openoffice reporten:
http://www.openoffice.org/project/qa/issue_handling/pre_submission.html


T 86.59.10.180:54756 -> 89.207.144.23:25 [AP]
  rset..                                                                       
                                                                               
        
#
T 89.207.144.23:25 -> 86.59.10.180:54756 [AP]
  250 flushed..                                                                
                                                                               
        
#
T 86.59.10.180:54756 -> 89.207.144.23:25 [A]
  ......
Comment 1 michael.ruess 2009-10-07 08:24:31 UTC
This is not a P1 issue. Please read
http://qa.openoffice.org/issue_handling/pre_submission.html and
http://www.openoffice.org/scdocs/ddIssues_EnterModify.html#priority

MRU->HI: please have a look.
Comment 2 eric.savary 2009-10-19 11:33:08 UTC
Reassigned to HI
Comment 3 pgru 2009-10-19 11:51:46 UTC
any update on this issue would be appreciated
Comment 4 eric.savary 2009-10-23 12:38:48 UTC
Reassigned to HI
Comment 5 h.ilter 2009-10-23 14:16:16 UTC
@cmc: AFAIK python doesn't support it. You know more?
Comment 6 caolanm 2009-10-26 13:03:14 UTC
You can try and example debugging output in the mailmerge script, i.e. change
dbg = False
to
dbg = True
in mailmerge.py

Its a fairly simple script. Not sure if the problem is one of the script or one
of the base python implementation itself. I suspect the latter.
Comment 7 pgru 2009-10-26 14:05:45 UTC
I changed that, where can I see the debug info now?
Comment 8 caolanm 2009-10-26 18:03:22 UTC
ah, this was windows not Linux, so the debugging output doesn't appear in that
case. Would have to add some logging to file code to get at the output.
Comment 9 pgru 2009-10-27 18:02:53 UTC
this is the error message:

<type 'exceptions.IOError'>: (9, 'Bad file descriptor'), traceback follows
  C:\Program Files\OpenOffice.org
3\Basis\program\python-core-2.6.1\lib\smtplib.py:302 in function send() [if
self.debuglevel > 0: print>>stderr, 'send:', repr(str)]
  C:\Program Files\OpenOffice.org
3\Basis\program\python-core-2.6.1\lib\smtplib.py:478 in function data()
[self.send(q)]
  C:\Program Files\OpenOffice.org
3\Basis\program\python-core-2.6.1\lib\smtplib.py:710 in function sendmail()
[(code,resp) = self.data(msg)]
  C:\Program Files\OpenOffice.org 3\Basis\program\mailmerge.py:193 in function
sendMailMessage() [self.server.sendmail(sendermail, truerecipients,
msg.as_string())]
Comment 10 caolanm 2009-10-27 21:30:23 UTC
that last error looks more like that there's an error in writing to stderr when
logging is enabled. Try with

                if dbg:
                        self.server.set_debuglevel(1)

commented out from mailmerge.py to see if it gets a little further
Comment 11 caolanm 2009-11-02 11:04:47 UTC
Can I get the setting in tools->options->openoffice.org->writer->Mail merge, i.e.

a) SMTP port
b) SSL on or off
Server Authentication
c) SMTP requires authentication
d) outgoing requires separate authentication or outgoing uses the same
authentication as incoming.
Comment 12 pgru 2009-11-02 11:28:04 UTC
hi, 
adress: test@cimmic.com
smtp: mail.cimmic.com
pwd: cimmic
Comment 13 h.ilter 2009-11-02 11:42:17 UTC
Just cc myself
Comment 14 h.ilter 2009-11-02 11:43:17 UTC
.
Comment 15 caolanm 2009-11-02 12:15:11 UTC
response = user + " " + hmac.HMAC(password, challenge).hexdigest()

We're passing down unicode passwords and challenges, and HMAC doesn't like that
Comment 16 caolanm 2009-11-02 12:21:21 UTC
Created attachment 65857 [details]
replacement for testing
Comment 17 caolanm 2009-11-02 12:21:48 UTC
Created attachment 65858 [details]
force the encoding as ascii to get hmac to play fair
Comment 18 caolanm 2009-11-02 12:23:56 UTC
reproduced under linux, above fix works there. Will check on windows now
Comment 19 caolanm 2009-11-02 12:30:57 UTC
looks good. Committed to pythonssl
Comment 20 pgru 2009-11-03 12:51:29 UTC
works perfectly, thank you very much!
Comment 21 caolanm 2009-12-01 13:14:28 UTC
cmc->hi: Assuming an available Fedora box (where I know the default
configuration has sendmail running, and will default to CRAM-MD5). Then to test,
add a test-user as root with

$ saslpasswd2 -c atest
fill in some password
fill it in again
$ sasldblistusers2
atest@HOSTNAME

in tools->openoffice.org->writer->email merge fill in those details e.g.
HOSTNAME port 25 for smtp settings, server authentication as "requires
authentication", and atest@HOSTNAME as username, and the password. Test settings
should now work, while previously they would fail.
Comment 22 h.ilter 2009-12-18 11:35:20 UTC
Verified with cws pythonssldedux = ok
Comment 23 eric.savary 2010-06-30 00:50:29 UTC
*** Issue 112804 has been marked as a duplicate of this issue. ***