procmail
[Top] [All Lists]

Re: procmail and **Bounced**

1997-04-01 17:30:00
process(_at_)qz(_dot_)little-neck(_dot_)ny(_dot_)us (Eli the Bearded) writes:
Recently I tried a scoring recipe using a slight variation
on the script in the manpage to process an existing mailbox.
I changed the source mailbox used and the command executed
by formail from "procmail" to "procmail -m new-rc".

The recipe I used was:
 :0B
 * $ `$MAILDIR/jmdigest -`^0
 $MAILDIR/score=$=

Where jmdigest is a perl script which scores stuff and then
prints the integer score on stdout. If you want to examine
the script, I keep it in my FTP space:
      <URL:ftp://ftp.netusa.net/users/eli/jmdigest>
(jmdigest returns zero unless it is given no files to process.)

Why did that recipe give me log entries like this for all the zero
scoring stuff? I can find nothing about this in the manpages.

When you use the '-m' flag to procmail, it assumes that all messages
will be explicitly handled: it's a filter, not a delivery agent.  To
this end it unsets the DEFAULT and ORGMAIL variables.  This causes it
to bounce messages that aren't 'delivered' before the end of the rc
file.

The solution depends on what you what it to do.  If you just want to
run procmail with a different rc file, then just put the filename on
the command line and run, ala:

        formail -s procmail new-rc

Otherwise you can explicitly set DEFAULT at the top of the rc file.


However, I wonder if the following recipes better show you goal:

        # Find the score by feeding the body into "jmdigest", capturing
        # stdout in the SCORE variable.
        # (if the entire message should be fed, remove the 'b' flag.)
        :0bc
        SCORE=|$MAILDIR/jmdigest -

        # save the message into the appropriate file
        :0:
        score=$SCORE


Philip Guenther

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