Skip Menu |

This queue is for tickets about the Net-SMTP-TLS-ButMaintained CPAN distribution.

Report information
The Basics
Id: 68403
Status: resolved
Priority: 0/
Queue: Net-SMTP-TLS-ButMaintained

People
Owner: Nobody in particular
Requestors: cbaker [...] coexpansive.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Possible TLS bug
Date: Mon, 23 May 2011 22:51:42 +0100
To: <bug-Net-SMTP-TLS-ButMaintained [...] rt.cpan.org>
From: "Chris Baker" <cbaker [...] coexpansive.com>
Hi, I am contacting an SMTP mail server which works with my normal mail clients via TLS but fails with: Email::Sender::Transport::SMTP::TLS calling Net::SMTP::TLS::ButMaintained v 0.16 After a little debugging I believe the problem is as follows: When contacted initially via the ->new call the $me->_response() gets the rsp = 220 it needs to continue. However, this particular SMTP server is sending 3 lines in response informing the world it will not accept spam, each with a 220 code and continuation separator. ->new is only processing the first of these three, leaving 2 of the 220 responses on the socket. When we get to the EHLO, you issue the command and then check for a 250 to confirm a response but grab the second 220 from socket and the routine croaks. I have patched my version in ->new with a one line while loop to discard 220 continuation messages, similar to your code in the hello response. I hope this makes sense and I have read the sequence correctly. It may also be the multi-line introduction from the server is not RFC compliant for all I know. Either way, I am appreciative for the perl support community, for cpan, and to you for providing this routine in the first place so I thought I'd try and contribute my tuppence by reporting this. Kind regards Chris Baker
Hi Chris, I'll be very glad to apply it if you can provide me your changed code or the debug lines because I can't test it with gmail for your case. Thanks On Mon May 23 17:52:01 2011, cbaker@coexpansive.com wrote: Show quoted text
> Hi, > > I am contacting an SMTP mail server which works with my normal mail > clients > via TLS but fails with: > > Email::Sender::Transport::SMTP::TLS calling > Net::SMTP::TLS::ButMaintained v > 0.16 > > After a little debugging I believe the problem is as follows: > > When contacted initially via the ->new call the $me->_response() gets > the > rsp = 220 it needs to continue. > > However, this particular SMTP server is sending 3 lines in response > informing the world it will not accept spam, each with a 220 code and > continuation separator. > > ->new is only processing the first of these three, leaving 2 of the > 220 > responses on the socket. > > When we get to the EHLO, you issue the command and then check for a > 250 to > confirm a response but grab the second 220 from socket and the routine > croaks. > > I have patched my version in ->new with a one line while loop to > discard 220 > continuation messages, similar to your code in the hello response. > > I hope this makes sense and I have read the sequence correctly. It may > also > be the multi-line introduction from the server is not RFC compliant > for all > I know. > > Either way, I am appreciative for the perl support community, for > cpan, and > to you for providing this routine in the first place so I thought I'd > try > and contribute my tuppence by reporting this. > > Kind regards > > Chris Baker > >
Subject: Re: [rt.cpan.org #68403] Possible TLS bug
Date: Wed, 25 May 2011 00:17:17 +0100
To: <bug-Net-SMTP-TLS-ButMaintained [...] rt.cpan.org>
From: "Chris Baker" <cbaker [...] coexpansive.com>
Hi Thanks very much for the quick response. I caution that when I learned to program the great IDE controversy was vi versus emacs and my debugger of choice is the print statement. With that disclaimer made, here is my change: In "sub new" at the start of ButMaintained.pm around line 32 I changed: <<<<<< # read the line immediately after connecting my ( $rsp, $txt ) = $me->_response(); if ( not $rsp == 220 ) { croak "Could not connect to SMTP server: $host $txt\n"; } to: Show quoted text
>>>>>>
# read the line immediately after connecting my ( $rsp, $txt, $more ) = $me->_response(); if ( not $rsp == 220 ) { croak "Could not connect to SMTP server: $host $txt\n"; } # empty the socket of any continuation lines while ( $more eq '-' ) { ( $rsp, $txt, $more ) = $me->_response(); } I'm not competent to know if there is any useful info being discarded here, but from my reading it seemed only the 220 was useful so discarding the rest seemed reasonable and my host does now login. Cheers Chris
Hi, Thanks for the code. http://fayland.org/CPAN/Net-SMTP-TLS-ButMaintained-0.17.tar.gz is on the way CPAN.