procmail
[Top] [All Lists]

Re: Editing incoming data - a technique check

2001-12-25 12:59:55
"David W. Tamkin" <dattier(_at_)ripco(_dot_)com> writes:

| My spec was that the recipe add a `From ' header to each message as
| well.  If a message comes thru without as Xref header if will bypass
| this filter and therefor receive no `From ' header... correct?

Harry, I'm not clear on something.  If there is an Xref: header, should it
remain as Xref: in addition to being duplicated as X-Save-Xref:, or should
the Xref: be taken out and the information kept only as X-Save-Xref:?  If
the latter, just rename the header:

I was thinking that header was used later in the process.  When my
mail client slurps from mbox style files procmail has created.  But on
pondering a little, it probably just removes it and writes its own.
The final resulting mail message has an Xref: header that is produced
by my mail client (gnus) and reflects its own numbering and group
system.

I haven't actually experiemented by removing the Xref to see if
something bad would happen but on thinking about it more with your
prodding, I suspect I could just rewrite it as you say.  I'll run a
few thru having rewritten the Xref and see what happens.  Probably just
get written by gnus anyway.


 :0fhw
 | formail -R Xref: X-Save-Xref:

Since it has no conditions, it will run on all messages and add the
requisite From_ postmark.   If there is no Xref: on the message, nothing
will be renamed.

That is probably what I need.

If the former:

 :0fhw
 * ^\/Xref:.*
 | formail -IXref: -A "X-Save$MATCH"
 :0Efhw
 * ! ^^From ()
 | formail

Finally I see how the E operator might be used.  I've read that
section a few times and never really got it.

Also a good example of formail -A ... thanks.

I don't follow the special notation `! ^^From ()'

Is it just looking for messages without the mbox `From ' line.  That
is, the ones not passing thru the earlier filter.

Oh, and if you are not too busy on this Christmas day, can you tell me
the fine points of what will go wrong with the formulation I posted?

 :0 
{
  :0 wf
 * ^Xref:..\/.*

  :0 wf 
  | formail -I "X-Save-Xref: ${MATCH}" \

   :0 :
   1.$DELIVERY.in
}
_______________________________________________
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>