Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Triggering a script via email...continued

by andreychek (Parson)
on Apr 19, 2002 at 20:07 UTC ( #160655=note: print w/ replies, xml ) Need Help??


in reply to Triggering a script via email...continued

You're right, procmail by itself can be a bit of a pain to learn. However, perhaps you could take a bit of procmail, and use it to pipe a given message into a Perl script. Then you'd be at home :-)

At work, we're using something like the following in a particular users .procmailrc file in their home directory:

:0 b * ^From:.*@somedomain.com * ^Subject:.*Re: Your message | /usr/local/bin/NeatoPerlScript.pl
This takes any message originating from the domain "@somedomain.com", containing the subject "Re: Your message". and pipes the body of the email message into the script "NeatoPerlScript.pl". Then, within your Perl script, just check your standard input for the contents of the email.

Now, you did say something about doing it every time a message arrived. In that case, just drop the "From" and "Subject" clauses, and it'll affect every message coming in to that particular user.

Hope that helps!
-Eric


Comment on Re: Triggering a script via email...continued
Download Code
Re: Re: Triggering a script via email...continued
by dws (Chancellor) on Apr 19, 2002 at 23:13 UTC
    While debugging this, I recommend using   :0 ic:
    at the top of the procmail rule. This will ignore errors in the pipe, and continues processing other rules. This lets you both pass the email message through your filter, and still end up with a copy in your mailbox.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://160655]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2014-12-28 18:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls