Roundcube not sending mail

So I’m able to send mail from other email services like gmail using the custom email. However when i try to send mail from roundcube i get this error: SMTP Error (): Connection to server failed.

I can receive and see emails, just cant send on the roundcube

Is Exim listening on port 587?

Im not sure, how would i check?

lsof -Pn +c0 -i:25,465,587 -sTCP:LISTEN

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
exim4 53315 Debian-exim 4u IPv4 125894 0t0 TCP *:25 (LISTEN)
exim4 53315 Debian-exim 5u IPv4 125895 0t0 TCP *:465 (LISTEN)
exim4 53315 Debian-exim 6u IPv4 125896 0t0 TCP *:587 (LISTEN)

They are up

Rouncube is in the same machine than your Exim?

Correct, everything is on the same machine; On Linode.

Check if you can see the 250 HELP message:

openssl s_client -starttls smtp -connect localhost:587

Getting an error:

4037D7EE2B7F0000:error:8000006F:system library:BIO_connect:Connection refused:../crypto/bio/bio_sock2.c:125:calling connect()
4037D7EE2B7F0000:error:10000067:BIO routines:BIO_connect:connect error:../crypto/bio/bio_sock2.c:127:
connect:errno=111

Seems or a firewall issue or you have not configured correctly the certificate:

iptables -S
ls -l /usr/local/hestia/ssl/certificate.crt

Im not sure what im looking for the iptables, for the second command im getting: -rw-rw---- 1 Debian-exim mail 3945 Nov 9 19:00 /usr/local/hestia/ssl/certificate.crt

I would prefer to see the entire output but you should see something like this:

-A INPUT -p tcp -m multiport --dports 25,465,587 -j ACCEPT

and also whether your ip is neither dropped or rejected

Also, show if you can connect directly to port 587:

telnet localhost 587

If you don’t have telnet installed: apt install telnet

Also, the status of of exim service:

systemctl status exim4

Here is the full output root@panel:~# iptables -S-P INPUT DROP-P FORWARD ACCEPT-P OUTPUT ACCEPT- - Pastebin.com

root@panel:~# telnet localhost 587

Trying ::1...
telnet: Unable to connect to remote host: Connection refused
root@panel:~# systemctl status exim4

● exim4.service - LSB: exim Mail Transport Agent
     Loaded: loaded (/etc/init.d/exim4; generated)
     Active: active (running) since Thu 2023-11-09 20:28:10 UTC; 36min ago
       Docs: man:systemd-sysv-generator(8)
    Process: 53066 ExecStart=/etc/init.d/exim4 start (code=exited, status=0/SUCCESS)
      Tasks: 1 (limit: 2220)
     Memory: 14.6M
        CPU: 384ms
     CGroup: /system.slice/exim4.service
             └─53315 /usr/sbin/exim4 -bd -q30m

Nov 09 20:28:10 panel.person0z.me systemd[1]: Starting LSB: exim Mail Transport Agent...
Nov 09 20:28:10 panel.person0z.me exim4[53066]:  * Starting MTA
Nov 09 20:28:10 panel.person0z.me exim4[53066]:    ...done.
Nov 09 20:28:10 panel.person0z.me systemd[1]: Started LSB: exim Mail Transport Agent.

Ok, try with ipv4:

telnet 127.0.0.1 587

root@panel:~# telnet 127.0.0.1 587

Here

Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 panel.person0z.me

Ok, edit your file /etc/hosts and comment the line that looks like:

::1 localhost ip6-localhost ip6-loopback

So you will get this:

#::1 localhost ip6-localhost ip6-loopback

and double check that you have a line like this:

127.0.0.1 localhost

Save the file and try to connect again to port 587 using localhost:

telnet localhost 587

If you can connect, try again Roundcube.

Yep that worked, thank you so much!

Okay, I’m noticing after doing that, apt updates and things like that are failing to resolve.

Temporary failure resolving 'mirrors.linode.com'