procmail
[Top] [All Lists]

Putting some text into the Subject

1997-06-13 08:47:00

Hello again folks!

NeXTmail has a nice option for a 'read receipt' that actually works (ie it  
isn't a delivery receipt but actually a read receipt)

The message that gets returned looks like this:

To: "Timothy J. Luoma" <luomat(_at_)peak(_dot_)org>
Subject: Read Receipt

Your message regarding "The Subject of My Email of Wed Jun 11 1997 00:49:21  
-0400 was read on Wed Jun 11 1997 07:32:22 -0700.


what I would like to do it take everything AFTER the 'regarding ' and before  
the ' was' and put it into the SUBJECT line, so this message would look like  
this:


To: "Timothy J. Luoma" <luomat(_at_)peak(_dot_)org>
Subject: Read Receipt -- The Subject of My Email of Wed Jun 11 1997 00:49:21 
-0400

Your message regarding "The Subject of My Email of Wed Jun 11 1997 00:49:21  
-0400 was read on Wed Jun 11 1997 07:32:22 -0700.


(I realize that Subject line is getting a little long)



I figured out "a" way to do this:

:0
* ^Subject: Read Receipt$
* ^X-Prefiled: mailer
{

        # I never said it was pretty
        SUBJECT=`formail -I "" |\
                sed 's/.*regarding\ //g' | \
                sed 's/was.*//g' |\
                tr -s '\012' ' ' `

        :0fhw
        |formail -i"Subject: RR:$SUBJECT"

        
        :0
        | $APPNMAIL Read-Receipts
}


NOTE: I use the "$" in the matching line because I want a very strict  
matching on the subject..... I was the words 'Read Receipt' and nothing else,  
not 'Read Receipt Question'

NOTE2: $APPNMAIL is the NeXT way to append messages.... it does its own  
locking, which is why the delivery part of this has no ":0:"

I'm sure there are ways to improve this.... How?

Thanks!

TjL

--
TjL <luomat(_at_)peak(_dot_)org>   / http://www.peak.org/~luomat/next/
NeXT bookmarks: http://www.peak.org/~luomat/next/bookmarks.html
sed 's/End\ of\ sig/pithy\ quotation/g'

<Prev in Thread] Current Thread [Next in Thread>