Delayed mail delivery due to "lost connection after CONNECT"? Delayed mail delivery due...

Topic: Delayed mail delivery due to "lost connection after CONNECT"?

Post Delayed mail delivery due to "lost connection after CONNECT"?
by mtrcycllvr on Friday, March 6, 2026

Hello!

Hey, I have noticed that my mail is getting stalled for roughly 45 minutes or so. I've been looking at my Postfix/Dovecot logs and at the Dynu email control panel.. What I see are repeated messages like:

Mar 6 17:36:31 mailhost postfix/smtpd[29140]: connect from mx2.dynu.com[107.161.27.201]
Mar 6 17:36:31 mailhost postfix/smtpd[29140]: lost connection after CONNECT from mx2.dynu.com[107.161.27.201]
Mar 6 17:36:31 mailhost postfix/smtpd[29140]: disconnect from mx2.dynu.com[107.161.27.201] commands=0/0

And the mail continues to sit in the queue at your end. But then, magically, it will connect successfully and flush the queue. So, at SOME level, it's "working".. My mail used to be instantaneous, and OUTGOING is still very quick, it's just incoming that seems to be an issue..

I've turned up Dovecot logging verbosity, but all I can see is the "lost connection" error and for the life of me, cannot figure out what might be going wrong or why the connection might be dropping. I have made no updates at my end, and have been using you folks as my store and forward provider for years now..

Would you have any suggestions as to what might be happening here? I can see no obvious IP service issues at my end, I run a business class fixed IP to my mailhost and it's been working fine for many years.

My full setup is FreeBSD running Postfix/Dovecot.. Pretty straight forward.

Thanks for any thoughts you might have about what's going on here..

Sincerely,

Eric Timberlake

Reply with quote | Report
Post Re: Delayed mail delivery due to "lost connection after CONNECT"?
by arfalconi on Thursday, July 9, 2026

I think the connection you are seeing in the mail.log is the one Dynu does to check if your server is up, and not related to specifically deliver emails.

I see those connections in my server too:

2026-07-09T15:39:08.505131-06:00 postfix/smtpd[1073926]: connect from www.dynu.com[162.216.242.29]
2026-07-09T15:39:08.505379-06:00 postfix/smtpd[1073926]: SSL_accept error from www.dynu.com[162.216.242.29]: lost connection
2026-07-09T15:39:08.505455-06:00 postfix/smtpd[1073926]: NOQUEUE: lost connection after CONNECT from www.dynu.com[162.216.242.29]
2026-07-09T15:39:08.505504-06:00 postfix/smtpd[1073926]: disconnect from www.dynu.com[162.216.242.29] commands=0/0

You can verify that by monitoring your mail.log file, then in the Dynu Control Panel, click on Email Services, you will see Dynu connects and disconnects from you mail server.


There are somethings that come to my mind that you can check to see if are the causes of your mail to get delayed, well, are things that I implemented in my server that maybe could help.

1.- If you are using a firewall check it is not blocking or limiting Dynu's servers connections.

2.- Ensure your server is not limiting the connections or connection rate with anvil for the Dynu servers, for example:

2026-07-09T14:46:54.301348-06:00 postfix/anvil[1070796]: statistics: max connection count 1 for (smtps:89.23.107.76) at Jul 9 14:43:32

The way I did it was by creating an entry in postfix's main.cf file:

smtpd_client_event_limit_exceptions = $mynetworks cidr:/etc/postfix/event_limit_exceptions

You have to create the file /etc/postfix/event_limit_exceptions which contains:

# IPs of dynu, the forwarding service.
# Network/Prefix Action
162.216.242.0/24 OK
72.51.58.0/24 OK
142.202.188.16/29 OK
107.161.24.148/32 OK
107.161.27.201/32 OK

Or simply by defining the IPs (without the file):
smtpd_client_event_limit_exceptions = $mynetworks 162.216.242.0/24 72.51.58.0/24 142.202.188.16/29 107.161.24.148/32 107.161.27.201/32

3.- If you are using fail2ban, ensure that the Dynu's IPs are whitelisted:

Edit the file /etc/fail2ban/jail.local and instruct to ignore the Dynu's IPs in the [DEFAULT] section:

ignoreip = 127.0.0.1/8 192.168.1.0/24 162.216.242.0/24 72.51.58.0/24 142.202.188.16/29 107.161.24.148/32 107.161.27.201/32

and reload fail2ban: sudo systemctl reload fail2ban

In the example, as you can see the two first entries are localhost and the local network, substitute with your networks.

4.- In my specific case my firewall only accepts connections to deliver email from the Dynu's servers, as my ISP blocks the TCP port 25, I use another port, for example 2525 (ETRN Port in Dynu's Store and Forward service), so I do not need to do any configuration in postfix, but maybe you would like to check if your postfix configuration or rules are not blocking connections from the Dynu's servers, for example, with the check_client_access parameter, usually defined in the section smtpd_client_restrictions.

As an example, you could define in main.cf, under client_restrictions:

smtpd_client_restrictions =
permit_mynetworks,
check_client_access cidr:/etc/postfix/trusted_clients,
permit_sasl_authenticated
reject_unknown_client_hostname
reject_unknown_reverse_client_hostname
reject_unauth_pipelining
.
. OTHER PARAMETERS
.
.
permit

And in the /etc/postfix/trusted_clients file:

# IPs of dynu, the forwarding service.
# Network/Prefix Action
162.216.242.0/24 OK
72.51.58.0/24 OK
142.202.188.16/29 OK
107.161.24.148/32 OK
107.161.27.201/32 OK

I hope it helps.

Reply with quote | Report
Monday, July 13, 2026 6:57 AM
Loading...