SMPT and POP3 Gmail clients not working

SYSTEM INFORMATION
OS type and version REQUIRED
Virtualmin version REQUIRED

2 weeks ago my vps server was down inexplicably. After rebooting Gmail clients could not send(SMTP) or receive emails(POP3). All login details were confirmed as correct. I have confirmed all ports are open and can send and receive emails from all virtual servers in virtualmin. I have checked that there are no firewall is blocking pors 25, 995 or 465, this also confirmed by the VPS provider. I used Nmap to check for closed ports all seems OK. Initially I could receive emails via POP3 on one virtual server if I used the VPS server address as the address instead of the virtual server mail.xxxxxx.com. I assumed that because Centos 8 was EOL maybe that was the issue. I did a fresh install of Centos 7 and migrated the virtual servers. Situation remains the same. I can send and receive emails via Usermin, one of the virtual server websites has a plugin that uses SMTP and can send emails too using the virtual server credentials. Gmail returns the below errors still. Is this a known issue? I have looked at the log files and seem to have hundreds of failed authentications every few minutes for non existent email accounts(I think this is normal, failed logins from hackers). Anyone have an idea what could be the issue?

Gmail error (Server returned error: “Connection timed out: There may be a problem with the settings you added. Please contact your other email provider to verify the correct server name and port.”

Couldn’t reach server. Please double-check the server and port number.)

Nmap details:
Not shown: 844 closed tcp ports (reset), 127 filtered tcp ports (no-response), 15 filtered tcp ports (host-prohibited)
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
53/tcp open domain
80/tcp open http
110/tcp open pop3
143/tcp open imap
443/tcp open https
465/tcp open smtps
587/tcp open submission
993/tcp open imaps
995/tcp open pop3s
3306/tcp open mysql
10000/tcp open snet-sensor-mgmt
20000/tcp open dnp

Nmap done: 1 IP address (1 host up) scanned in 11.03 seconds

@sejo2001

Welcome to the forum.

My goto tool\site for diagnosing issues with inbound emails is:

It displays all the SMTP handshaking and other messages - those are what you really need to figure out what is going on.

You can do it manually with telnet (or similar) - but it’s a bit laborious.

HIH

Dibs

gmail clients? Have you tried testing via thunderbirds or outlook, a normail email client. Have you checked mail server logs?

We cannot help without relevant mail log entries.

Hi Dibs,

This is what I get.

@sejo2001 - what does

postfix -n

return?

Cheers

Dibs

@sejo2001

I just spotted that you are trying to send on port 465, whereas using port 25 it succeeds:

You should have an email from Wormly in your admin mailbox.

I wonder if in master.cf you only have an entry for 25 and not 465.

HIH

Dibs

Hi Stefan1959,

Thunderbird works without a problem with the same credentials.

Sejo

@sejo2001 - what port is Thunderbird connecting on? Must be 25.

Dibs

Hi Joe,
Sorry I dont understand, which logs? var/log/maillog?

Josephat

Thunderbird is using port 25 for SMTP and 995 for POP3.

@sejo2001 - that matches with Wormly successfully sending your system a test email on port 25.

Check the contents of master.cf - you will most likely only have a line for smtp (port 25).

Cheers

Dibs

I cannot find any mention port 25 in master.cf or even port 465. My config file ends at line 134 yet when I try to filter with a term it gives me items with lines above line 134 e.g line 230, etc

I did a pop3 test on Wormly and it looks OK

@sejo2001 - port 25 is not mentioned in master.cf as “25” or “Port 25” .

Look for the “table” shown in the following picture - https://slidetodoc.com/presentation_image/5b359eb9ad2934525f9797bf29f09ced/image-27.jpg

You should only have the 1st line un-commented - the rest should have a “#” before them.

If that is the case - which I expect it to be - then Postfix is only listening on Port 25 (SMTP port IS port 25). In your original post and in the Wormly test results, you are\were trying to connect via port 465 (which is SMTPS). Which isn’t going to respond as Postfix is set to respond on SMTP (Port 25).

Cheers

Dibs

@sejo2001 - I believe your Postfix installation is ONLY setup for SMTP (aka Port 25). You appear to be having issues connecting to it on SMTPS (aka Port 465) - never going to work until master.cf is altered to tell PostFix to also use SMTPS.

https://www.google.com/search?q=postfix+mutiple+ports

Should help you.

Cheers

Dibs

Maybe fail2ban has banned the gmail ip because of bad logins?

@stefan1959 I have screened all the banned IPs and non is a Google IP.

SMTP (port 25) receives emails perfectly well. SMTPS (Port 65) doesn’t. Why? Most likely there is no entry in the “table” in master.cf for SMTPS and therefore Postfix just ignores the incoming EHLO command.

@Dibs I have been using the same settings for almost one year now, just puzzled that suddenly Gmail will not use POP3 or SMPT credentials. That is both dovecot and postfix, the odd thing is I can see dovecot logs showing the thunderbird POP3 logins but none for any of the gmail attempts. I am not sure if I should post logs here because there are client emails listed and IP addresses.

mastercf

This is master.cf table from server, let me know if anything is odd please.