procmail
[Top] [All Lists]

Re: Formail and the -f flag

2001-12-11 08:49:38
Martin told Harry,

M> But you have two instances of 'formail' which don't use the '-f' flag.
M> I'd guess that your problem is there.

Harry's code includes,

P> TRAP="formail -XMessage-Id:"

M> Any message that goes through this formail will get a "From " added.  So
M> you probably want a '-f' there.

That one isn't doing it.  It's just reading the message after delivery and
adding the Message-Id: header to the logfile.  Even if formail were adding
'From ' (I'm quite sure it doesn't with -X or -x), it's outputting only
Message-Id: anyway, so it doesn't matter whether it adds 'From ' as an
intermediate step or not.

P>     :0fW
P>    * ^Xref:( |\t)*..\/.*
P>     | formail -I "X-Save-Xref: ${MATCH}" \
P>     |sed '/^\.$/d'

M> And there's another formail without a '-f' so that would add a "From "
M> to any messages that go through it.

That's the one that's doing it, because it's a filtering recipe.  Harry,
make it -fI (or -f -I if you prefer) instead of just -I.  Some other notes:
procmail's regexp engine doesn't recognize \t as notation for a tab; you'll
need a literal tab there; in fact, [     ] (where the brackets enclose a
space and a tab) is a more efficient way of listing a set of characters than
you have there.  Next, the sed job can probably be done more efficiently by
grep:

  grep -v '^\.$'
or if your fgrep does -x,
  fgrep -vx .  # that period is part of the command line, not end
punctuation.

but considering that you have both formail and grep, maybe one sed can do
the two jobs together:

  sed -e '1,/^$/ba' -e '/^\.$/d' -eb -e:a -e '/^X-Save-Xref:/d' \
   -e "/^$/i\\
X-Save-Xref: $MATCH\\
"






_______________________________________________
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>