0

I configured a Dovecot Postfix mailserver on Ubuntu with letsencrypt certificates. It runs fine on mail clients like MacOS mail both in imap and pop3. No errors.

However after adding two accounts to my gmail using pop3 I get 50% of the times a connection error when receiving e-mail:

Connection Error. Server returned error "Connection timed out: There may be a problem with the settings you added. Ple..."

This is the only message I get and it happens seemingly randomly at 50% of the cases the gmail server tries to connect to the server.

I tailed both the mail.log and ufw log but I cannot find anything related to an attempted connection. Turning the firewall temporary off did not change the issue either. Also in more verbose log files there is nothing to show. This makes me consider it is some sort of DNS issue:

I have an A record for IPV4 and AAA for IPV6 there is an @ TXT record for SPF:

v=spf1 a mx ip4:X.X.X.X ip6:X:X:X:X:X:X:X:X a:mydomain.com a:mail.mydomain.com -all

All together I am now running out of options what this Gmail specific problem can be. Anyone has a suggestion where or what to look for?

3
  • 1
    Have you tried setting up a tcpdump for just the POP/IMAP ports and have it write to file, then when Google gives a failure, load it in Wireshark and see if the traffic is even making it to your host?
    – Ackack
    Mar 22, 2021 at 16:23
  • I have a similar problem. Gmail account configured to fetch emails from VPS (Dovecot+Postfix on Debian) via POP3. It randomly fails. I have inspected it with "iftop" (network monitor for unix) and when it fails, it does not even show a connection from Google servers reaching the VPS. Posted on official forums of Gmail. No response. Nothing is detected on mail.log, syslog, or even the network. Tried with smallest and largest VPS machines (with and without virtual memory paging). No idea why Gmail hates POP3 of Dovecot. As OP said, it fails only about 50% of the time, the rest of it it works. Aug 5, 2021 at 11:09
  • Update: A "potential" fix which I found was disabling my IPv6 address for my MX record in my DNS settings (I had one mail.domain.com MX record for IPv4 and one for IPv6). So far it seems like it works 90% (still fails sometimes, but not as usual as before). Will let you know about progress. Aug 5, 2021 at 11:38

1 Answer 1

0

As placeholder commented this issue is related to IPv6 configuration which Gmail seems a bit more strict on. I simplified my IPv6 config and this solved the problems 100% for e-mail.

1
  • 1
    Welcome to Stack!, It would be helpful for future visitors for you to describe how you simplified it, and then accept your own answer so that they can see that the problem has a solution when doing a search! Aug 7, 2021 at 13:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .