0

Hello ServerFault community,

I have a Postfix and Dovecot mail server based on MySQL, I had a problem with MySQL so I had to reinstall it and thet's where the problems started happening.

RoundCube starter randomly giving me (Just some times) IMAP server connection errors. Sometimes he says he cannot load the email because he cannot connect to IMAP and I have to reload the page to make it work again. Let's say it happens 50% of the times.

But that's not the main problem, is just something boring to use.

Today my SMTP server started making strange things. Let me explain.

My SMTP and IMAP suddently stoppend working. I could fix the IMAP by editing the NameServers of the VPS, that where causing a problem with the DNS resolving of the mail coming in. But the SMTP still works by half.

SMTP Works:

In localhost,
By doing telnet port 25 in localhost,
By doing telnet 587 also from other IPs,
With Apple's Mail Client and not PHP Mail clients. (Ports 25 and 587),
NON-PhP Mailer (I tried with www(.)gmass(.)co/smtp-test) On all the ports (25,465,587).

SMTP does not work:

With PHP Mailer (I tried with WHMCS (Main Issue) and www(.)smtper(.)net) ,WHMCS any port SMTPER works on 25,
Telnet to 465 Localhost and non,
Telnet port 25 from external hosts,
By doing telnet port 25 from external hosts (I tryed with Putty).

I am sure it is not a firewall issue at the 99.9999% as even with iPTables disabled I have the same issues. The main issue to solve is that PHPMailers does not work, like WHMCS.

My IPTables, as you can see ports are open, also because I can use them with some SMTP Clients:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination
f2b-sshd   tcp  --  anywhere             anywhere             multiport dports 2233
ACCEPT     udp  --  anywhere             anywhere             udp dpt:465
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:urd
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:smtp
f2b-sshd   tcp  --  anywhere             anywhere             multiport dports 2233
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:pop3s
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:pop3
f2b-sshd   tcp  --  anywhere             anywhere             multiport dports 2233
ACCEPT     udp  --  anywhere             anywhere             udp dpt:11334
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:11334
ACCEPT     udp  --  anywhere             anywhere             udp dpt:19999
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:19999
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:32400
ACCEPT     udp  --  anywhere             anywhere             udp dpt:32400
ACCEPT     udp  --  anywhere             anywhere             udp dpt:8888
ACCEPT     udp  --  anywhere             anywhere             udp dpt:8096
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:8096
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:8888
ACCEPT     udp  --  anywhere             anywhere             udp dpt:50315
ACCEPT     all  --  anywhere             anywhere
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:webmin
ACCEPT     udp  --  anywhere             anywhere             udp dpt:10000
f2b-sshd   tcp  --  anywhere             anywhere             multiport dports 2233
ACCEPT     udp  --  anywhere             anywhere             udp dpt:10040
ACCEPT     udp  --  anywhere             anywhere             udp dpt:10023
ACCEPT     udp  --  anywhere             anywhere             udp dpt:11332
ACCEPT     udp  --  anywhere             anywhere             udp dpt:mysql
ACCEPT     udp  --  anywhere             anywhere             udp dpt:110
ACCEPT     udp  --  anywhere             anywhere             udp dpt:100
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain
ACCEPT     udp  --  anywhere             anywhere             udp dpt:20
ACCEPT     udp  --  anywhere             anywhere             udp dpt:993
ACCEPT     udp  --  anywhere             anywhere             udp dpt:143
ACCEPT     udp  --  anywhere             anywhere             udp dpt:2233
ACCEPT     udp  --  anywhere             anywhere             udp dpt:465
ACCEPT     udp  --  anywhere             anywhere             udp dpt:587
ACCEPT     udp  --  anywhere             anywhere             udp dpt:1988
ACCEPT     udp  --  anywhere             anywhere             udp dpt:http-alt
ACCEPT     udp  --  anywhere             anywhere             udp dpt:22
ACCEPT     udp  --  anywhere             anywhere             udp dpt:25
ACCEPT     udp  --  anywhere             anywhere             udp dpt:80
ACCEPT     udp  --  anywhere             anywhere             udp dpt:443
ACCEPT     udp  --  anywhere             anywhere             udp dpt:2233
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:10040
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:10023
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:11332
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:mysql
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:pop3
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:100
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ftp-data
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:imaps
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:imap2
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:2233
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:urd
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:submission
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:1988
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http-alt
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:smtp
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:https
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:2233
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
DROP       all  --  anywhere             anywhere

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED

Chain f2b-sshd (4 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere
RETURN     all  --  anywhere             anywhere
RETURN     all  --  anywhere             anywhere
RETURN     all  --  anywhere             anywhere

Thank you for any help you may give me. Bye!

PS: Before the MySQL Edit some weeks ago everything was working fine even with the PHP Based Mail clients but I don't know if it is a problem of the Mail Host or the PHP Host (WHMCS and SMTPER) as with some website and SMTP clients everything works fine. e.g. Apple's Email.

Edit: I also have Postfix spam in console:

Oct 30 11:06:07 mail.indst.eu systemd[1]: Starting Postfix Mail Transport Agent...
Oct 30 11:06:07 mail.indst.eu systemd[1]: Started Postfix Mail Transport Agent.
Oct 30 11:06:07 mail.indst.eu systemd[1]: Reloading Postfix Mail Transport Agent.
Oct 30 11:06:07 mail.indst.eu systemd[1]: Reloaded Postfix Mail Transport Agent.
Oct 30 11:06:07 mail.indst.eu systemd[1]: Reloading Postfix Mail Transport Agent.
Oct 30 11:06:07 mail.indst.eu systemd[1]: Reloaded Postfix Mail Transport Agent.
Nicolò
  • 25
  • 2
  • 10

1 Answers1

0

Thank you, I solved the problem by my self. For the PHP Mailer it was cPanel the problem. I had to allow external SMTP servers in WHM.

Thank you for your help.

Nicolò
  • 25
  • 2
  • 10