{"id":512,"date":"2025-08-10T16:39:10","date_gmt":"2025-08-10T16:39:10","guid":{"rendered":"https:\/\/d-mashina.net\/?p=512"},"modified":"2025-08-10T16:39:10","modified_gmt":"2025-08-10T16:39:10","slug":"the-case-of-the-500-mile-email","status":"publish","type":"post","link":"https:\/\/d-mashina.net\/index.php\/2025\/08\/10\/the-case-of-the-500-mile-email\/","title":{"rendered":"The case of the 500 mile email"},"content":{"rendered":"<p>Pred leti sem naletel na ta zapis, povsem sem pozabil nanj. V\u010deraj pa ponovno.<\/p>\n<blockquote>\n<pre>From: Trey Harris &lt;trey@sage.org&gt;\r\n\r\nHere's a problem that *sounded* impossible...  I almost regret posting\r\nthe story to a wide audience, because it makes a great tale over drinks\r\nat a conference. :-)  The story is slightly altered in order to protect\r\nthe guilty, elide over irrelevant and boring details, and generally make\r\nthe whole thing more entertaining.\r\n\r\nI was working in a job running the campus email system some years ago\r\nwhen I got a call from the chairman of the statistics department.\r\n\r\n\"We're having a problem sending email out of the department.\"\r\n\r\n\"What's the problem?\" I asked.\r\n\r\n\"We can't send mail more than 500 miles,\" the chairman explained.\r\n\r\nI choked on my latte.  \"Come again?\"\r\n\r\n\"We can't send mail farther than 500 miles from here,\" he repeated.  \"A\r\nlittle bit more, actually.  Call it 520 miles.  But no farther.\"\r\n\r\n\"Um... Email really doesn't work that way, generally,\" I said, trying\r\nto keep panic out of my voice.  One doesn't display panic when speaking\r\nto a department chairman, even of a relatively impoverished department\r\nlike statistics.  \"What makes you think you can't send mail more than\r\n500 miles?\"\r\n\r\n\"It's not what I *think*,\" the chairman replied testily.  \"You see, when\r\nwe first noticed this happening, a few days ago--\"\r\n\r\n\"You waited a few DAYS?\" I interrupted, a tremor tinging my voice.  \"And\r\nyou couldn't send email this whole time?\"\r\n\r\n\"We could send email.  Just not more than--\"\r\n\r\n\"--500 miles, yes,\" I finished for him, \"I got that.  But why didn't\r\nyou call earlier?\"\r\n\r\n\"Well, we hadn't collected enough data to be sure of what was going on\r\nuntil just now.\"  Right.  This is the chairman of *statistics*. \"Anyway,\r\nI asked one of the geostatisticians to look into it--\"\r\n\r\n\"Geostatisticians...\"\r\n\r\n\"--yes, and she's produced a map showing the radius within which we can\r\nsend email to be slightly more than 500 miles.  There are a number of\r\ndestinations within that radius that we can't reach, either, or reach\r\nsporadically, but we can never email farther than this radius.\"\r\n\r\n\"I see,\" I said, and put my head in my hands.  \"When did this start?\r\nA few days ago, you said, but did anything change in your systems at\r\nthat time?\"\r\n\r\n\"Well, the consultant came in and patched our server and rebooted it.\r\nBut I called him, and he said he didn't touch the mail system.\"\r\n\r\n\"Okay, let me take a look, and I'll call you back,\" I said, scarcely\r\nbelieving that I was playing along.  It wasn't April Fool's Day.  I\r\ntried to remember if someone owed me a practical joke.\r\n\r\nI logged into their department's server, and sent a few test mails.\r\nThis was in the Research Triangle of North Carolina, and a test mail to\r\nmy own account was delivered without a hitch.  Ditto for one sent to\r\nRichmond, and Atlanta, and Washington.  Another to Princeton (400 miles)\r\nworked.\r\n\r\nBut then I tried to send an email to Memphis (600 miles).  It failed.\r\nBoston, failed.  Detroit, failed.  I got out my address book and started\r\ntrying to narrow this down.  New York (420 miles) worked, but Providence\r\n(580 miles) failed.\r\n\r\nI was beginning to wonder if I had lost my sanity.  I tried emailing a\r\nfriend who lived in North Carolina, but whose ISP was in Seattle.\r\nThankfully, it failed.  If the problem had had to do with the geography\r\nof the human recipient and not his mail server, I think I would have\r\nbroken down in tears.\r\n\r\nHaving established that -- unbelievably -- the problem as reported was\r\ntrue, and repeatable, I took a look at the sendmail.cf file.  It looked\r\nfairly normal.  In fact, it looked familiar.\r\n\r\nI diffed it against the sendmail.cf in my home directory.  It hadn't been\r\naltered -- it was a sendmail.cf I had written.  And I was fairly certain\r\nI hadn't enabled the \"FAIL_MAIL_OVER_500_MILES\" option.  At a loss, I\r\ntelnetted into the SMTP port.  The server happily responded with a SunOS\r\nsendmail banner.\r\n\r\nWait a minute... a SunOS sendmail banner?  At the time, Sun was still\r\nshipping Sendmail 5 with its operating system, even though Sendmail 8 was\r\nfairly mature.  Being a good system administrator, I had standardized on\r\nSendmail 8.  And also being a good system administrator, I had written a\r\nsendmail.cf that used the nice long self-documenting option and variable\r\nnames available in Sendmail 8 rather than the cryptic punctuation-mark\r\ncodes that had been used in Sendmail 5.\r\n\r\nThe pieces fell into place, all at once, and I again choked on the dregs\r\nof my now-cold latte.  When the consultant had \"patched the server,\" he\r\nhad apparently upgraded the version of SunOS, and in so doing\r\n*downgraded* Sendmail.  The upgrade helpfully left the sendmail.cf\r\nalone, even though it was now the wrong version.\r\n\r\nIt so happens that Sendmail 5 -- at least, the version that Sun shipped,\r\nwhich had some tweaks -- could deal with the Sendmail 8 sendmail.cf, as\r\nmost of the rules had at that point remained unaltered.  But the new\r\nlong configuration options -- those it saw as junk, and skipped.  And\r\nthe sendmail binary had no defaults compiled in for most of these, so,\r\nfinding no suitable settings in the sendmail.cf file, they were set to\r\nzero.\r\n\r\nOne of the settings that was set to zero was the timeout to connect to\r\nthe remote SMTP server.  Some experimentation established that on this\r\nparticular machine with its typical load, a zero timeout would abort a\r\nconnect call in slightly over three milliseconds.\r\n\r\nAn odd feature of our campus network at the time was that it was 100%\r\nswitched.  An outgoing packet wouldn't incur a router delay until hitting\r\nthe POP and reaching a router on the far side.  So time to connect to a\r\nlightly-loaded remote host on a nearby network would actually largely be\r\ngoverned by the speed of light distance to the destination rather than by\r\nincidental router delays.\r\n\r\nFeeling slightly giddy, I typed into my shell:\r\n\r\n$ units\r\n1311 units, 63 prefixes\r\n\r\nYou have: 3 millilightseconds\r\nYou want: miles\r\n        * 558.84719\r\n        \/ 0.0017893979\r\n\r\n\"500 miles, or a little bit more.\"\r\n\r\nTrey Harris\r\n-- \r\nI'm looking for work.  If you need a SAGE Level IV with 10 years Perl,\r\ntool development, training, and architecture experience, please email\r\nme at trey@sage.org.  I'm willing to relocate for the right opportunity.\r\n\r\n\r\n<\/pre>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Pred leti sem naletel na ta zapis, povsem sem pozabil nanj. V\u010deraj pa ponovno. From: Trey Harris &lt;trey@sage.org&gt; Here&#8217;s a problem that *sounded* impossible&#8230; I almost regret posting [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,102,125],"tags":[],"class_list":["post-512","post","type-post","status-publish","format-standard","hentry","category-posta","category-sploosno","category-unix"],"_links":{"self":[{"href":"https:\/\/d-mashina.net\/index.php\/wp-json\/wp\/v2\/posts\/512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/d-mashina.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/d-mashina.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/d-mashina.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/d-mashina.net\/index.php\/wp-json\/wp\/v2\/comments?post=512"}],"version-history":[{"count":1,"href":"https:\/\/d-mashina.net\/index.php\/wp-json\/wp\/v2\/posts\/512\/revisions"}],"predecessor-version":[{"id":513,"href":"https:\/\/d-mashina.net\/index.php\/wp-json\/wp\/v2\/posts\/512\/revisions\/513"}],"wp:attachment":[{"href":"https:\/\/d-mashina.net\/index.php\/wp-json\/wp\/v2\/media?parent=512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/d-mashina.net\/index.php\/wp-json\/wp\/v2\/categories?post=512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/d-mashina.net\/index.php\/wp-json\/wp\/v2\/tags?post=512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}