Author Topic: Unable to establish SMTP connection since migrating to version 1.3.9  (Read 289 times)

Offline leake2019

  • Newbie
  • *
  • Posts: 4
Following a PHP upgrade to 7.2 it broke my Roundcube software. I ascertained that Roundcube 1.3.9. was PHP7.2 compatible and so went ahead and upgraded it. Since the upgrade I, along with what appears to many others, are having problems establishing an SMTP connection for outgoing mails (incoming mails are fine). The error I am receiving is a rather meaningless "SMTP Error (-1): Connection to server failed". Following suggestions by Googling the problem I have tried all combinations of ports and ssl/tls configurations but without success. It is worth pointing out that I am able to access my email through an Outlook 2017 client. My email server is a postfix/dovecot combination. I would be greatful to hear from anyone who has experienced my problem and managed to find a solution. 

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,218
It could be an SMTP certificate verification problem. May be try using $config['smtp_conn_options'] to disable cert verification and see what happens.

What version of PHP were you running before 7.2? Certificate verification was enabled by default in version 5.6.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline leake2019

  • Newbie
  • *
  • Posts: 4
Thanks for your reply. Previously I was running under php5.6. Please could you supply me with full 'smtp_conn_options' syntax to disable verification of the cert.

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,218
try something like
Code: [Select]
$config['smtp_conn_options'] = array(
  'ssl' => array(
    'verify_peer_name' => false,
    'verify_peer'      => false,
  ),
);
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline leake2019

  • Newbie
  • *
  • Posts: 4
Unfortunatley it still gives me the same "SMTP Error (-1)" error.

The following was logged in the maillog :
postfix/smtpd[9873]: connect from localhost[127.0.0.1]
postfix/smtpd[9873]: lost connection after UNKNOWN from localhost[127.0.0.1]
postfix/smtpd[9873]: disconnect from localhost[127.0.0.1]

Does RC have its own smtpd log which may shed some light on the problem?

Offline leake2019

  • Newbie
  • *
  • Posts: 4
I have subsequently run a test through the installer.

The following messages appeared in the RC error file in the logs directory:

 [10-May-2019 15:39:02 UTC] PHP Deprecated:  idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated in /var/www/html/roundcubemail/installer/test.php on line 291
[10-May-2019 15:39:02 UTC] PHP Deprecated:  idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated in /var/www/html/roundcubemail/installer/test.php on line 292
[10-May-2019 15:39:02 UTC] PHP Warning:  stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol in /var/www/html/roundcubemail/vendor/pear/net_socket/Net/Socket.php on line 159
[10-May-2019 15:39:02 UTC] PHP Warning:  stream_socket_client(): Failed to enable crypto in /var/www/html/roundcubemail/vendor/pear/net_socket/Net/Socket.php on line 159
[10-May-2019 15:39:02 UTC] PHP Warning:  stream_socket_client(): unable to connect to ssl://xxxx-test.org.uk:25 (Unknown error) in /var/www/html/roundcubemail/vendor/pear/net_socket/Net/Socket.php on line 159
[10-May-2019 15:39:02 UTC] ERROR: stream_socket_client(): unable to connect to ssl://xxxx-test.org.uk:25 (Unknown error) (0)
[10-May-2019 15:39:02 UTC] ERROR: Failed to connect socket: stream_socket_client(): unable to connect to ssl://xxxx-test.org.uk:25 (Unknown error) ()

Offline alec

  • Hero Member
  • *****
  • Posts: 1,142
You can't use ssl on port 25.