On my Redhat Prod Server I installed Sendmail that I will use to send DB Backup completion mails to my email id.When I send a email from My Server A 172.16.233.2 to my email id abc@domain.com. usingsendmail -v myemailid@domain.com < /opt/dailydbscriptoutput.txtmyemailid@domain.com... Connecting to [127.0.0.1] via relay...220 db.erp.com ESMTP Sendmail 8.13.8/8.13.8; Thu, 7 Aug 2014 13:37:17 +0300>>> EHLO pmmcdb.erp.com250-db.erp.com Hello localhost.localdomain [127.0.0.1], pleased to meet you250-ENHANCEDSTATUSCODES250-PIPELINING250-8BITMIME250-SIZE250-DSN250-ETRN250-DELIVERBY250 HELP>>> MAIL From:<emerg@db.erp.com> SIZE=59250 2.1.0 <emerg@db.erp.com>... Sender ok>>> RCPT To:<myemailid@domain.com>>>> DATA250 2.1.5 <myemailid@domain.com>... Recipient ok354 Enter mail, end with . on a line by itself>>> .250 2.0.0 s77AbH2H025298 Message accepted for deliverymyemailid@domain.com... Sent (s77AbH2H025298 Message accepted for delivery)Closing connection to [127.0.0.1]>>> QUIT221 2.0.0 db.erp.com closing connectionI get the above message. But when I check the Log /var/log/maillog. I See thisAug  7 12:18:41db sendmail[11808]: s779If28011808: from=emerg, size=59, class=0, nrcpts=1, msgid=<201408070918.s779If28011808@db.erp.com>, relay=emerg@localhostAug  7 12:18:41 db sendmail[11809]: s779Ifss011809: from=<emerg@db.erp.com>, size=342, class=0, nrcpts=1, msgid=<201408070918.s779If28011808@db.erp.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]Aug  7 12:18:41 db sendmail[11808]: s779If28011808: to=myemailid@domain.com, ctladdr=emerg (503/503), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30059, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (s779Ifss011809 Message accepted for delivery)Aug  7 12:18:42 db sendmail[11811]: s779Ifss011809: to=<myemailid@domain.com>, ctladdr=<emerg@db.erp.com> (503/503), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=120342, relay=mail1 [10.171.1.10], **dsn=5.6.0, stat=Data format error**Previously I was facing issue on server related to DNS. Name server timeoutSo I followed this Link Setup Sendmail without DNS to solve the issue and on another Test server it started working and then I applied the same procedure on this Production server and im not able to send messagesAfter Testingsendmail -Am -v myemailid@domain.com  < /tmp/email.txtmyemailid@domain.com... Connecting to mail1 via relay...220 mail1.etradeportal.net ESMTP Sendmail 8.13.1/8.13.1; Thu, 7 Aug 2014 15:18:51 +0300>>> EHLO db.erp.com250-mail1.etradeportal.net Hello [172.16.233.2], pleased to meet you250-ENHANCEDSTATUSCODES250-PIPELINING250-8BITMIME250-SIZE250-DSN250-ETRN250-AUTH DIGEST-MD5 CRAM-MD5250-DELIVERBY250 HELP>>> MAIL From:<root@db.erp.com> SIZE=108553 5.1.8 <root@db.erp.com>... Domain of sender address root@db.erp.com does not exist/root/dead.letter... Saved message in /root/dead.letterClosing connection to mail1>>> QUIT221 2.0.0 mail1.etradeportal.net closing connection
Sendmail Message Fail
rhel;sendmail
Try the script below:#!/bin/shFILE=/opt/dailydbscriptoutput.txt TO=myemailid@domain.com (cat - $FILE <<END) | /usr/sbin/sendmail -i $TOTO: $TOENDSendmail expects headers and body separated by an empty line in raw format. To get better debug info execute the above script as root with -Am -v command line options passed to sendmail.Fixing Domain of sender address root@db.erp.com does not existOn the receiving host add db.erp.com entry to /etc/hosts file [db.erp.com uses private/non public/intranet only IP address]