procmail
[Top] [All Lists]

Re: /dev/null Recipe with reply

1998-01-27 07:40:00
On 27 Jan 1998 14:15:42 +0200, <jari(_dot_)aalto(_at_)poboxes(_dot_)com> wrote:
BAN_REGEXP = "(parceiro\.com)"

:0 c
*$ \/$BAN_REGEXP

Half of this recipe seems to be missing -- Jari must have been typing
too fast :-)

    :0c
    * $ ()\/$BAN_REGEXP
    {
        reject=$MATCH

This is still not handling the case where BAN_REGEXP matches the
Subject: header, but perhaps this wasn't the intention in the first
place? 

    #   Add text to the beginning of message
    :0 fh
    * Subject:\/.* 
    | formail -rt -I "Subject: [message rejected] $MATCH" ; \
      echo "You domain [$rejected] is in the blacklist"; echo

    #   "return to sender"
    :0
    | formail -rkb | $SENDMAIL -oi -t
}

This is curious. First you are generating a reply header (:0fh formail -rt)
and then you reply to this new header -- effectively to yourself!
(Actually not, because formail won't even include a valid reply header
in the headers it generates -- you get "To: foo(_at_)bar" instead ;-)

Try this instead:

        :0
        * ^Subject:[    ]*\/[^   ].*
        | ( formail -rtkb -I"Subject: Message rejected (was: $MATCH)" ; \
            echo "Your domain [$rejected] is in the blacklist" ; echo ) \
          | $SENDMAIL $SENDMAILFLAGS -t
    }

The whitespace in the [] brackets is a space and a tab, in any order.

Hope this helps,

/* era */

-- 
 Paparazzi of the Net: No matter what you do to protect your privacy,
  they'll hunt you down and spam you. <http://www.iki.fi/~era/spam/>

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