6

I have configured sendmail in an Ubuntu 12.04 64 bit machine. When I send email through a perl script it gives the below error:

 dsn=5.0.0, stat=Service unavailable

and mail is not being sent. I checked on another machine where it is sending email and functioning as designed dsn=2.0.0, stat=sent.

How can I make it work or change settings for proper functionality?

The logs are :

Sep  2 17:38:12 mail sendmail[5522]: r82C8CpE005522: from=root, size=148, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
Sep  2 17:38:13 mail sm-mta[5523]: r82C8CtA005523: from=<[email protected]>, size=373, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Sep  2 17:38:13 mail sendmail[5522]: r82C8CpE005522: [email protected], ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30148, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (r82C8CtA005523 Message accepted for delivery)
Sep  2 17:38:16 mail sm-mta[5525]: STARTTLS=client, relay=gmail-smtp-in.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=DES-CBC3-SHA, bits=168/168
Sep  2 17:38:19 mail sm-mta[5525]: r82C8CtA005523: to=<[email protected]>, ctladdr=<[email protected]> (0/0), delay=00:00:06, xdelay=00:00:06, mailer=esmtp, pri=120373, relay=gmail-smtp-in.l.google.com. [173.194.79.27], dsn=5.0.0, stat=Service unavailable
Sep  2 17:38:19 mail sm-mta[5525]: r82C8CtA005523: r82C8JtA005525: DSN: Service unavailable
Sep  2 17:38:19 mail sm-mta[5525]: r82C8JtA005525: to=<[email protected]>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent

etc/mail/access is

Connect:localhost       RELAY
GreetPause:localhost    0
ClientRate:localhost    0
ClientConn:localhost    0

Connect:127             RELAY
GreetPause:127          0
ClientRate:127          0
ClientConn:127          0
Connect:IPv6:::1        RELAY
GreetPause:IPv6:::1     0
ClientRate:IPv6:::1     0
ClientConn:IPv6:::1     0

# Defaults
GreetPause:             5000
ClientRate:             10
ClientConn:             10

Spam:postmaster@    FRIEND
Spam:abuse@     FRIEND
Spam:spam@      FRIEND

#Connect:0      REJECT whilst invalid, this also blocks sendmail -bs -Am
Connect:169.254 REJECT
Connect:192.0.2 REJECT
Connect:224     REJECT
Connect:255     REJECT
10
  • You have to check the according logs, they should give you more information about what's happening. I'm not sure where these logs are on Ubuntu, but I would guess it might be in /var/log/messages or /var/log/mail*
    – replay
    Commented Sep 2, 2013 at 10:45
  • Can you share your config. files?
    – slm
    Commented Sep 2, 2013 at 10:59
  • Specifically the file /etc/mail/access
    – slm
    Commented Sep 2, 2013 at 11:17
  • 2
    It's really hard to read the logs when you paste them in comments. Could you please put them inside the original question instead?
    – Jenny D
    Commented Sep 2, 2013 at 12:56
  • 1
    @jenny:thanks for reply..mail.server.local is my FQDN . could you brief it on ssl setting i need to follow ..
    – suhas
    Commented Sep 2, 2013 at 14:19

4 Answers 4

3

A "Service Unavailable" as a DSN 5 is quite often due to an expanded DSN notice. Take the following for example:

220 banner-something-something
EHLO mailer.example.com
250-banner response
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-STARTTLS
MAIL FROM: [email protected]
250 2.1.0 Sender ok
RCPT TO: [email protected]
250 2.1.5 Recipient ok
DATA
550-5.7.1 [10.10.10.10] Mail from this IP has been blacklisted due to user
550-5.7.1 complaints.  Please visit our website to get de-listed
554 5.0.0 Service unavailable

At this point, it is the sending client's responsibility to do something with the DSN. Anything that supports the expanded DSNs will create a bounceback that includes all the 550 lines. Anything that doesn't support it (and a lot of logging on some servers) will only show the 554 line.

This line shows the bounce (r82C8JtA005525) being generated:

Sep  2 17:38:19 mail sm-mta[5525]: r82C8CtA005523: r82C8JtA005525: DSN: Service unavailable

One thing I would check offhand would be to see if the HELO is the same on sm-mta as the base sendmail. At that point, the sendmail instance will think that there's a mail loop and reject the message.

Barring that, check the bounce or get a packet capture and run it through wireshark to see exactly what is being passed back and forth.

3

I encountered a similar kind of situation once. The problem here lies in the line

Sep  2 17:38:19 mail sm-mta[5525]: r82C8CtA005523: to=<[email protected]>, ctladdr=<[email protected]> (0/0), delay=00:00:06, xdelay=00:00:06, mailer=esmtp, pri=120373, relay=gmail-smtp-in.l.google.com. [173.194.79.27], dsn=5.0.0, stat=Service unavailable

Check to see if you are able to send email using the terminal and note the difference in the error logs.

This is probably a DNS problem. Make sure that the mail server is pointed at the correct DNS server in /etc/resolv.conf, and that the DNS server is returning the correct MX address for the domains it is serving.

1
  • +1 with a minor correction; that should be /etc/resolv.conf, without the 'e'
    – Jongosi
    Commented Dec 4, 2014 at 10:01
1

I know this is old but for people that may come across this thread having the same issue, as I just have, the problem for me was Google blocking 'unusual activity'. Check your google account here and verify any suspicious sign-ins if there are any.

1

I am using AWS SES to send emails. I got this error because the from email address domain in send email header is not verified by AWS. Be careful that the [email protected] in mail.log may be different from the "From" in email header.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .