procmail
[Top] [All Lists]

How to immediately exit procmail with non-delivery error code?

2000-11-21 20:35:39
Several years ago, when I was on a different ISP, I
started getting
bombarded with spam, and eventually tried procmail,
having found a nice
getting started tutorial. It told how to set up
templates to match
header fields, and how to either divert to a named
file or auto-forward to
abuse(_at_)host or somesuch, all of which was sorta useful
except in
the course of using procmail I had to spend about an
hour to track down
the IP address block and administrative contact for
each new source
of spam, which consumed thousands of hours of my time.

That tutorial also mentionned ways of terminating
procmail
with an error code or somesuch (don't remember the
specific
term) whereby the e-mail would be temporarily or
permanently
refused, causing it to sit 3-5 days before bouncing
back, or
bounce back immediately. Unfortunately procmail on
that ISP
was run only after the e-mail had already been
received, so
if I bounced it, it'd sit 3-5 days in the queue on my
own
ISP before landing in my own sysadmin's box, who would
get
mad at me. (This is because the return address on spam
is
almost always a bogus address on some host that
doesn't even
accept SMTP connections.)

I'm now on an ISP where procmail is the mailer, so I
can now
reject spam and it'd sit 3-5 days on the spammer's ISP
instead of coming into my own ISP at all.
Unfortunately I've
misplaced the URL for that nice tutorial from years
ago. I
spent about ten hours looking at some new tutorials
and at
man pages and can't find any reference to those exit
codes
for rejecting e-mail. I find no mention of error codes
or
return codes or exit codes or exit values or return
values
in either man procmail or man procmailrc.

Can somebody tell me where to find documentation on
those
codes, both the symbolic name and/or numeric value,
and the
syntax for making them get used from inside a procmail
recipe?

Also, how do I make procmail stop reading any more of
.procmailrc when the mail is being NOT delivered (it's
being
rejected). I know the difference between a delivery
recipe
(which delivers the mail and stops reading
.procmailrc) and
a nondelivery recipe (which doesn't deliver mail and
continues reading the rest of .procmailrc). I want a
combination that does NOT deliver mail but DOES
immediately
exit procmail with an error code indicating failure to
deliver, and perhaps also a text message saying
something
like "presumed spam rejected, if not spam please
re-send to
my Yahoo address instead".

I haven't been able to find documentation for either
the
specific error/exit codes nor the syntax for making
procmail
immediately exit with non-delivery, so if you can tell
me
which man procmailwhatever has it, or what URL of
Web-tutorial has it, that will get me started.

Note: On this ISP, I receive legitimate e-mail from
only two sources:
My girlfriend, and my ISP's customer support etc.
Rather than bother setting up a different recipe for
each
different source of spam, I want to reject ALL
incoming e-mail
that isn't from these two good sources, preferably
using the
temporary-failure mode so that it'll keep re-trying
for 3-5
days so I have time to notice some mistake and change
my recipes
to accept the e-mail after all, and so the sysadmin on
the spam site
might see it retrying and be able to trace it back to
its source,
the spammer on that system. (All other legitimate
e-mail can
go to my Yahoo address instead of my ISP.)

One additional question: When e-mail arrives, it spews
the From
and Subject lines and the first five lines of body
across my
screen, which I rather like when getting something
from my girlfriend,
but don't want to be bothered with if it's spam I'm
rejecting anyway.
How, from .procmailrc, can I control which messages
will generate
that spew on my screen and which not? I definitely
want that alert
of incoming e-mail if it's from my girlfriend, and if
it's spam then
I'd rather not get it but if I get it that's only a
small pain.
If setting up a .procmailrc will cause that alert to
stop happening
for legitimate e-mail from my girlfriend, then I'm not
willing to set up
a .procmailrc at all.

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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