Postfix Mail Forwarding: Socket Error ..How to fix MX records?

April 26, 2015 6k views
Email Miscellaneous

Hello --

I sent test messages from my personal gmail account to test if the mail forwarding is working ( which should work as all the configurations are in place, now), none of the test messages are delivered and this is what I see in the "mail delivery subsystem message"

"The recipient server did not accept our requests to connect. Learn more at http://support.google.com/mail/bin/answer.py?answer=7720
[(5) mail.yenidensen.com. [178.62.224.65]:25: socket error]"

And when I click on the support.google, I see below. Clearly, there is aproblem with the MX records, how do I get this issue solved, any ideas?

DO's Support team cant help here.

'The recipient server did not accept our requests...'

This error message means that we tried to reach the server of the person you’re sending an email to, but didn’t get a reply, so we couldn’t send your email. This could be a temporary problem, and we suggest you try again later.

You could also contact the customer service department of the other domain (the one you’re sending to). The problem might be because:

The other domain doesn't have up-to-date MX records or is otherwise misconfigured.
The other domain is blacklisting or graylisting messages from Gmail.
The other domain has temporary networking problems.

9 Answers

Problem solved!! Changed inet_interfaces = all.

Thanks to Parminder Singh from the support team.

Happy Sunday! :)

  • Thank you very much. Searched the web for hours

    sudo vim /etc/postfix/main.cf
    -- press i
    -- go to inetinterfaces
    -- set inet
    interfaces to all
    sudo service postfix restart

  • After sudo vim /etc/postfix/main.cf
    I get no option with (i) but Open read only, Edit, Delete.

    When opening the file it shows:

    # Debian specific:  Specifying a file name will cause the first
    # line of that file to be used as the name.  The Debian default
    # is /etc/mailname.
    #myorigin = /etc/mailname
    
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no
    
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    
    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h
    
    readme_directory = no
    
    # TLS parameters
    smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
    smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
    smtpd_use_tls=yes
    "/etc/postfix/main.cf" [readonly] 42L, 1378C                  1,1           Top
    

    So no inet_interfaces = all.

What makes you think it's "clearly a problem with the MX records"?

Wouters-MBP:~ Woet$ dig +short MX yenidensen.com
5 mail.yenidensen.com.
Wouters-MBP:~ Woet$ dig +short A mail.yenidensen.com
178.62.224.65
Wouters-MBP:~ Woet$ telnet 178.62.224.65 25
Trying 178.62.224.65...
telnet: connect to address 178.62.224.65: Connection refused
telnet: Unable to connect to remote host
Wouters-MBP:~ Woet$

Hi! The MX records appear to be properly configured, however, I'm not able to access port 25 (SMTP) on 178.62.224.65.

Do you have a firewall running? Please post the output of the following command:

sudo ufw status

If you are not using UFW or if it outputs an error, try the following command instead:

sudo iptables -L -n -v
  • We haven't setup any firewalls when creating the droplet as far as I recall.

    root@yenidensen:~# sudo ufw status
    Status: inactive

    root@yenidensen:~# sudo iptables -L -n -v
    Chain INPUT (policy ACCEPT 10726 packets, 1850K bytes)
    pkts bytes target prot opt in out source destination

    Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
    pkts bytes target prot opt in out source destination

    Chain OUTPUT (policy ACCEPT 12120 packets, 2953K bytes)
    pkts bytes target prot opt in out source destination

    root@yenidensen:~#

  • Okay, the firewall settings are not blocking any connections so the issue must be something else. Is postfix running? Run this command to check if it is and see what IP address it is listening on:

    sudo netstat -plutn | grep 25
    
    • I am having same problem but so far none of this has worked for me.

      sudo netstat -plutn | grep 25
      tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 5300/master
      tcp6 0 0 :::25 :::* LISTEN 5300/master
      help please!!!!!

Per gmail mail not delivered message suggest so. Kindly note that I am not a developer so I may be missing a point to two.

So what do you think is the problem?
Droplet is up and running. I don't understand why you cannot connect to it in the above screen.

Good to isolate one problem! Here is

postfix is running:
root@yenidensen:~# sudo postfix status
postfix/postfix-script: the Postfix mail system is running: PID: 1027

root@yenidensen:~# sudo netstat -plutn | grep 25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1027/master

root@yenidensen:~#

root@yenidensen:~# sudo netstat -plutn | grep 25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1027/master

root@yenidensen:~# sudo postfix status
postfix/postfix-script: the Postfix mail system is running: PID: 1027
root@yenidensen:~#

where is this line to change i am having the same [ip]25 socket error only i can send mails from server not able to receive

inet_interfaces = all. where is this
Thanks In Advance

Not an answer, but a question. I sent an email from my Android phone using a gmail address and got this same message. If I don't fix what caused the "socket error" will the email continue to fail?

This is how I did it (using nano instead of vim):

  1. SSH-Login root
  2. type "sudo nano /etc/postfix/main.cf"
  3. Find line "inet_interfaces = loopback-only" and replace with "inet_interfaces = all"
  4. Save by CTRL+X and hit Y
  5. restart postfix by "sudo /etc/init.d/postfix restart"
Have another answer? Share your knowledge.