Thursday, October 21, 2010

"DSN: Service unavailable" when relaying email through Red Hat Linux


I wrote a simple JSP that relays mail off of the same server the code is hosted on. The /var/log/maillog file showed the following error:

Oct 21 19:41:17 oradev sendmail[7681]: o9LNpH03007681: from=<>, size=385, class=0, nrcpts=1, msgid=<>, proto=ESMTP, daemon=MTA, relay=localhost []
Oct 21 19:41:19 oradev sendmail[7683]: o9LNpH03007681: to=<>, delay=00:00:02, xdelay=00:00:02, mailer=esmtp, pri=120385, [], dsn=5.0.0, stat=Service unavailable
Oct 21 19:41:19 oradev sendmail[7683]: o9LNpH03007681: o9LNpJ03007683: DSN: Service unavailable
Even though the 'to' email address is valid, the 'from' email address was intentionally spoofed (i.e., the 'from' address is not a real address).


1. Make sure that the domain name of the 'from' email address is a valid mail server, otherwise it might be rejected.

Obviously make sure that your DNS is configured correctly and that both the 'to' and 'from' servers are accessible.

Rerunning the scenario now works, and /var/log/maillog shows:
Oct 21 19:50:50 oradev sendmail[7678]: o9LNoouZ007678: from=<>, size=375, class=0, nrcpts=1, msgid=<>, proto=ESMTP, daemon=MTA, relay=localhost []
Oct 21 19:50:51 oradev sendmail[7680]: o9LNoouZ007678: to=<;, delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=120375, [], dsn=2.0.0, stat=Sent (OK 1287705051 u36si4103378weq.17)
Applicable Versions:

Red Hat AS 4 Update 4

1 comment:

Anonymous said...

well i have the same problem and emails sometimes get sent and sometimes not:

in /var/log/messges
i am geeting:
16:54:47 srvmon-Bellakt sm-mta[17248]: pA3Dsifc017248: to=, ctladdr= (0/0), delay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=30322, [], dsn=2.0.0, stat=Sent (OK id=1RLxkj-0002dF-6r)
Nov 3 16:54:47 srvmon-Bellakt sendmail[17237]: pA3DseMv017237:, ctladdr=root (0/0), delay=00:00:07, xdelay=00:00:03, mailer=relay, pri=30005, relay=[] [], dsn=2.0.0, stat=Sent (pA3Dsifc017248 Message accepted for delivery)

when it gets sent
and when it fails to be sent i get:
Nov 3 17:17:20 srvmon-Bellakt sm-mta[32754]: pA3EHG4E032754: to=, ctladdr= (0/0), delay=00:00:04, xdelay=00:00:04, mailer=esmtp, pri=30364, [], dsn=5.0.0, stat=Service unavailable