procmail
[Top] [All Lists]

Re: Help a newbie

1996-11-03 16:55:21
David Bromage <dbromage(_at_)metz(_dot_)une(_dot_)edu(_dot_)au> writes:
On Sun, 3 Nov 1996, Philip Guenther wrote:
| (formail -rkA"X-Loop: dbromage(_at_)metz(_dot_)une(_dot_)edu(_dot_)au" ; 
cat $PMDIR/.reject) | \
     $SENDMAIL -oi -t; elm -s"Abuse not appreciated" zrs(_at_)ZRS(_dot_)NET 
</dev/null

Rather than replying to the sender (which quite often is a faked address)
I want to send spam from those domains back to the admin contact for that
site, with .reject attached.

You'll have to describe how to map from the headers of a spam message to
the admin contact.  Do you want your .procmail to run the "whois" program,
picking out the Technical Contact field and mail to that?  Or are you going
to put a hardcoded list of admins for spams that you generally receive?
I suspect the latter from the recipes you included previously, in which
case I'd suggest not bothering, as the first spam from any given site
will get through.  If you reply by hand to that one (sending to the admin)
then add a match for that spammer to your .procmailrc that'll drop future
spams in /dev/null, then you'll have gone to the same amount of work.
Sending a message to the admin for each spam that you receive is not going
to make the admin your friend, or stop the spammer any faster than one
politely worded message the first time would.


I've also misunderstood the way of implementing EXITCODE. Rather than
sending back the horrible mess EXITCODE=77 is supposed to generate, it just
saves in a folder called EXITCODE=77. As I said, I'm not a programmer. :)

As soon as created a .procmailrc you became a programmer, if not
before.  You can deny it all you want, but it doesn't change the fact that
you're using a language to control a program, and that means you're a
programmer.  Are you denying it just as a way to saying, "I don't want
to learn?", or is there some stigma attached to being a programmer that
you want to avoid?

As for EXITCODE=77, the syntax for procmail actions does't allow simple
assignments (to do so would be ambigious).  You have to wrap the assignment
in braces to make it a nested block.  However, that probably not enough
for what you want, as assigning to EXITCODE does not cause procmail to
stop processing the .procmailrc.  The most efficient way of doing what you
want is:

:0
* random conditions here
* another one
{
    EXITCODE = 77
    HOST=
}

Now you only need to read the procmailrc(5) manpage to see why that work.

Philip Guenther

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