Open PhilPhonic opened 9 years ago
Your log is showing a certificate verification error. So the problem is a certificate not valid, not matching your server name or a non trusted CA. Use "verify_peer" => false, "verify_peer_name" => false to bypass it.
That's weird. I'm quite sure the certificates are valid.. Same error with "verify_peer" => false, "verify_peer_name" => false
Does "SSL3_GET_SERVER_CERTIFICATE" mean, php is trying to use SSL3? Because SSL3 is rejected by my mailserver.
That message will also appear when using TLS 1.x, so that shouldn't be a problem.
Try setting either the openssl.cafile or openssl.capath parameters in your php.ini to your CA file. Maybe it's trusted in web browsers but not yet in the system (for example Startcom).
openssl.cafile is already set. it is a self signed cert.
//Edit: commented ";openssl.cafile" in php.ini and set "verify_peer" => false, "verify_peer_name" => false in imap/config.php it works with this settings. I think this is related to the latest php update cause it worked a few days ago before i updated php
I've got quite a similar error:
28/12/2015 20:13:23 [14606] [DEBUG] [xxx@zzz.yy] [vra7la9o317nf6lq0hsookk77k] BackendIMAP->sendMessage(): SendingMail with smtp
28/12/2015 20:13:23 [14606] [ WARN] [xxx@zzz.yy] [vra7la9o317nf6lq0hsookk77k] /usr/local/www/push/include/Net/Socket.php:177 stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (2)
28/12/2015 20:13:23 [14606] [ WARN] [xxx@zzz.yy] [vra7la9o317nf6lq0hsookk77k] /usr/local/www/push/include/Net/Socket.php:177 stream_socket_client(): Failed to enable crypto (2)
28/12/2015 20:13:23 [14606] [ WARN] [xxx@zzz.yy] [vra7la9o317nf6lq0hsookk77k] /usr/local/www/push/include/Net/Socket.php:177 stream_socket_client(): unable to connect to ssl://10.0.0.3:587 (Unknown error) (2)
28/12/2015 20:13:23 [14606] [ERROR] [xxx@zzz.yy] [vra7la9o317nf6lq0hsookk77k] Net_Socket error:
28/12/2015 20:13:23 [14606] [ERROR] [xxx@zzz.yy] [vra7la9o317nf6lq0hsookk77k] Net_SMTP error: Failed to connect socket:
28/12/2015 20:13:23 [14606] [ERROR] [xxx@zzz.yy] [vra7la9o317nf6lq0hsookk77k] Mail<smtp> error: Failed to connect to ssl://10.0.0.3:587 [SMTP: (code: -1, response: )]
28/12/2015 20:13:23 [14606] [ WARN] [xxx@zzz.yy] [vra7la9o317nf6lq0hsookk77k] /usr/local/www/push/include/Mail/smtp.php:413 Only variable references should be returned by reference (8)
28/12/2015 20:13:23 [14606] [DEBUG] [xxx@zzz.yy] [vra7la9o317nf6lq0hsookk77k] BackendIMAP->sendMessage(): send return value
28/12/2015 20:13:23 [14606] [ INFO] [xxx@zzz.yy] [vra7la9o317nf6lq0hsookk77k] StatusException: BackendIMAP->sendMessage(): The email could not be sent - code: 120 - file: /usr/local/www/push/backend/imap/imap.php:2490
My settings:
$imap_smtp_params = array('host' => 'ssl://10.0.0.3', 'port' => 587, 'auth' => true, 'username' => 'imap_username', 'password' => 'imap_password', 'localhost' => 'push.zzz.yy', 'debug' => true, 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true);
is "openssl.cafile" set in your php.ini ? i had to remove it to get it to work
It was already commented out.
this message is weird:
28/12/2015 20:13:23 [14606] [ WARN] [xxx@zzz.yy] [vra7la9o317nf6lq0hsookk77k] /usr/local/www/push/include/Net/Socket.php:177 stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (2)
have you checked if ssl/tls is configured correctly? you can do this here for example:
I already checked and everything works as expected. Regular IMAP and SMTP work fine on the server thats's why I expected it to have something to do with Z-Push or my PHP / NGINX setup.
@bax- Try to replace "ssl://10.0.0.3" with "sslv3://10.0.0.3" or "tls://10.0.0.3"
I think those errors could happen by various reasons:
Hi, As bax I had: "error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (2)" I had to replace "ssl://" by "tcp://" to get it worked. tls:// didn't work for me
I also had to change it to tcp://
to make it work.
I can't say if it is a problem with PHP, openssl or the fact that SMTPS uses STARTTLS.
I then had a postfix configuration problem (it didn't offer AUTH to mynetworks) but now everything works as expected.
Thank you!
STARTTLS?? That could explain the problem...
STARTTLS uses a TCP/plain connection. From wikipedia
STARTTLS is an extension to plain text communication protocols, which offers a way to upgrade a plain text connection to an encrypted (TLS or SSL) connection
You have to use tcp:// for STARTTLS or non encryption at all. You have to use ssl:// for SSL.
Looking at ports it would be (for SMTP although it depends of the server configuration): 25 - tcp:// 587 - tcp:// 465 - ssl://
@fmbiete exactly. Thanks for the summary. My culprits were the tcp://
and Postfix only allowing auth to external IPs.
Hi,
I'm unable to send mails via backend-combined /w imap and smtp. Any ideas regarding this problem?
This is from backend/imap/config.php
This is my /var/log/mail.log:
This is my z-push.log: