Came across this while stumbling through the internet. This ought to be one of the craziest bugs I have ever seen đ
Quite an interesting case, check it out.
To: [email protected] Subject: The case of the 500-mile email. Date: Tue, 26 Nov 2002 14:57:40 -0800
Hereâs a problem that *sounded* impossible⊠I almost regret posting the story to a wide audience, because it makes a great tale over drinks at a conference. đ The story is slightly altered in order to protect the guilty, elide over irrelevant and boring details, and generally make the whole thing more entertaining.
I was working in a job running the campus email system some years ago when I got a call from the chairman of the statistics department.
âWeâre having a problem sending email out of the department.â
âWhatâs the problem?â I asked.
âWe canât send mail more than 500 miles,â the chairman explained.
I choked on my latte. âCome again?â
âWe canât send mail farther than 500 miles from here,â he repeated. âA little bit more, actually. Call it 520 miles. But no farther.â
âUm⊠Email really doesnât work that way, generally,â I said, trying to keep panic out of my voice. One doesnât display panic when speaking to a department chairman, even of a relatively impoverished department like statistics. âWhat makes you think you canât send mail more than 500 miles?â
âItâs not what I *think*,â the chairman replied testily. âYou see, when we first noticed this happening, a few days agoââ
âYou waited a few DAYS?â I interrupted, a tremor tinging my voice. âAnd you couldnât send email this whole time?â
âWe could send email. Just not more thanââ
ââ500 miles, yes,â I finished for him, âI got that. But why didnât you call earlier?â
âWell, we hadnât collected enough data to be sure of what was going on until just now.â Right. This is the chairman of *statistics*. âAnyway, I asked one of the geostatisticians to look into itââ
âGeostatisticiansâŠâ
ââyes, and sheâs produced a map showing the radius within which we can send email to be slightly more than 500 miles. There are a number of destinations within that radius that we canât reach, either, or reach sporadically, but we can never email farther than this radius.â
âI see,â I said, and put my head in my hands. âWhen did this start? A few days ago, you said, but did anything change in your systems at that time?â
âWell, the consultant came in and patched our server and rebooted it. But I called him, and he said he didnât touch the mail system.â
âOkay, let me take a look, and Iâll call you back,â I said, scarcely believing that I was playing along. It wasnât April Foolâs Day. I tried to remember if someone owed me a practical joke.
I logged into their departmentâs server, and sent a few test mails.
This was in the Research Triangle of North Carolina, and a test mail to my own account was delivered without a hitch. Ditto for one sent to Richmond, and Atlanta, and Washington. Another to Princeton (400 miles) worked.
But then I tried to send an email to Memphis (600 miles). It failed. Boston, failed. Detroit, failed. I got out my address book and started trying to narrow this down. New York (420 miles) worked, but Providence (580 miles) failed.
I was beginning to wonder if I had lost my sanity. I tried emailing a friend who lived in North Carolina, but whose ISP was in Seattle. Thankfully, it failed. If the problem had had to do with the geography of the human recipient and not his mail server, I think I would have broken down in tears.
Having established that â unbelievably â the problem as reported was true, and repeatable, I took a look at the sendmail.cf file. It looked fairly normal. In fact, it looked familiar.
I diffed it against the sendmail.cf in my home directory. It hadnât been altered â it was a sendmail.cf I had written. And I was fairly certain I hadnât enabled the âFAIL_MAIL_OVER_500_MILESâ option. At a loss, I telnetted into the SMTP port. The server happily responded with a SunOS sendmail banner.
Wait a minute⊠a SunOS sendmail banner? At the time, Sun was still shipping Sendmail 5 with its operating system, even though Sendmail 8 was fairly mature. Being a good system administrator, I had standardized on Sendmail 8. And also being a good system administrator, I had written a sendmail.cf that used the nice long self-documenting option and variable names available in Sendmail 8 rather than the cryptic punctuation-mark codes that had been used in Sendmail 5.
The pieces fell into place, all at once, and I again choked on the dregs of my now-cold latte. When the consultant had âpatched the server,â he had apparently upgraded the version of SunOS, and in so doing *downgraded* Sendmail. The upgrade helpfully left the sendmail.cf alone, even though it was now the wrong version.
It so happens that Sendmail 5 â at least, the version that Sun shipped, which had some tweaks â could deal with the Sendmail 8 sendmail.cf, as most of the rules had at that point remained unaltered. But the new long configuration options â those it saw as junk, and skipped. And the sendmail binary had no defaults compiled in for most of these, so, finding no suitable settings in the sendmail.cf file, they were set to zero.
One of the settings that was set to zero was the timeout to connect to the remote SMTP server. Some experimentation established that on this particular machine with its typical load, a zero timeout would abort a connect call in slightly over three milliseconds.
An odd feature of our campus network at the time was that it was 100% switched. An outgoing packet wouldnât incur a router delay until hitting the POP and reaching a router on the far side. So time to connect to a lightly-loaded remote host on a nearby network would actually largely be governed by the speed of light distance to the destination rather than by incidental router delays.
Feeling slightly giddy, I typed into my shell:
$ units
1311 units, 63 prefixes
You have: 3 millilightseconds
You want: miles * 558.84719 / 0.0017893979
â500 miles, or a little bit more.â
Trey Harris