Re: fsockopen in phpmailer and tls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2008-09-06 at 14:53 -0400, Robert Cummings wrote:
> On Sat, 2008-09-06 at 14:38 -0400, Larry Brown wrote:
> > On Sat, 2008-09-06 at 14:06 -0400, Robert Cummings wrote: 
> > > On Sat, 2008-09-06 at 14:02 -0400, Larry Brown wrote:
> > > >
> > > > OK.  So I broke down and re-created my mail server due to its age.  I
> > > > am
> > > > now running the latest sendmail and it is still failing.  The message
> > > > in
> > > > the sendmail log is 
> > > > 
> > > > "...<remoteMachineIP>] did not issue MAIL/EXPN/VRFY/ETRN during
> > > > connection to MTA"
> > > > 
> > > > A little research is leading me to believe the client (php client
> > > > script) opened the socket but didn't send anything.  Now the
> > > > certificate
> > > > that I'm using for the server is a self signed certificate.  Evolution
> > > > asked if I wanted to accept the certificate when I first connected and
> > > > I
> > > > did.  After which it worked fine.  Is there a setting I must enable to
> > > > accept unknown certificates when a site is first connected to?
> > > > 
> > > > Any other ideas?
> > > 
> > > Sounds like an email client issue and most likely may differ for each
> > > and every one of them.
> > > 
> > > Cheers,
> > > Rob.
> > > -- 
> > 
> > 
> > I am the email client.  In this case which is what I'm trying to figure
> > out.  The script fails with the original string I posted:
> > 
> > "PHP Warning:  fsockopen(): SSL operation failed with code 1. OpenSSL
> > Error messages:
> > error:1408F10B:SSL routines:func(143):reason(267)
> > in /opt/scriptsMain/include/class.smtp.php on line 122"
> > 
> >   I'm using the smtpmailer class and it is trying to execute fsockopen.
> > So to simplify troubleshooting I used the following code:
> > 
> > if(fsockopen("tls://<serverName>",25,$errno,$errstr, 30))
> > {
> > 	echo "Made it!\n";
> > }
> > else
> > {
> > 	echo "Nope!\n";
> > 	echo $errno."\n";
> > 	echo $errstr."\n";
> > }
> > 
> > I get the above warning from PHP and $errno has 0 as a value and there
> > is $errstr is empty.
> > 
> > PHP is v5.2.6 and phpinfo shows that ssl and tls support are both
> > compiled in.
> 
> Ah, I see, I misunderstood when you mentioned Evolution. Sorry, I can't
> really help you, you're in foreign territory to me :/
> 
> Cheers,
> Rob.

For posterity and to thank Robert...

I have determined that the mechanism in PHP does not allow you to
specify tls for a connection that initially starts off as a clear text
connection.  When you set up sendmail to use tls for smtp auth it allows
a connecting client to send connection details specifying tls at which
point it will start talking tls.  PHP expects the connection to be
dedicated tls.  So if you specify in sendmail to use a separate port for
tls and you point PHP to that port it works like a champ.

Thanks to Robert for at least giving it a shot.  Hopefully this will be
helpful to the next poor soul...

Larry



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux