procmail
[Top] [All Lists]

Re: Procmail question

1996-09-22 23:42:25
Joel Rosenberg <ellegon(_at_)ibm(_dot_)net> writes:

Here's whatsonames spammers rule.

SPAMMERS=$HOME/Mail/.spammers
SENDER=`formail -rtzxTo:`
:0              # If this is a spammer, auto-respond
* ? fgrep "$SENDER" $SPAMMERS
{               # this is a spammer, make a reply
 
    :0fh            # form a reply header
    | formail -rt   -I"From: $LOGNAME(_at_)$HOST" \
            -I"Reply-To: nobody" \
            -I"Precedence: junk" \
            -I"Subject: Your recent spamming to me"
 
    # Notice that I set "From:" correctly, but override it with
    # "Reply-To: nobody" so that any replies will go nowhere.
    # On many (most?) Unix systems, "nobody" is an alias to "/dev/null".
 
    :0fb            # form the body
    | echo "You recent unsolicited e-mail to me is not appreciated." ; \
      echo "All future e-mail from you will be ignored by me (not even" ; \
      echo "seen, actually), but will generate this response." ; \
      echo "It is, therefore, in your own best interest to not even " ; \
      echo "bother sending me any more e-mail." ; \
      echo "Thank you. -- $LOGNAME's Mail-Agent." ; \
      echo "" ; \
      echo "---- Original Message ----" ; \
      cat -
 
    :0          # feed the reply to the mailer
    ! -oi -t
 
    DELIVERED=yes       # pretend we delivered the mail
    HOST=_done_     # stop processing now
}

Here's my PGP script

:0
* ^Subject: .*request pgp key
{
    FROM="`formail -rzx To:`"
 
    :0: # file repeated requests in a hall of shame
    * ? fgrep "$FROM" $PGPOWNERS >/dev/null
    /dev/null
   
    :0h
    | (formail -rt -A"Precedence: junk" -I"Subject: Requested PGP key"; \
    cat $PGPKEY ) | $SENDMAIL -t ; echo "$FROM" >> $PGPOWNERS
}





Is there any reasonable way to write a procmail script so that it looks in a 
file, call it, losers.txt, say, for the ^From: line in the header, and then 

sends matching messages to /dev/null?






---------------------------------------------------------------

http://www.winternet.com/~joelr

http://www.amazon.com/exec/obidos/ISBN%3D0380973227/joelrosenbergA/

...and for the last bit of geekitry, to receive the latest version of my
FAQ, 

send me a message with the phrase "your FAQ" anywhere in the subject
line.




-- 
It's Saturday not Sadurday ok!

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