procmail
[Top] [All Lists]

Re: recipe question

2006-05-21 08:45:05

On Fri, 19 May 2006, Ruud H.G. van Tol wrote:

luke(_at_)chipcity(_dot_)com(_dot_)au schreef:

I get a TICKETID then I call an external Utility that extracts a
QUEUE variable. That all works fine.
Now I want to test on the QUEUE variable. If it's 'foo' then do one
thine, if it's 'bar' do another.

Is that possible in procmail?


 :0
 * ^TO_test
 * ^Subject: .* bld-sparc\.foo\.com #\/[0-9]+
 {
    QUEUE = `/usr/local/rt3/bin/rt show \
             ticket/$MATCH -f Queue \
             | sed -n '/^Queue: */ { s///; p
                                   }'`

        I didn't check it but I think that you can save some cycles
        if you remit sed and use MATCH

   QUEUE = `/usr/local/rt3/bin/rt show icket/$MATCH -f Queue`
   :0
   * QUEUE ?? Queue: *\/[a-z]+
   action-$MATCH

        action-$MATCH  could be a program with the right name.
        for example, if MATCH==foo then the action will be:
        "action-foo".  (It is possible to linke some names to one
        program whitch test it's arg[0])

# ln -s action action-foo
# ln -s action action-bar
# ln -s ...

Bye,
  Udi


    :0
    * QUEUE ?? ^^foo^^
    action1
    :0E
    * QUEUE ?? ^^bar^^
    action2

    :0E
    action3
 }

-- 
Groet, Ruud

____________________________________________________________
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


+++++++++++++++++++++++++++++++++++++++++++
This Mail Was Scanned By Mail-seCure System
at the Tel-Aviv University CC.


____________________________________________________________
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

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