procmail
[Top] [All Lists]

Re: Saving, using, then deleting a message....

1997-04-16 18:49:00
Hrrrm... what I've been doing is:

:0 c
* ^From:.*\<dm1\.com\>
* !^X-Loop: spamtrap
| ( cat /usr/local/etc/spamcomplaint - | formail -r -A"X-Loop: spamtrap" \
    -A"Subject: Unsolicited Commercial Email From Your Site" ) | \
    $SENDMAIL -oi info(_at_)dm1(_dot_)com postmaster(_at_)dm1(_dot_)com 
namsstaff(_at_)dm1(_dot_)com \
                  noc(_at_)cwix(_dot_)net lawrence(_at_)CWIX(_dot_)NET 
postmaster(_at_)cwix(_dot_)net \
                  abuse(_at_)cwix(_dot_)net root(_at_)clever(_dot_)net 
support(_at_)dm1(_dot_)com epref(_at_)dm1(_dot_)com \
                  cyberink(_at_)dm1(_dot_)com mompop(_at_)dm1(_dot_)com 
tsupport(_at_)dm1(_dot_)com \
                  wdog(_at_)dm1(_dot_)com youness(_at_)dm1(_dot_)com 
staff(_at_)dm1(_dot_)com \
                  edc(_at_)dm1(_dot_)com esx(_at_)dm1(_dot_)com 
stew(_at_)dm1(_dot_)com hassane(_at_)dm1(_dot_)com \
                  dmgroup(_at_)dm1(_dot_)com comments(_at_)dm1(_dot_)com 
webmaster(_at_)dm1(_dot_)com \
                  customerservice(_at_)dm1(_dot_)com sweeps(_at_)dm1(_dot_)com 
finaid(_at_)dm1(_dot_)com


Pipe it into ( cat my response and then the original headers ) let formail
handle the header rewrites, and then off to sendmail.

Seems to work great: everyone on my spamtrap list stopped getting email
from dm1.com :)

No reason to save it to a file at all, since the 'cat' has the original
on standard input (aka '-' in this case).

On Tue, 15 Apr 1997, Catherine Hampton wrote:

I'd like to save a message to a temporary file with all headers intact,
reply to the message with a standard autoreply, append the text
file, send the reply, and then delete the temporary file.  Right now,
I am using an autoreply recipe like this:

# Autoreply to known spam
:0
* ^(From.|Reply-To:|Message-ID:|Received:).*[^0-9A-Za-z](spamsite\.net|\
        anotherspamsite\.(com|net))
* !^X-Loop: noloop(_at_)noloop(_dot_)nlp
{
:0 c
$SPAMFOLDER

:0
| (formail -bkrt \
    -I"Cc: 
postmaster(_at_)spamsite(_dot_)net,abuse(_at_)upstreamprovider(_dot_)net" \
    -A"X-Loop: noloop(_at_)noloop(_dot_)nlp";\
    cat $HOME/shared/stopjunk) | $SENDMAIL -oi -t
}

This works well, but does not preserve the headers of the original
message, which means that the autoreply is not as useful as it might
be to the upstream provider.  

I also would prefer to have my reply appear above the message --
it's less annoying that way.  And while I don't mind annoying spammers
in the least, I'd rather treat the poor upstream providers with some
consideration. :)

I know there has to be an easy answer to this, but for some reason what
I've tried so far has resulted in either not saving the spam message
at all, or in appending it to an ever-growing file because the program
doesn't properly delete it after the autoreply is sent.

Suggestions?  


Catherine



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