只能发500英里的邮件

From: Trey Harris

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

--

I'm looking for work.  If you need a SAGE Level IV with 10 years Perl,

tool development, training, and architecture experience, please email

me at trey@sage.org.  I'm willing to relocate for the right opportunity.



原文链接:http://web.mit.edu/jemorris/humor/500-miles

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,456评论 5 477
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,370评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,337评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,583评论 1 273
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,596评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,572评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,936评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,595评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,850评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,601评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,685评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,371评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,951评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,934评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,167评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 43,636评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,411评论 2 342

推荐阅读更多精彩内容