[EMAIL PROTECTED] wrote:
> Improved mail delivery techniques aside, if one WERE foolish enough to
> use sendmail with mbox-formatted files, isn't reading the Content-Length
> field (as it is set by sendmail at delivery time) the proper technique to
> use to determine the length of each message?
This discussion comes up periodically just far enough apart that it all
falls out of my brain between times. Allow me to recap so I can get it
all paged back in.
It is only a specific file format where you get into trouble. The file
format that causes the problem is the one that uses the string "From "
at the beginning of a line to separate messages. Although I'm pretty
sure this is called the BSD mailbox format, I'm not 100% positive If you
avoid this format you have no problems. I'm not clear on "mbox" versus
"mailbox", the key is the separator line.
If you're stuck using the format of mail box there are two common
techniques that attempt to handle it. One technique is often termed "From
" munging or mangling and consists of sticking a character, usually a ">"
in front of any occurrences of "From " at the beginning of a line. The
other technique is to add a "Content-Length" header which all tools are
supposed to use to "jump over" the body when they're looking for the
next message in the file. A third, less common, technique is to use
quoted-printable encoding on the "From ".
The biggest problem with Content-Length is that it only takes one tool that
alters mail and that doesn't know about it to break your mail box file.
And that might not have been one of your tools, it might be something
on a system between you and the sender. There's a discussion between
Jamie Zawinski of Netscape and others on this subject available at:
http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/content-length.html
The conclusion of that discussion is that the format is bad, "From "
munging is bad but less bad than Content-Length. The exact quote regarding
Content-Length is "... format is non-portable, easily corruptible, and
overall, brain-damaged".
Sendmail isn't really the problem. It's (normally? always?) the local
delivery agent that does either the "From " munging or maybe inserts or
updates a Content-Length header. Sendmail, rather SMTP, very clearly
separates headers from body and one mail from the next so there's no chance
of intertwining on an incoming SMTP connection. If you're set up to use
procmail as the local delivery agent (Red Hat Linux systems come this way)
then it further depends on what procmail uses to store the mail.
If you're using nmh/MH there is no good reason to let your mail be exposed
to the damage that is possible by storing it in a brain dead format.
Here's the simplest possible .procmailrc file. With this and a sendmail
set up to use procmail for local delivery or a .forward file set up to pipe
mail into procmail all your mail will go into your MH/nmh inbox folder and
never be at risk. For a Red Hat Linux system all you've gotta do is create
a .procmailrc file and STOP using inc (as it's unnecessary once procmail
is delivering right into your MH inbox).
--begin---Sample ~/.procmailrc ------cut here---------------
:0 w :inbox/.lock
| /usr/lib/mh/rcvstore +inbox
--end-----Sample ~/.procmailrc ------cut here---------------
-Hal <*>
-Friends don't let friends use BSD mailbox files.