Subject: Returned Mail: User Unknown 73 Date: Tue, 30 Apr 91 02:11:58 EDT From: Steve Strassmann straz@media-lab.mit.edu To: UNIX-HATERS Subject: Unix and parsing You know, some of you might be saying, hell, why does this straz guy send so much mail to UNIX-HATERS? How does he come up with new stuff every day, sometimes twice a day? Why is he so filled with bile? To all these questions there’s a simple answer: I use Unix. Like today, for example. A poor, innocent user asked me why she suddenly stopped getting e-mail in the last 48 hours. Unlike most users, with accounts on the main Media Lab machine, she gets and reads her mail on my workstation. Sure enough, when I sent her a message, it disappeared. No barf, no error, just gone. I round up the usual suspects, but after an hour between the man pages for sendmail and other lossage, I just give up. Hours later, solving another unrelated Unix problem, I try “ps -ef” to look at some processes. But mine aren’t owned by “straz,” the owner is this guy named “000000058.” Time to look in /etc/ passwd. Right there, on line 3 of the password file, is this new user, followed by (horrors!) a blank line. I said it. A blank line. Followed by all the other entries, in their proper order, plain to you or me, but not to Unix. Oh no, whoever was fetching my name on behalf of ps can’t read past a blank line, so it decided “straz” simply wasn’t there. You see Unix knows parsing like Dan Quayle knows quantum mechanics. But that means—you guessed it. Mailer looks in /etc/passwd before queuing up the mail. Her name was in /etc/passwd, all right, so there’s no need to bounce incoming mail with “unknown user” barf. But when it actually came down to putting the message someplace on the computer like /usr/mail/, it couldn’t read past the blank line to identify the owner, never mind that it already knew the owner because it accepted the damn mail in the first place. So what did it do? Handle it the Unix way: Throw the message away without telling anyone and hope it wasn’t important! So how did the extra blank line get there in the first place? I’m so glad you asked. This new user, who preceded the blank line, was added by a well-meaning colleague using ed 3 from a terminal with
74 Mail some non-standard environment variable set so he couldn’t use Emacs or vi or any other screen editor so he couldn’t see there was an extra blank line that Unix would rather choke dead on than skip over. That’s why. From: MAILER-DAEMON@berkeley.edu The problem with sendmail is that the sendmail configuration file is a rule-based expert system, but the world of e-mail is not logical, and sendmail configuration editors are not experts. —David Waitzman, BBN Beyond blowing established mail delivery protocols, Unix has invented newer, more up-to-date methods for ensuring that mail doesn’t get to its intended destination, such as mail forwarding. Suppose that you have changed your home residence and want your mail forwarded automatically by the post office. The rational method is the method used now: you send a message to your local postmaster, who main- tains a centralized database. When the postmaster receives mail for you, he slaps the new address on it and sends it on its way to its new home. There’s another, less robust method for rerouting mail: put a message near your mailbox indicating your new address. When your mailman sees the message, he doesn’t put your mail in your mailbox. Instead, he slaps the new address on it and takes it back to the post office. Every time. The flaws in this approach are obvious. For one, there’s lots of extra over- head. But, more importantly, your mailman may not always see the mes- sage—maybe it’s raining, maybe someone’s trash cans are in front of it, maybe he’s in a rush. When this happens, he misdelivers your mail into your old mailbox, and you never see it again unless you drive back to check or a neighbor checks for you. Now, we’re not inventing this stupider method: Unix did. They call that note near your mailbox a .forward file. And it frequently happens, espe- cially in these distributed days in which we live, that the mailer misses the forwarding note and dumps your mail where you don’t want it. 3“Ed is the standard Unix editor.” —Unix documentation (circa 1994).