[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Content-Length header (Was: Some myths regarding apt pinning)



Isaac To wrote:
> >>>>> "Bob" == Bob Proulx <bob@proulx.com> writes:
> 
>     Bob> And added by any delivery agent delivering mail to an old style
>     Bob> mail file.  It is not just procmail.  It is required.
> 
> I know.  But then, there is no "standard" anyway, so that can't be said to
> be "required".  For me as long as my tools happily read them it's okay.

Perhaps no standard.  But if you don't escape them somehow then the
message is broken up into two messages at the non-escaped From line.
The second message won't have proper headers as it is just the body of
the first message.  Ouch.

>     Bob> IIRC in the www.mutt.org docs there are references to that.  Also
>     Bob> more references as to why you should not do that.
> 
> Thanks, although I can't find it.

I was thinking of this below.  But I was wrong as it is lines and not
content length.  Anyway, to keep the curious at bay, here is the faq
snippet.  See the full faq for the recipe.

  http://www.fefe.de/muttfaq/faq.html

  With Maildir, all the messages have a length of 0!

  That is because the headers don't contain a "Lines:" header. You can
  use this procmail recipe to fix it (courtesy of Liviu Daia and Alex
  Shnitman, who continue to shorten this recipe):

> make sense to me.  It just feels stupid that at the end each mail is stored
> in a single file, but still the "From " headers are escaped because it
> "transits" in a V7 format mail box.  And the damage is permanent: you never

Is it possible for you to prevent the transit through a V7 mailbox?
You would seem a prime candidate to use a Maildir format box for the
intermediate storage.  Then your problems are solved.

> know whether a ">From " line is due to a "From " line or due to a real
> ">From " line.  (Why they didn't use a less brain-dead escape format?!  If
> you just turn all leading "F" to "FF" it will be perfectly reversible...)

Agreed.

>     Bob> Your better option would be to convert to Maildir format mailbox.
>     Bob> Those do not need to escape From markers.  Here is a useful
>     Bob> reference for this.
> 
>     Bob> http://www.nb.net/~lbudney/linux/software/safecat.html
> 
> The only real problem is that the mail will actually be stored *first* in a
> V7 mailbox by procmail or sendmail or exim or whatever, when the damage is
> done.  Later when you try to split it into many files, you can't undo the
> damage.

Negative.  Why do you insist that mail will be stored first in a
berkeley mbox file and then split?  Don't do that.

Here is a typical case.  I use procmail to file my mail.  At the
bottom of my ~/.procmailrc file I have the following stanza.

  :0
  $HOME/Maildir/

Procmail natively understands how to write to Maildir format folders.
Mail will never be stored in a berkeley mbox file.  It will always be
stored in individual files.  No From escaping will ever happen.  The
messages will be delivered cleanly.

The problem comes when one is using a mail client which is not Maildir
aware.  I know nothing of gnus nnml format.  Does it know how to pull
messages out of this type of folder format?  I know there is a recipe
for emacs-vm but I could not find it when I just looked briefly for
it.

Bob

Attachment: pgp8XVQroyqke.pgp
Description: PGP signature


Reply to: