I had the same issue and tried everything I could find, only to figure I was editing the wrong configuration file : the changes in config/default.inc.php
didn't help because I had to edit config/config.inc.php
instead. It worked once I updated $config['smtp_port']
to the right port (depends on your mail server configuration) in the right file.
FWIW, here is a procedure which might help debugging (it surely did for me, showing that my changes weren't taken into account) : in program/lib/Roundcube/rcube_smtp.php
, replace the following line (line 134 in Roundcube 1.4.7)
$this->response[] = "Connection failed: " . $result->getMessage();
by
$this->response[] = "Connection failed: " . implode(", ", $CONFIG);
(check about 70 lines above to find the definition of the fields), then restart the Apache server, try to send an email and check logs/errors.log
.
For the sake of SEO, here is the generic error that was shown in logs/errors.log
:
PHP Error: Invalid response code received from server (POST /roundcube/?_task=mail&_unlock=loading1613339144872&_framed=1&_lang=en_US&_action=send)
SMTP Error: Connection failed: Invalid response code received from server (POST /roundcube/?_task=mail&_unlock=loading1613339144872&_framed=1&_lang=en_US&_action=send)
Furthermore, after this correction I couldn't connect back after logout, I had to configure $config['default_port'] = 143
for IMAP. For debugging one can use the same trick as above in file program/lib/Roundcube/rcube_imap.php
, line 200 (beware that $config
is lowcase in this file).