procmail
[Top] [All Lists]

Re: Listserv recipe for bounced messages?

2003-04-09 17:14:20
On Wed, Apr 09, 2003 at 11:13:36AM -0400, Louis Proyect wrote:

Dallman Ross wrote:
Let us see a sample of actual headers.

Okay, in the case below, it bounced because it contained
the words "may be forged", something we filter out through
majordomo. I'd like to automatically respond to "From: Ben Courtice
<benj(_at_)connexus(_dot_)net(_dot_)au>", the sender but not to myself as 
"From
lnp3(_at_)panix(_dot_)com". I guess that a perl script can pick out the right
addressee but I am not sure how to integrate that into a procmail

We don't need to fire up perl.  This is as I hoped.  Btw, I hadn't
noticed before that you are on panix.  Drop by the panix.* local
groups sometime.

Formail, which is part of the procmail package, grabs the
address you want and parses it just fine. Formail is nice and
low-impact.  Read `man formail' for the precedences it follows
with the -rt options.  I ran the following on your headers
and came up with the address you want to have:

        $ formail -rtzx To: < foo
        benj(_at_)connexus(_dot_)net(_dot_)au

Throw in a `k' flag and we can quote the fellow's mail back to
him.  Be sure to add an X-Loop to stop ringing mail!  See `man
procmailex' for an example of that.  We needed formail for that
anyway, so parsing Ben's address requires no extra effort to
speak of.

   :0 fw  # we'll add an X-Loop and bounce these
   * some conditions
   | formail -rtzk \
             -I"X-Loop: admin(_at_)someaddress(_dot_)com" \
             -i"Subject: List Submission Failure" | \
           $SENDMAIL $SENDMAILFLAGS -t
 -------------------------------------------------------

Here's the result on your saved headers and the list tag
that I left at the end for a simulated body:

  To: benj(_at_)connexus(_dot_)net(_dot_)au
  References: <3E94190C(_dot_)8040800(_at_)connexus(_dot_)net(_dot_)au>
  In-Reply-To: <3E94190C(_dot_)8040800(_at_)connexus(_dot_)net(_dot_)au>
  Subject: List Submission Failure
  X-Loop: admin(_at_)someaddress(_dot_)com
  
  >Gecko/20010901
  >X-Accept-Language: en-us
  >MIME-Version: 1.0
  >To: GL discussion <GreenLeft_discussion(_at_)yahoogroups(_dot_)com>,
  >         marxism <marxism(_at_)lists(_dot_)panix(_dot_)com>
  >Subject: Quislings...
  >Content-Type: text/plain; charset=us-ascii; format=flowed
  >Content-Transfer-Encoding: 7bit
  
  
  >_______________________________________________
  >procmail mailing list
  >procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
  >http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

-- 
dman

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail