Sendmail not working? Maybe your server’s IP is on a block list

This is pretty arcane, even for me, but since I spent several hours troubleshooting this problem this week — and the solution was nowhere to be found on Google — I figured it was worth sharing.

My CMS, cms34, as I’ve mentioned a few times before, is built on CakePHP. Some features of cms34 include automatically generated email messages. CakePHP has a nice email component that facilitates a lot of this work. It can be configured to use an SMTP server, but by default it sends mail directly from the web server using whatever you have installed on the server, either the ubiquitous sendmail or the more powerful (and capitalized) Postfix. Don’t unleash a deluge of flame comments on me, but I’m using sendmail. So be it.

All was working well until a few weeks ago, when suddenly none of the mails were being sent. There were no errors on the website; the messages just wouldn’t go through. What was more confusing was that messages being sent to my own domain did go through, but for those being sent to my clients’ domains, nothing.

Nothing except log entries, that is. Specifically, the mail log was filling up with lines like this:

Sep 13 13:45:56 redacted sm-mta[28158]: o8DIjsx0028156:
to=<redacted@redacted.com>, ctladdr=<redacted@redacted.com>
(33/33), delay=00:00:02, xdelay=00:00:01,
mailer=esmtp, pri=120799, relay=redacted.com.
[123.456.789.000], dsn=5.7.1, stat=Service unavailable

(Note that I’ve removed the real email and IP addresses to protect the innocent, namely myself.)

“Service unavailable,” huh? I researched that error extensively, without finding much. Eventually I was led to believe it may be an issue with my hostname, hosts, hosts.allow and/or hosts.deny files.

A few relevant points: 1) my hosts.allow file only contains one (uncommented) line: sendmail: LOCAL and 2) likewise, the hosts.deny file only contains: ALL: PARANOID. I’ll save you some time right here: the problem I had ended up having nothing whatsoever to do with any of these host-related files. Leave ’em alone.

After following a number of these dead ends, I was inspired to check the mail file on the server for the user Apache runs as, in my case www-data. On Ubuntu Linux (and probably other flavors), these mail files can be found in /var/mail. Indeed, there were some interesting things to be found there, namely, a number of references to this URL:

http://www.spamhaus.org/query/bl?ip=123.456.789.000

(Again, the IP address has been changed… and yes, I know that’s not a valid IP address. That’s the point.)

I was not previously aware of The Spamhaus Project, but perhaps I should have been. The reason my messages weren’t getting through was because my server’s IP address was on the PBL: Policy Block List. Essentially, that is a list of all of the IP addresses (or IP ranges) in the world that, according to a well-defined set of rules, have no business acting like SMTP (Simple Mail Transfer Protocol*) servers — the servers that send mail out.

It stands to reason that my server was on this list; technically it’s not an SMTP server. But it’s perfectly legitimate for a web server to be running sendmail or Postfix or something of that nature, and sending messages out from the web applications it runs. Fortunately, it’s easy to get legitimate servers removed from the PBL. Simply fill out a form, verify your identity (via a code sent to you in an email message), and within about an hour, the changes will propagate worldwide.

Success! So if you’re in the same kind of situation I was in, where everything seems to be configured properly but your messages just aren’t going out for some reason, try checking Spamhaus to see if your IP is on the PBL.

* If you made it this far in the post, I shouldn’t have to explain the acronym. But I will anyway, as is my wont.

Two critical reads for anyone who’s planning to vote (and even moreso for those who aren’t!)

I just read a couple of great articles on Alternet. Now before you (as a McCain supporter) go dismissing Alternet as liberal fringe media, I would ask you to just carefully read the following two articles.

First, a roundup of excerpts from newspapers and news magazines around the country calling the McCain/Palin campaign to task for some of the egregious lies they’ve been perpetuating lately, both against Obama and for themselves.

And second, a very well-thought-out article debunking conservative myths about national security. This brilliant article shows us what’s wrong with our current administration’s clumsy assumptions about the threat of Islamic terrorism, and also points out the things we should be worried about, but aren’t. (Or at least, aren’t worried enough about.)

And now your daily dose of sheer ridiculousness…

Shockingly lame, mildly offensive (probably moreso if you’re Native American), yet hilariously ill-conceived and even more hilariously ill-executed, we have this music video for a disco-fied version of the oft-covered surf rock hit “Apache.”

I can’t make out the name of the band written on the bass drum head, and it doesn’t seem to match any listed here.

Although I will never recover the precious minutes of my life wasted watching this, and I may never even know the name of the band (so I can take care to avoid them in the future), at least one good thing came of this: my discovery of the Second Hand Songs site, which is actually a pretty cool idea!

Update (September 29, 2006): I guess I should’ve just checked Google Video… there, we have the song identified as the work of the Tommy Seebach Band.

John Hodgman in George Plimpton homage

As I flipped to “Talk of the Town” in the latest issue of the New Yorker, I was immediately taken aback by the full-page ad on the facing page.

The first thing I noticed was John Hodgman, (probably) better known as “The PC” in the recent Apple ads. Here he was not playing the straight man to Justin Long‘s cool, laid-back Mac, but rather hawking his own book, The Areas of My Expertise. But what really got me was the ad itself. It was a perfect send-up of the old George Plimpton ads for Intellivision in the early ’80s, wherein he compared Atari’s Home Run against Mattel’s Major League Baseball.

Here, Hodgman’s spoof pits Intellivision against “Complete World Knowledge.”

It’s a fairly obscure ad to parody, but I’m glad to see that I’m not the only person who caught the reference. John Hodgman’s own blog explains a bit more here and here.

And, since I understand the ephemeral nature of the Internet (better than I understand the definition of “ephemeral,” in fact), I’ve grabbed the two images from Flickr just so this post doesn’t become incomprehensible in a month. (Yes, I think my blog entries have more staying power than Flickr.)

George Plimpton in Intellivision ad
John Hodgman in John Hodgman ad