sendmail dsn=5.6.0, stat=Data format error

Just faced this issue today and here are some tips on troubleshooting.
My environment (RedHat 5.9 , sendmail-8.13.8-8.1.el5_7)
While trying to send mail from command line

mail -s "Subject" user@domain < textfile

and monitoring /var/log/maillog I could see that message was rejected with below error

dsn=5.6.0, stat=Data format error

Not a very user friendly error description, so I’ve decided to trace communication with tcpdump between sendmail running on the host from which I’m sending e-mail and relay.
To my surprise this error was coming due to relay not accepting domain name of my server

I had few other servers that were sending e-mails fine to the same relay host, but these servers were running postfix, so I could not compare configuration to or files.
Tracing postfix to relay host communication with tcpdump revealed what domain name relay was accepting.
My next step was to masquerade domain name coming from sendmail and make it look same as the one coming from postfix

Here are a few articles that talk exactly about this

How to rewrite sender address
Masquerading and Relaying
Sendmail masquerade outgoing email address

So including these lines in my /etc/mail/ file


Generating new

make -C /etc/mail

and restarting sendmail

service sendmail restart

Fixed the issue for me.

This entry was posted in Linux, Networking, sendmail. Bookmark the permalink.

One Response to sendmail dsn=5.6.0, stat=Data format error

  1. Marlon Marques says:

    AMAZING TIP! I had the same problem with an Amazon EC2 Instance and the solution described here worked perfectly!

    Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *