procmail
[Top] [All Lists]

Re: running commands from procmail

1998-08-17 01:19:24
On Sun, 16 Aug 1998 19:00:24 +0300 (EET DST), era eriksson
<era(_at_)iki(_dot_)fi> wrote:
Here's a bare-bones ping responder:

And then I forgot to add an X-Loop to the outgoing ping response.
Gack. (It's really not that bad because the ping responder as I coded
it should not respond to its own messages, but still we should either
generate X-Loops or not check for them.) Here's a fixed version:

    :0  # DON'T USE THIS VERBATIM. See improved regex below.
    *   ^Subject:[      ]*ping[  ]*\/[-a-z0-9_]+(\.[-a-z0-9_]+)*
    * ! ^X-Loop: ping(_at_)dect\(_dot_)com
    | ( formail -rt -I "X-Loop: ping(_at_)dect(_dot_)com" ; ping "$MATCH" ) \
      | $SENDMAIL $SENDMAILFLAGS -t

One thing I should point out is that a lot of autoresponder examples
out there look for something like "Subject:.*\<ping[    ]*\/...", i.e.
will allow any arbitrary string before the actual autoresponder
trigger keyword. This is IMHO misdirected; if somebody wants a ping
response, they are going to have to write Subject: ping and not 
Subject: Re: ping or whatever, dammit. (And the autoresponder
shouldn't gratuitously use a different Subject: on the autoresponse
unless you are sure it's evident from the response what it's a
response to.)

/* 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>