procmail
[Top] [All Lists]

Re: Forwarding messages based on BODY

2001-08-18 12:09:09
* Jim Scott <jscott(_at_)infoconex(_dot_)com> [010818 01:41]:
I am new to Linux and just discovering procmail. I have been told that I
might be able to achieve what I need done with procmail.

Wondering if someone might be able to point me in the right direction and
perhaps supply me with some examples of how to achive this.

We have a device that sends out fairly generic emails to one email box. We
want to based on the message in the body then forward that message on to
certain individuals.

For example the body would contain simple messages like.

Utility Power down
Generator Offline
UPS Failed
PLC Test failed

So lets say a message comes into an email box with Utility power down. I
would want to forward that message to 2 people.

If I receive PLC test failed I would perhaps want to send to those 2 plus
another.

Since the message in the body is fairly simple I might even want to change
the message being sent to something more detailed.

Is this possible with procmail? Can anyone help me get started.

Here's an idea, untested of course:

:0
* ^TO_special(_at_)email\(_dot_)address
{
    :0Bc
    * Utility Power down
    ! address1 address2

    :0Bc
    * Generator Offline
    ! address1 address2

    :0Bc
    * UPS Failed
    ! address1 address2

    :0Bc
    * PLC Test failed
    ! address1 address2

    :0
    /dev/null
}

-- 
- Matt Dunford <> zoot(_at_)zotikos(_dot_)com ..
-. www.zotikos.com -- o,;-
        
Johnson's First Law:
        When any mechanical contrivance fails, it will do so at the
        most inconvenient possible time.
--
_______________________________________________
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>