procmail
[Top] [All Lists]

Re: remove text from body and change subject and author

2005-01-13 05:49:50
Hi,

* Ruud schrieb am 12 Jan 2005:

Toen wij Fabian Braennstroem kietelden, kwam er dit uit:

Here is a small example with the first couple lines of the
body:

       From fab  Wed Dec 29 07:39:32 2004

I expect something like

         From fab(_at_)example(_dot_)com Wed Dec 29 07:39:32 2004

so an email-address and a single space after it.



       Delivered-To: GMX delivery to f(_dot_)braennstroem(_at_)gmx(_dot_)de
[...]
       From:|

Strange From:header.

       Subject: OpenFOAM: Installation: OpenFoam for MS windows

  :0
  *$ ^Subject:.*\/[^$WSP].*
  { H_SUBJ = "$MATCH" }

What do you want to do to the Subject-header? And why?



       ------------------------------------------------------------
       OpenFOAM Message Board: OpenFoam: Installation: OpenFoam for
       MS windows
       ------------------------------------------------------------

       By Madhav Gentela (Gentela) on Wednesday, December 29, 2004
       - 07:56 pm:

[...]
I want to look for the line with 'By Madhav Gentela...' and erase the
word 'By ' and some more appending stuff like the day and date.


  :0BD
  * ^^()^*-+^OpenFOAM.*^MS windows^-+^+By \/[A-Za-z ]+[a-z]
  { NEW_FROM = "$MATCH" }

  :0fhw
  | formail -i "From: $NEW_FROM <localpart(_at_)domain(_dot_)tld>"

(untested)


Unfortunately I have no idea how to do it with simple procmail-code
without 'sed'!?

Removing text from the body is a good job for sed:

  :fbw
  | sed 1,/^By .* 200[0-9]$/d

(that removes a bit more than you asked for)

Thanks! I'm using Dallman's solution now.

Greetings!
-- 
Fabian Braennstroem
Duesseldorf/Berlin

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail