procmail
[Top] [All Lists]

Re: remove text from body and change subject and author

2005-01-12 10:06:19
Hi,


* Dallman schrieb am 12 Jan 2005:

On Wed, Jan 12, 2005 at 04:45:02PM +0100, Ruud H.G. van Tol wrote:

Toen wij Fabian Braennstroem kietelden, kwam er dit uit:


As I understand it, all of the formail/sed-juggling above 
can easily be done with some procmail-code followed by a 
single call of formail (so not a single sed-call is needed 
at all).

Yes, as I also believe and have said.  But Fabian keeps posting
broken code, but doesn't seem ever to get around to posting actual
example headers that he wants to work with.  Which I don't understand,
because obviously he has access to the headers in order to try
to construct his sed statements, etc.

Fabian, would you please just post the header lines verbatim
that you want to work with and repeat what your goal is with them?
People would be glad to help with actual syntax rather than
generalized statements, if you'd only help them help you.

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


       From fab  Wed Dec 29 07:39:32 2004
       Return-Path: <wwwrun(_at_)tfdpc67(_dot_)tfd(_dot_)chalmers(_dot_)se>
       X-Flags: 0000
       Delivered-To: GMX delivery to f(_dot_)braennstroem(_at_)gmx(_dot_)de
       Received: from pop.gmx.de [213.165.64.20]
        by localhost with POP3 (fetchmail-6.2.5)
        for fab(_at_)localhost (single-drop); Wed, 29 Dec 2004 07:39:32 +0100 
(CET)
       Received: (qmail invoked by alias); 29 Dec 2004 18:56:16 -0000
       Received: from tfdpc67.tfd.chalmers.se (EHLO tfdpc67.tfd.chalmers.se) 
(129.16.64.137)
         by mx0.gmx.net (mx042) with SMTP; 29 Dec 2004 19:56:16 +0100
       Received: by tfdpc67.tfd.chalmers.se (Postfix, from userid 30)
        id CDF11698D5; Wed, 29 Dec 2004 19:56:15 +0100 (CET)
       To: f(_dot_)braennstroem(_at_)gmx(_dot_)de
       Reply-To: m(_dot_)janssens(_at_)nabla(_dot_)co(_dot_)uk
       X-Mailer: Discus 3.10.4 <http://tfdpc67.tfd.chalmers.se/foam/discus>
       Message-Id: 
<20041229185615(_dot_)CDF11698D5(_at_)tfdpc67(_dot_)tfd(_dot_)chalmers(_dot_)se>
       Date: Wed, 29 Dec 2004 19:56:15 +0100 (CET)
       X-GMX-Antivirus: -1 (not scanned, may not use virus scanner)
       X-GMX-Antispam: 0 (Mail was not recognized as spam)
       Status: RO
       Content-Length: 911
       Lines: 26
       From:|
       Subject: OpenFOAM: Installation: OpenFoam for MS windows
       
       ------------------------------------------------------------
       OpenFOAM Message Board: OpenFoam: Installation: OpenFoam for
       MS windows
       ------------------------------------------------------------
       
       By Madhav Gentela (Gentela) on Wednesday, December 29, 2004
       - 07:56 pm:
       
        Hi,...
        ...
        ...


With my procmail-recipe without the header 'h':

      :0
      * ^Subject.*(OpenFoam: Installation)
      {
       :0w
       FROM=|formail -I "" | sed -n -e '/By\ /p' |  sed -e  
's/^\(.\{0\}\).\{3\}\(.*\)/\1\2/'|  sed -e  's/^\(.\{10\}\).\{30\}\(.*\)/\1\2/'

       :0 fw
       | formail -i "From:$FROM"

       :0
       CFD/OpenFoam_Installation
      }


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.
Aeh, now it works; at least there are some mixed up names and not the
default From-Header. Copying the recipe I saw that I tested it on the
new Subject, so the recipe never started for these mails.

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

Thanks for your support!
-- 
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