procmail
[Top] [All Lists]

Re: This has got to be a FAQ pretty soon...

1997-12-09 08:35:41
In message <199712090750(_dot_)JAA01830(_at_)vesuri(_dot_)Helsinki(_dot_)FI>, 
era eriksson writes:
How's this:

   :0
   * ! ^From:[^(_at_)]+$
   * ! ^From:(_dot_)*(_at_)plethora\(_dot_)net\>
   * ! ^FROM_DAEMON
   *   ^To: \/.*
   * $ ^From: $\MATCH
   { ... deal with it ... }

<ponder>
Okay, so that's "if the message comes from a user with no @ sign, or from
here, or from a demon, don't do anything, otherwise, compare from and to.

I also check for To: equal to Reply-To: (change ^From to
^(From|Reply-To)). Checking that it's not ^FROM_DAEMON should exclude
well-behaved mailing lists as well as various bounces and
informational messages.

Okay.  Cool enough...

Also, let's say I want to bounce everything as user unknown, but I don't
want to get returned bounces when the from address was illegitimate.  Is
there an obvious way to do this?  The naive "just bounce as user unknown"
gets bounces to postmaster on our attempts to bounce spam...

Would adding a Precedence: junk header to your bounce message fix that?

Well, I wasn't using a bounce message; I threw procmail in as a local
delivery agent, so
        {
                EXITCODE=67
                :0
                /dev/null
        }
creates a 'user unknown' that I cannot, by inspection, distinguish from a
real user unknown.

Unfortunately, there is one difference - a "real" user unknown gets bounced
before we accept it, so we don't see it again.  One of these, we actually
send a bounce message, so we get a bounce back on it if it doesn't go
anywhere.

-s