procmail
[Top] [All Lists]

Re: get rid of 'From '-"Header"

2001-06-30 11:18:52
On 06/29/01 08:05 PM, Philip Guenther sat at the `puter and typed:
"David W. Tamkin" <dattier(_at_)ripco(_dot_)com> writes:
...
. . .

Your description of raw mode is not quite accurate.  The 'r' flag tells
procmail to _not_ do four things:

1) put a '>' before any line in the body that starts with "From "
2) add a single newline to the end if it doesn't end in two newlines
3) force an access time earlier than the modification time
4) if configured with custom message delimiters (ala MMDF) 
   write those out before and after the message itself

By default, procmail does all of those when writing to an mbox-style
folder.  When writing to other folder styles or to a pipe, procmail
automatically disables some of those.  In particular, when writing to a...

pipe,                 only do (2)
MH folder,            only do (2)
directory folder,     only do (2)
maildir,              do none of them

So yes, the 'r' flag has no effect when writing to a maildir.

Very interesting.  I think I understand this a little more, but as
usual, 2 or 3 answers will result in 6 or 8 more question . . .

I have the following in my sendmail.cf:
Mcyrus,  P=/usr/bin/procmail, F=lsDFMnPqA5@/:|, S=10, R=20/40,
         T=X-Unix, U=cyrus:mail, A=procmail -m /etc/procmailrc $u $h

Which is where I am invoking procmail from.  Looks to me like I am
only calling with the -m flag.  Which just means 'general purpose mail
filter'.

I also notice that procmail adds the trailing newline, but what else
does it do (besides running it through the recipes)? 

I am using procmail to filter things out and add 'Lines: ' header,
etc.  I am then calling the Cyrus deliver agent to dump it into a
Cyrus imap folder.  The problem I had was that *formail* was adding
the leading "> From" header, which Cyrus didn't like.  Using the -f
flag on formail basically tells it to not change the mailbox format of
the message.  Sendmail must do that.
 
As for the leading "From " line, procmail will _automatically_ leave it
off line when writing to a maildir folder, but there's currently no other
way to tell procmail to not write out that line.  Arguably, procmail
shouldn't be writing out such a line to MH folders either and it would
be nice to have a flag (R?  F?) that would disable it for other cases.
For now you have to use the
      formail -b -I"From "
bit.  (The -b flag tells formail to not escape embeded "From " lines.)

Yah, so formail is supposed to format the message, add/remove headers,
etc.  Not procmail.  Procmail is just the filter, right?  No
formatting unless you call formail.

Note that whether the message starts with a leading "From " line is yet
another point to consider.  The message being processed by procmail will
initially have such a line if
a) the message fed to procmail had one, OR
b) procmail was invoked with the -f flag, OR
c) procmail is in delivery mode (invoked with the -d flag, the -z flag,
   or via a name that doesn't start with procmail)

So what would change if I wanted sendmail to call procmail with the -r
flag?

The details above are for version 3.20.  Previous versions did (2) for
maildir folders, and there may be other differences that I can't remember.

I am using 3.15, maybe I should upgrade?

Thanks

Lou
-- 
Louis LeBlanc
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
leblanc(_at_)acadia(_dot_)ne(_dot_)mediaone(_dot_)net
http://acadia.ne.mediaone.net                Ô¿Ô¬
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>