SMTP somehow connects to local host
I have a very weird issue.
I have a custom Roundcube install on a cPanel account my 'backoffice' server. It connects to the mailserver with IMAP and SMTP. Those are 2 cPanel servers within the same network. Somehow, IMAP works fine but SMTP with exactly the same credentials doesn't.
After a lot of research, we figured out that, with Telnet, when connecting to IMAP (port 993) it connects to the right server, but when we connect to SMTP (25, 465 and 587) it somehow connects to the local host.
Webmail server: backoffice.hostname.nl, CentOS 7.7 cPanel version 86.0.17
Mail server: mailserver.hostname.nl, CentOS 7.7 cPanel version 86.0.17
For obvious security reasons I have changed some values, but this is the output
Here is an example:
IMAP connection over TELNET as 'webmail' user:
[webmail@backoffice ~]$ telnet mail.userdomain.nl 993
Trying 255.255.255.255... (changed for security reasons, but this is the right IP)
Connected to mail.userdomain.nl.
SMTP connection over TELNET as 'webmail' user:
[webmail@backoffice ~]$ telnet mail.userdomain.nl 587
Trying 255.255.255.255... (changed for security reasons, but this is the right IP, the same as the imap connection)
Connected to mail.userdomain.nl.
Escape character is '^]'.
250-backoffice.hostname.nl Hello mail.userdomain.nl [109.71.54.32]
Now, for the interesting part:
SMTP connection over telnet as the root user:
[root@backoffice ~]# telnet mail.userdomain.nl 587
Trying 255.255.255.255... (again the right IP, same as above)
Connected to mail.userdomain.nl.
Escape character is '^]'.
220-mailserver.hostname.nl ESMTP Exim 4.93 #2 Sat, 04 Apr 2020 12:38:45 +0200
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
Extra tested things:
- When mail.userdomain.nl has an IPv6 record it does work, however this would be very inconvienient since a lot of customers have external DNS so this would require a lot of work to get done for everyone
- Another server with CloudLinux as the OS does work.
- Other users on the same server get the same results with telnet
Conclusion: For some reason, the regular cPanel user loops back to the local host when connecting to a SMTP port, while the root doesn't. Does anyone know if this is a setting that I can change somewhere? Any ideas?
-
This was solved by turning off 'SMTP restrictions' in WHM 0 -
Glad to see you were able to resolve the issue, thank you for noting how it was resolved for you. 0
Please sign in to leave a comment.
Comments
2 comments