procmail
[Top] [All Lists]

Re: Modifying subject

2000-11-05 15:40:24
On Sun, 5 Nov 2000, S.Toms wrote:

st> On Sun, 5 Nov 2000, Mark Shaw wrote:
st> 
st> ms> Hello,
st> ms> 
st> ms> I think I've seen this on the list recently, but unfortunately
st> ms> didn't save the traffic....
st> ms> 
st> ms> I want to strip off and discard a leading string from the subject
st> ms> line of certain incoming email messages.  Specifically, something
st> ms> like
st> ms> 
st> ms>     Subject: [Zonelink] Miraflores locks camera
st> ms> 
st> ms> should be delivered as
st> ms> 
st> ms>     Subject: Miraflores locks camera
st> ms> 
st> ms> Here's what I've come up with:
st> ms> 
st> ms>     :0 Hf
st> ms>     * ^Subject: \[Zonelink\](.*)
st> ms>     | formail -b -f -I "Subject: $1"
st> ms> 
st> 
st>   What your actually looking for is the \/ (forward and backslash) switch,
st> which will save everything following it to the parameter $MATCH, try 
st> something like the following
st> 
st>          :0f
st>          * ^Subject:.*\[Zonelink\][     ]*\/[^  ].*
st>          | formail -bfi "Subject: $MATCH"
st> 

  I should mention that within the [ ] that looks like spaces is actually 
a space and a tab.

st> 
st> ms> What I get is blank subject lines, so obviously I can't pass the
st> ms> second part of the match forward as a variable the way I think I can. 
st> ms> 
st> ms> Any help?  Thanks!
st> ms> 
st> ms> 
st> 
st> 

-- 
        S.Toms - tomas(_at_)primenet(_dot_)com - www.primenet.com/~tomas
                   SuSE Linux v7.0+ - Kernel 2.2.17

Art is either plagiarism or revolution.
                -- Paul Gauguin

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