Five Star Rating

This simple WordPress plug-in allows viewers to rate a post.

jQuery showMessage

This jQuery plug-in allows you to easily create a 'twitter-like' notification.

Web Tips

Sharing our knowledge of CFML & jQuery and many other web development tips.

Dealing with sendmail errors

1
By admin in : Linux // Aug 19 2008

UPDATE: Please disregard all that is below (I was talking out my arse). All was good for some time and then I began getting this error again. After some extensive google searching, I found a lot of articles that indicated that using localhost.localdomain for host would cause the mail to be rejected. I changed my hosts file (keeping localhost.localdomain localhost of course) and rebooted. Still didn’t have much luck so I installed sendmail from scratch again using the following instructions from howtoforge and all was good.

http://www.howtoforge.com/configuring-sendmail-to-act-as-a-smarthost-and-to-rewrite-from-address

Again DO NOT USE THE DESTRUCTIONS BELOW

I noticed last week that my emails were not being delivered properly. After taking a look at when the issue started, I realized that it was about the same time I updated my box.

My email was being returned with the reason: 550 Banned rcpt apache@localhost.localdomain. There was also another error 554 5.0.0 Service unavailable. Both of these errors on their own were not to helpful. I asked a friend (the one who sold me the box) to help and he gave me some good advice, but I was unable to resolve the issue and several Google searches didn’t reveal any solution.

I checked the maillog in /var/log/ and found that the mail was being sent internally, but I have to use my ISP mail server to actually deliver the messages and this was not happening. The error I found in the mail log that helped was “stat=Deferred: Temporary AUTH failure”. I was able to find the resolution to the issue right on the Sendmail.org site.

I use my sendmail as a client and up until last week I never had any issue with the setup I was using. I am still not sure if I began having an issue with sendmail because it was updated or if it was just my ISP found the security issue with the way I was using it, but eithr way, it stopped working correctly.

Here is the error:

----- The following addresses had permanent fatal errors -----
<apache@localhost.localdomain>
(reason: 550 Banned rcpt apache@localhost.localdomain *@localhost.localdomain)

----- Transcript of session follows -----
... while talking to mail.cableone.net.:
>>> RCPT To:<apache@localhost.localdomain>
<<< 550 Banned rcpt apache@localhost.localdomain *@localhost.localdomain
550 5.1.1 <apache@localhost.localdomain>... User unknown

Final-Recipient: RFC822; apache@localhost.localdomain
Action: failed
Status: 5.1.1
Remote-MTA: DNS; mail.cableone.net
Diagnostic-Code: SMTP; 550 Banned rcpt apache@localhost.localdomain *@localhost.localdomain
Last-Attempt-Date: Mon, 18 Aug 2008 21:45:23 -0500

---------- Forwarded message ----------
From: Mail Delivery Subsystem <MAILER-DAEMON>
To: <apache@localhost.localdomain>
Date: Mon, 18 Aug 2008 20:45:31 -0500
Subject: Returned mail: see transcript for details
----- The following addresses had permanent fatal errors -----
<support@cityofdilworth.com>
(reason: 550 Banned from (apache@localhost.localdomain) (*@localhost.localdomain))

----- Transcript of session follows -----
... while talking to mail.cableone.net.:
>>> MAIL From:<apache@localhost.localdomain> SIZE=1521
<<< 550 Banned from (apache@localhost.localdomain) (*@localhost.localdomain)
554 5.0.0 Service unavailable

Final-Recipient: RFC822; support@cityofdilworth.com
Action: failed
Status: 5.0.0
Diagnostic-Code: SMTP; 550 Banned from (apache@localhost.localdomain) (*@localhost.localdomain)
Last-Attempt-Date: Mon, 18 Aug 2008 20:45:31 -0500

---------- Forwarded message ----------

To resolve the issue, simply follow the instructions to setup SMTP AUTH that were provided by Benji Fisher. To start, log onto your machine as root.

  1. Change directory to where your sendmail configuration files (sendmail.mc and sendmail.cf) are located, usually /etc/mail/
  2. Create a safe subdirectory (suggested name auth/):# mkdir auth
    # chmod 700 auth
  3. Create a file with your authentication information (suggested name auth/client-info):
    AuthInfo:your.isp.net "U:root" "I:user" "P:password"

    filling in your ISP’s mail server, your user name, and your password. (Note: Earthlink, and perhaps other ISP’s, requires your full e-mail address as a user name.)

  4. Generate the authentication database and make both files readable only by root:
    # cd auth
    # makemap hash client-info < client-info
    # chmod 600 client-info*
    # cd ..
  5. Add the following lines to your sendmail.mc file, filling in your ISP’s mail server:define(`SMART_HOST',`your.isp.net')dnl
    define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
    FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl
  6. Generate sendmail.cf:# m4 sendmail.mc > sendmail.cf
  7. Restart the sendmail daemon, e.g., (this depends on your OS):# service sendmail restart or # /etc/init.d/sendmail restart

That should take care of the issue!

About the Author

admin has written 22 articles for dingobytes.

Andrew Alba is a Software Engineer who recently relocated to Minneapolis-St Paul area after living in NW Minnesota for two decades. Andrew is currently employed with Internet Broadcasting Systems in St Paul, MN after spending almost five years with Interive Media Group in Fargo, ND. Andrew enjoys developing solutions using CFML, JavaScript, AJAX, PHP and anything else he can steal from the web.
  • http://www.geeks.ltd.uk/Services.html software developers

    Humm… interesting,

    Some great advice,

    Thanks for sharing,

    Keep up the good work