procmail
[Top] [All Lists]

Re: How to alter Subject

1998-11-06 07:33:12
On Fri, 6 Nov 1998 14:37:05 +0100,
"Inge Balswick" <IBA(_at_)statoil(_dot_)com> wrote:
:0c
* ^TOiba(_at_)cirrus-rcfk(_dot_)no
! iba(_at_)statoil(_dot_)com
{

You can't group recipes like this, you have to say

    :0
    * ^TO_iba(_at_)cirrus-rcfk\(_dot_)no\>
    {
        :0c
        ! iba(_at_)statoil(_dot_)com

        # ... stuff you had in the braces
    }

Note how I use ^TO_ instead of ^TO (you need a newish version for this
to work, check if you have ^TO_ in the manual page) and escape the dot
with a backslash. The \> is to prevent partial matches (e.g. ".not"
matches "\.no").

I would also want to ADD something like [Cirrus] in front of the Subject
line (if it does'nt exist) , for me to know this mail was forwarded to me
from @cirrus-rcfk.no

You typically grab the subject into MATCH and replace like this:

    :0fhw
    * ! ^Subject:[      ]*\[Cirrus\]
    * ^Subject:[        ]*\/[^  ].*
    | formail -I"Subject: [Cirrus] $MATCH"

You can merge together this with the other formail stuff you had.

Please reply to: webmaster(_at_)cirrus-rcfk(_dot_)no /AND/OR procmail-list

Please use Reply-To: if you want replies somewhere in particular.

/* era */

-- 
Bot Bait: It shouldn't even matter whether  (`')  Just  (`')  http://www.iki
I am a resident of the State of Washington   \/ Married! \/   .fi/~era/

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