Can't send emails via Roundcube but can via email client

danv8086

Verified User
Joined
Jan 3, 2023
Messages
5
I'm hoping someone can help? One of my customers got in touch today to say they couldn't send emails. Upon looking into it, I found out that emails will not send via Roundcube. I've tried ./build roundcube, ./build rewriteconfs, created a custom config.inc.php file in /custom/roundcube. Tried different ports, tried forcing roundcube to use SSL, multiple reboots.

Can confirm it's across all accounts.

I checked the roundcube log and found this:

Code:
[03-Jan-2023 22:40:49 +0000]: <jr8uj9kc> PHP Error: Invalid response code received from server (POST /roundcube/?_task=mail&_unlock=loading1672785349497&_framed=1&_action=send)
[03-Jan-2023 22:40:49 +0000]: <jr8uj9kc> SMTP Error: Connection failed:  (Code: -1) in /var/www/html/roundcubemail-1.6.0/program/lib/Roundcube/rcube.php on line 1795 (POST /roundcube/?_task=mail&_unlock=loading1672785349497&_framed=1&_action=send)
[03-Jan-2023 22:41:48 +0000]: <jr8uj9kc> PHP Error: Request security check failed (POST /webmail/?_task=mail&_action=refresh)
[03-Jan-2023 22:42:48 +0000]: <jr8uj9kc> PHP Error: Request security check failed (POST /webmail/?_task=mail&_action=refresh)
[03-Jan-2023 22:43:48 +0000]: <jr8uj9kc> PHP Error: Request security check failed (POST /webmail/?_task=mail&_action=refresh)
[03-Jan-2023 22:44:49 +0000]: <jr8uj9kc> PHP Error: Request security check failed (POST /webmail/?_task=mail&_action=refresh)
[03-Jan-2023 22:45:49 +0000]: <jr8uj9kc> PHP Error: Request security check failed (POST /webmail/?_task=mail&_action=refresh)
[03-Jan-2023 22:46:50 +0000]: <jr8uj9kc> PHP Error: Request security check failed (POST /webmail/?_task=mail&_action=refresh)
[03-Jan-2023 22:47:50 +0000]: <jr8uj9kc> PHP Error: Request security check failed (POST /webmail/?_task=mail&_action=refresh)

Spent a good few hours messing around with this now, appreciate any help I can get. It's my first time posting here so sorry in advance if I've missed anything vital.
 
Have you checked the host ssl certificate if it has a problem (expired)? I have seen something like that before a long time ago and that was the issue. (Assuming this was working fine and just suddenly stopped working and there were no changes.)
 
Check this thread if you are by any chance using PHP 7.0 as default php version and Litespeed.
it's an old thread, but the solution might be similar.
 
All resolved now, checked hosts and that was okay, checked resolve.conf and that was correct (it included 127.0.0.1) but as soon as I changed the SMTP host from localhost to the servers hostname and appended with ssl:// it worked. I previously tried localhost with ssl:// and that was throwing an error in the browser it couldn't connect but prior to this it would just say sending and go on and on. Pinging localhost returns ::1 and the hostname returns the IP address for the server. Hope it might help someone else with the same issue. Thanks cjd and Richard for your fast replies, I really appreciate the support!
 
Just to add I think it was my own fault, at some point recently someone had complained about slow outbound emails, one of many things I did was disabled ipv6 in exim. If localhost never resolved to ipv4 that would make sense ?
 
If localhost never resolved to ipv4 that would make sense ?
Yep indeed if you are only using ipv6 that would cause issues. I always have both entry's, so 127.0.0.1 and ::1 in the /etc/localhost file and both ip's in the /etc/hosts file.
Anyway, glad to hear you figured it out and it's working again.

I never had to use ssl:// in roundcube, it does that automatically, but maybe it's because I have a seperate certificate for my hostname, not sure.
 
For people searching for a fix for an HELO problem related to localhost, perhaps this could be your fix too.

I had a problem with an HELO displayed as localhost for sending mails froms Roundcube. After doing some research between multiple servers with and without this problem, I discovered that in /etc/hosts the server IP was there, but on the server with the Roundcube HELO localhost problem, after the server IP, there was no server domain.

So after adding the server domain name behind the IP, it worked and localhost HELO was replaced by server domain HELO.

Afterwards rebuild exim in CustomBuild
 
Last edited:
So after adding the server domain name behind the IP, it worked and localhost HELO was replaced by server domain HELO.
Good that you mention this for newby's.

It's common practice (also most default datacenter installs do this) to have the ip there inclusing name, like this (example ip's) and localhosts. Also for some applications it's good to have a correct hostname in /etc/hostname too.
Even when changing hostname to for example server.domain.com then the /etc/hostname file will just have server in there. So best is to change this to server.domain.com too.

For your own hostname to get installed automatically when installing DA this is even required.
 
Back
Top