Postfix Connection Timed Out

Postfix Connection Timed Out

Application developers make use of PostFix --- a Mail Transfer Agent --- to send emails from their applications. Often, the users of Postfix face the 'Connection timed out' error while trying to send emails from their local servers using their applications. There are many reasons for the connection to be timed out. The steps mentioned below will help you to fix the postfix connection timed out error.

Find the cause for the connection time out:

First Step:

  • Step 1: When you face the Connection timed out error in postfix, check whether you can ping the domain using the telnet command. Check the connectivity either using the domain name or the IP address of the destination server. The format for this is telnet server_domain_name port_number or telnet server_ip_address port_number.
  • Step 2: If you can connect using the telnet command, then try to increase the connection time out duration.
  • Step 3: If the telnet command failed to establish the connection, then it might be due to the port getting blocked by the ISP or the firewall on your local server.
  • Step 4: Mostly, the SMTP port 25 used by the local server might be blocked by several Cloud servers.
  • Step 5: In some cases, the local server might be spammed, and as a result, the connection might be refused.

Second Step:

  • Step 1: Another option to find the cause for the postfix connection timed out error is to make use of the traceroute command. By using this command, you can know the server where the connection is being lost.
  • Step 2: The traceroute command looks like this: traceroute -n -T port_number server_domain_name. Try traceroute with different port numbers to find out the exact cause.

Solutions for postfix connection time out:

Solution 1:

This solution can be carried out when the timed out error persists, but the telnet command can establish the connection.

  • Step 1: Increase the smtp_connection_timeout parameter in the file to a value that does not exceed 90 seconds.
  • Step 2: Then, re-queue and restart postfix using the commands given below.
  • Step 3: postsuper -r ALL /etc/init.d/postfix restart
  • Step 4: Now, check whether the connection is established without the postfix connection timed out error.

Solution 2:

Change the port number in the configuration file using the following steps:

  • Step 1: Type the command /etc/postfix/ to open the file.
  • Step 2: Locate the line smtp inet n -n - - smtpd.
  • Step 3: Change the line as NEW_PORT inet n -n - - smtpd. Here NEW_PORT is must be a port number which is not used by any other service. You can use ports higher than 2048.

Solution 3:

Change the nameserver in the resolv.conf file. The steps are as follows:

  • Step 1: Type vi /etc/resolv.conf in the terminal window.
  • Step 2: Locate the nameserver parameter and change it as nameserver
  • Step 3: Then, restart postfix using the sudo /etc/init.d/postfix restart command.

Solution 4:

If your server has more than one NIC’s, then use the steps mentioned below.

  • Step 1: Open the file in the terminal.
  • Step 2: Locate the parameter inet_interface.
  • Step 3: Modify it as inet_interface = all.
  • Step 4: Save and exit the configuration file.
  • Step 5: Restart postfix.

Other solutions:

  • Step 1: Check your network firewall, whether it is blocking any port or domain that postfix uses to send emails.
  • Step 2: If your server IP has been spammed, then contact your ISP.
  • Step 3: As said earlier, the port 25 is blocked by many Cloud servers. So enquire them about the alternate ports to be used. These are the solution to fix postfix connection timed out error.

Related Searches

How To Encrypt Email?

How To Encrypt Email?

In order to prevent third parties from reading your mail content, email encryption is done, which is basically digitizing the information within. 

How To Stop Spam Emails?

How To Stop Spam Emails?

There are not many ways to prevent spam from piling up in your Inbox. Here’s how you can filter out most of them.

Fix AT&T Email Error

Fix AT&T Email Error 0x800CCC0F

AT&T Email error 0x800CCC0F occurs when mails are not being sent or received through AT&T services. Due to the technical glitches causing it, many email functions are disabled. The computer’s Operating System might get frozen.

How To Delete All Emails In Gmail?

How To Delete All Emails In Gmail?

Open the Gmail app.Select the inbox tab you want to delete.You’ll find the Empty Box button over the Compose button.