2

I'm facing a weird problem with Postfix right now. My setup is Postfix 2.9.6 and Dovecot 2.1.7 on Debian 7.11 and there's a second server configured exactly the same that does not show this problem.

Sometimes I get a "connection refused" when Postfix is sending mails to another server via SMTP (no smarthosts used). But only sometimes.

This comes out of nowhere and only effects a small percentage of mails. A log looks like this:

Oct 14 18:14:49 henry postfix/smtp[3281]: connect to mx00.emig.gmx.net[212.227.15.9]:25: Connection refused
Oct 14 18:14:49 henry postfix/smtp[3281]: connect to mx01.emig.gmx.net[212.227.17.5]:25: Connection refused
Oct 14 18:14:49 henry postfix/smtp[3281]: 99C37C0639: to=<[email protected]>, relay=none, delay=0.08, delays=0.02/0.05/0/0, dsn=4.4.1, status=deferred (connect to mx01.emig.gmx.net[212.227.17.5]:25: Connection refused)
Oct 14 18:14:49 henry postfix/smtp[3285]: connect to mx4.hotmail.com[65.55.92.152]:25: Connection refused
Oct 14 18:14:49 henry postfix/smtp[3285]: connect to mx1.hotmail.com[65.54.188.94]:25: Connection refused
Oct 14 18:14:49 henry postfix/smtp[3285]: connect to mx1.hotmail.com[65.54.188.72]:25: Connection refused
Oct 14 18:14:49 henry postfix/smtp[3285]: connect to mx1.hotmail.com[65.55.37.104]:25: Connection refused
Oct 14 18:14:49 henry postfix/smtp[3267]: 99C37C0639: to=<[email protected]>, relay=smtp.rzone.de[81.169.145.98]:25, delay=0.22, delays=0.02/0.01/0.13/0.06, dsn=2.0.0, status=sent (250 2.0.0 Mail accepted with id T0aa21s9EGEqNxP)
Oct 14 18:14:49 henry postfix/smtp[3276]: 99C37C0639: to=<[email protected]>, relay=mx01.kundenserver.de[217.72.192.67]:25, delay=0.33, delays=0.02/0.03/0.17/0.11, dsn=2.0.0, status=sent (250 Requested mail action okay, completed: id=0LqFii-1cYpnI2qFk-00doTc)

I have no idea why this happens, and what's the pattern. Right now it seems kind of random.

It is possible to telnet to these servers above on port 25 and they reply to a HELO command. And mails to e.g. GMX are accepted again at several other points in the log. I even had a continuous ping on the machine for five days with 0% package loss.

This server had some routing problems with IPv6 in the past, so I deactivated IPv6 for the time being.

Has anybody an idea what's wrong? Could that be some form of limit I'm facing here?

1 Answer 1

0

If the mail is delivered some minutes later, all you might experience is greylisting, a method to prevent spam. Mail servers temporarily deny delivery if the sending server is unknown, as lots of spamming mail servers (especially from bot nets) does not retry later. But this should usually not happen before the connection is established and is rather unlikely here. They might also be rate-limiting you on connection level.

Being denied because of bad reputation on a spam blacklist is more probably here. Also, if this is some kind of dial-up connection, you're likely to be blocked. Perform a blacklist check using your server's IP address, there are several free services like MX Toolbox. If you're blocked with a dialup connection, setup some mail relay on a hosted server somewhere (and make sure not to rely arbitrary mail). If you're blocked because of spam coming from that IP, make sure to stop spamming, take action to prevent spamming again in future and fill in the list's take-down forms.

postqueue -p might provide some additional information why mail was queued instead of being delivered within a short timeframe.

3
  • The server is not listed on any blacklist, I already checked that. And it can deliver mails to server A at one instance, then get a "connection refused" from server A some minutes later, just to successfully deliver mails again some minutes later to server A. This is what confuses me... there seems to be no pattern at all. Could it be a routing problem after all? I will check for postqueue -p, thanks!
    – Stimpy
    Oct 16, 2016 at 10:00
  • SMTP is created for bad and temporarily (in)available connections. Some large providers are known to randomly deny connections for no obvious reasons, probably they're doing some scaling work behind the hood. As long as your mail is delivered some minutes later, you're fine. To trace connectivity issues, pinging the unstable target for a while.
    – Jens Erat
    Oct 16, 2016 at 10:10
  • Both greylisting and blacklisting do not typically manifest themselves as "Connection refused" errors. The vast majority of servers will accept the TCP connection and reject delivery with an appropriate SMTP return codes during the SMTP dialog. This is certainly the case for gmx.net. Oct 16, 2016 at 12:07

You must log in to answer this question.

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