procmail
[Top] [All Lists]

Re: Trimming an extra header.

2003-03-28 12:49:00
At 10:33 2003-03-28 -0500, John Ehrlinger did say:
I'll start by saying I'm a procmail newbie... I've searched the lists
and man pages, but haven't found quite what I'm looking for.

I suspect you missed one: 'man formail' It's a tool which is included as part of the procmail distribution.

The problem is Groupwise adds a header as it forwards the message. So
each mail looks like I've read it and forwarded it with the Groupwise
client. I'd like to setup procmail to remove the header that Groupwise
added so the message would act like it was sent directly to my unix
account. I don't need to change the To address, I just want to remove
the first header.

Uh, perhaps you could actually provide an _example_ of what header is added?

:0: fhw

First, the lockfile flag should TRAIL the flags line, and anything following it is taken to be an explicit lockfile name, so, this should become:

:0fhw:

Second, since this level of the recipe has a BRACED ACTION, fw are both invalid flags, and frankly, h is too, making it:

:0:

Third, since this level of the recipe has a BRACED ACTION, the lockfile flag is also inappropriate, making it simply:

:0

*^From:(_dot_)*(_at_)ccf\(_dot_)org\>
{

Assuming that the address the message is coming from is at ccf.org (assuming no intermediate hostname), this is kosher. However, I note that YOUR address has hostnames in there, so perhaps this From: regexp should be:

* ^From:.*@([0-9a-z_.]\.)?ccf\.org\>

which should allow for optional hostnames (and multiple levels if they exist).

  :0Afwh
  |sed -e '/^$/,$!b' -e '/./,$!d'

The 'A' flag is inappropriate. This is the first recipe within a nested level. The immediatley preceeding recipe (the outside of this braced construct) obviously matched if we reached this point.

As for the sed invocation, since you don't provide ANY example of what the headers are, and what you want them to come out as, I can't even begin to diagnose that for you. If you want to remove or rewrite specific headers, formail is the appropriate tool.

  :0
  Groupwise

If you're writing to a file, you should have a lockfile flag on the end of the flags line.

}


You have my sympathies for being saddled with a Groupwise mail server.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


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