Roundcube Community Forum

Release Support => Pending Issues => Topic started by: Tron on November 25, 2019, 08:49:16 PM

Title: SOLVED: SMTP issues after upgrading from 1.2.4 to 1.4.1
Post by: Tron on November 25, 2019, 08:49:16 PM
Hello Everybody!

My roundcube installation (1.2.4) was running fine for a very long time, but I thought an update would be in order, so I upgraded to 1.4.1.
Now SMTP refuses to work. I understand that Roundcube now uses SMTP instead of the old php-Mail function. However, after searching through half the internet, I can't get it to work and always get "SMTP Error (-1): Connection to server failed."

- SMTP is working on the machine (Debian 10, running postfix on localhost as the IMAP server is, too), and accepts mail, from localhost even without authentification. There are no errors in the mail log.
- Roundcube is working, just not sending mail.

I added this to config.inc.php:

Code: [Select]
$config['smtp_server'] = '127.0.0.1';
No success. As some report it working, I experimented with additional settings:

Code: [Select]
$config['smtp_port'] = 25;
$config['smtp_user'] = '%u';
$config['smtp_server'] = '%p';

No success, though. The error the Roundcube log gives me is:

Code: [Select]
[25-Nov-2019 19:38:38 America/Chicago] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /var/www/roundcube/vendor/pear-pear.php.net/Mail_Mime/Mail/mimePart.php on line 314
[25-Nov-2019 19:38:38 -0600]: <lucombsr> PHP Error: php_network_getaddresses: getaddrinfo failed: Name or service not known (POST /roundcube/?_task=mail&_unlock=loading1574732319717&_framed=1&_action=send)
[25-Nov-2019 19:38:38 -0600]: <lucombsr> PHP Error: Failed to connect socket: php_network_getaddresses: getaddrinfo failed: Name or service not known (POST /roundcube/?_task=mail&_unlock=loading1574732319717&_framed=1&_action=send)
[25-Nov-2019 19:38:38 -0600]: <lucombsr> SMTP Error: Connection failed: Failed to connect socket: php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/roundcube/program/lib/Roundcube/rcube.php on line 1689 (POST /roundcube/?_task=mail&_unlock=loading1574732319717&_framed=1&_action=send)

Searching for those error messages did not yield much useful, either. It somehow fails on a network lookup (that's why I replaced 'localhost' with the IP), but did not change anything. Is there a php module missing or something?

Any ideas where I might have to look for?

Thanks!
Title: Re: SMTP issues after upgrading from 1.2.4 to 1.4.1
Post by: SKaero on November 26, 2019, 05:10:16 PM
That error would indicate that PHP doesn't know what server localhost/127.0.0.1 is. I think the only time I've seen that error is the host file on the server isn't setup correctly.
Title: Re: SMTP issues after upgrading from 1.2.4 to 1.4.1
Post by: Tron on November 26, 2019, 05:35:16 PM
Hmm, that would apply if it can't resolve "localhost" but the IP itself?
Besides, the /etc/hosts file is correct. At least every other application has no problems with it.
Title: Re: SMTP issues after upgrading from 1.2.4 to 1.4.1
Post by: SKaero on November 26, 2019, 08:45:14 PM
Fair point. How did you upgrade between 1.2.4 and 1.4.1?
Title: Re: SMTP issues after upgrading from 1.2.4 to 1.4.1
Post by: Tron on November 26, 2019, 09:23:23 PM
Downloaded the tar file, unpacked it somewhere and used the upgrade script pointing it to my roundcube directory.
I think that is the preferred way (and has worked flawlessly on earlier upgrades).

I might add that I use a manual installation, when I started with Roundcube years ago it was not part of Debian. Now there is a package for it and I might just move my installation somewhere safe and install the package, even though it is only at 1.3.8, I believe.
But I'd rather find out why SMTP doesn't work.
It can't be a ssl/authentication issue as local users can deliver mail without credentials.
Title: Re: SMTP issues after upgrading from 1.2.4 to 1.4.1
Post by: SKaero on November 27, 2019, 06:00:29 PM
Did you use the complete or dependent version?
Title: SOLVED: SMTP issues after upgrading from 1.2.4 to 1.4.1
Post by: Tron on November 27, 2019, 06:32:47 PM
dependent, I figured the dependencies were already there as the installation worked flawlessly before.

But I finally figured out why it did not work. The dumbest mistake from cut'n'paste, and it's even right there in my first post:

Code: [Select]
$config['smtp_server'] = '%p';
which was intended to be

Code: [Select]
$config['smtp_pass'] = '%p';
So smtp_server was there twice and it looks like Roundcube then took the second instance (first was overwritten) and tried to connect to the smtp-server called "password".

That, unsurprisingly, had to fail, and explains why nothing turned up in the postfix logs...

Thanks!