A 'connection refused' error when sending emails is often due to network issues or a misconfigured mail server. Initial steps involve verifying the recipient's IP address and port, ensuring the mail service is running, and checking firewalls on both sides. If network connectivity is the issue, traceroute and manual connection tests on port 25 are recommended. The SMTP banner should be checked for explicit error messages. If the network is working, greylisting, blacklisting, server overload, incorrect DNS settings, and authentication failures should be considered. Debugging tools for Postfix, Exim, and Sendmail can help identify the specific cause. External tools like MXToolbox and contacting support teams may also be necessary.
9 marketer opinions
A 'connection refused' network error when sending emails can stem from various issues on both the sending and receiving ends. Solutions involve checking if the receiving mail service is running and listening on the correct port, verifying firewall configurations on both sides to ensure SMTP ports (25, 465, 587) are open, and ensuring correct DNS resolution. Blacklist status should be checked, as should the possibility of greylisting. The SMTP banner should be examined, and it is necessary to test basic network connectivity with tools like `telnet` or `nc`. Overloaded servers and misconfigured mail server software can also cause this error. Contacting support or using online tools for diagnosis is often advised.
Marketer view
Email marketer from SiteGround explains checking the server's status page to see if there are any known issues affecting mail services. If there are no known issues, contact their support team for further assistance.
7 Mar 2023 - SiteGround
Marketer view
Email marketer from MXToolbox explains using their tools to check for DNS issues and blacklist status. Incorrect DNS settings can prevent your mail server from finding the recipient's server, and being on a blacklist will cause connections to be refused.
30 Dec 2022 - MXToolbox
3 expert opinions
A 'connection refused' error when sending emails can be due to network issues preventing the sender's server from reaching the recipient's server. This might stem from routing problems, a deliberate block, or greylisting (temporary refusal). Examining the SMTP banner can offer clues about the reason for the refusal, such as connection limits or blacklisting. Retrying the email after a delay is recommended to address potential greylisting.
Expert view
Expert from Spam Resource explains to check the SMTP banner for clues. The banner is what the receiving server says when you first connect to it. Sometimes, it will give a specific reason for refusing the connection, such as 'too many connections' or 'blacklisted IP'.
9 Nov 2022 - Spam Resource
Expert view
Expert from Word to the Wise explains greylisting, where the receiving server temporarily refuses the connection from an unknown sender. This is done to block spammers who don't retry sending. A legitimate server should retry after a delay. Therefore, retrying the email after a short period is the solution.
21 Oct 2021 - Word to the Wise
5 technical articles
Troubleshooting a 'connection refused' error involves verifying the destination IP address and port, ensuring the target service is running and listening on the specified port, and checking firewall rules on both the client and server. Nmap can be used to scan the target host. Examining mail server logs (Postfix, Exim, Sendmail) and using debugging options provide further insights into the reason for the connection failure, which may include authentication failures, policy restrictions, or resource limits.
Technical article
Documentation from Postfix.org explains checking the Postfix logs for clues about the connection failure. It suggests looking for error messages that indicate why the connection was refused, such as authentication failures, policy restrictions, or resource limits.
27 Sep 2023 - Postfix.org
Technical article
Documentation from Exim.org explains using Exim's debugging options to trace the connection attempt and identify where the connection is being refused. This often involves using the `-d` flag with increasing levels of verbosity to see the SMTP conversation.
11 Apr 2022 - Exim.org
Are there email sending issues with AWS?
Can Gmail give false positive SMTP bounce responses?
How can I resolve email delivery errors due to tempfail and suspected spam?
How can I resolve Microsoft Outlook S3140 errors blocking my transactional emails?
How do I fix the Gmail SMTP error code 5.7.1 and avoid being flagged as spam?
How do I resolve a blocked sending IP with Office365 and what steps should I take to ensure transparency?