Roundcube Community Forum

 

Unable to send emails since update to Debian 12 [Solved]

Started by houghi, July 16, 2023, 05:50:32 PM

Previous topic - Next topic

houghi

I have updated to Debian 12 and now I am unable to send emails. I have tried searching for a solution online and in this forum, but did not find a solution.

I am able to send mails from the machine 'data' that has the servers using mailx, so the sending of email works. I am also able to receive and read email.

The error I get is : SMTP Error (): Connection to server fail
The logs give me :

Quote
[16-Jul-2023 21:31:27 +0000]: <elf9jfp7> PHP Error: Failed to connect socket: Connection refused (POST /?_task=mail&_unlock=loading1689543087661&_framed=1&_action=send)
[16-Jul-2023 21:31:27 +0000]: <elf9jfp7> SMTP Error: Connection failed:  (Code: -1) in /usr/share/roundcube/program/lib/Roundcube/rcube.php on line 1787 (POST /?_task=mail&_unlock=loading1689543087661&_framed=1&_action=send)

I have no idea where it tries to connect to. I get no errors for anything in my logfiles.

The smtp settings in default.inc.php

Quote
$config['smtp_log'] = true;
$config['smtp_debug'] = false;
$config['smtp_host'] = 'localhost:25';
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['smtp_auth_type'] = null;
$config['smtp_auth_cid'] = null;
$config['smtp_auth_pw'] = null;
$config['smtp_xclient_login'] = false;
$config['smtp_xclient_addr'] = false;
$config['smtp_helo_host'] = '';
$config['smtp_timeout'] = 0;
$config['smtp_conn_options'] = null;

Any help would be appreciated.


As an extra: I also get a bunch of the following errors in the logs. Just included it in case it is related:
Quote[16-Jul-2023 21:32:03 +0000]: PHP Error: Failed to load plugin file /var/lib/roundcube/plugins/hide_blockquote/hide_blockquote.php in /usr/share/roundcube/program/lib/Roundcube/rcube_plugin_api.php on line 193 (POST /?_task=mail&_action=refresh)
[16-Jul-2023 21:32:03 +0000]: PHP Error: Failed to load plugin file /var/lib/roundcube/plugins/markasjunk/markasjunk.php in /usr/share/roundcube/program/lib/Roundcube/rcube_plugin_api.php on line 193 (POST /?_task=mail&_action=refresh)
[16-Jul-2023 21:33:03 +0000]: PHP Error: Failed to load plugin file /var/lib/roundcube/plugins/archive/archive.php in /usr/share/roundcube/program/lib/Roundcube/rcube_plugin_api.php on line 193 (POST /?_task=mail&_action=refresh)

alec

localhost:25 is probably not what you wanna use. tls://localhost:587 is more common. As for the errors in log, it might be wrong permissions on specified files/folders.

houghi

Thanks. This pointed me in the right direction and solved the issue.

I set it to 587. The port was NOT open, but 25 was. No idea why it was looking at port 587, even though it said port 25. Having no further error message did not really help on looking for a solution.
Port 587 was not open, so I looked up on how to do that in postfix. That was basically uncommenting the line

submission inet n — n — — smtpd

and then restart. Now it works again.

I have been updating Debian over the years. So I was thinking that perhaps the settings were no  longer correct and in the wrong location. I copied the /usr/share/roundcube/plugins/ over to /var/lib/roundcube/plugins/ and the errors stopped.


Again thanks for giving me the nudge in the right direction.