Re: PS: stricter parsing of "^From somebody(_at_)somewhere DATE" line ...

1999-07-06 14:18:01
However, one can add a Content-Length: header with everyone's favorite
tool, procmail.  :)  Here's a recipe borrowed from David Tamkin about
9 moons ago:

  :0fhw # B won't help; size conditions ignore H and B flags on the :0 line
  * ! ^Content-Length:.*[0-9]
  * 1^1 B ?? >1
  | formail -a "Content-Length:  $="

If procmail is used as your local delivery agent (which I believe is
the norm for various Linux distributions), couldn't it be configured
to add the Content-Length during local delivery?

Yup...  But if you pipe directly from a sendmail alias the delivery
agent isn't called, so people need to be careful.

If any one can confirm the syntax to do such a thing,
I could add it to the FAQ dealing with the split message problem.

The only way that I know of is to add the line

   H?l?Content-Length: 0000000000

to your file.  Whenever procmail is invoked, it will
automatically correct this bad Content-Length: header.  But that's
ugliness and will probably break things even more in situations where
procmail isn't called.

To quote from the sendmail "Bat" book, p. 795:

   The Content-Length: header describes the approximate size of the
   body of a message.  The size is always a decimal expression of the
   number of bytes occupied by the body.

      Content-Length: 5678

   It is used by some MUAs to find a message faster in a large file of 
   many messages.  It is always created or added by MUAs or delivery
   agents and never by MTAs.  It should never be declared in the 
   configuration file.

   For Sun's version of V8 sendmail the behavior of the Content-Length:
   can be traced with the -d80 debugging switch (see S37.5.190).  All 
   other version of sendmail ignore this header.