procmail
[Top] [All Lists]

Re: matching subjects with words in []

1997-01-25 20:57:37
In the light of recent discussion here...

I thought I'd pass along something I use for testing purposes.  The
following recipe lets me turn verbose debugging on/off easily, and
doesn't fill my standard log file with the verbose output:

TEST=/bin/test
VERBOSEFILE=$HOME/.pm.verbose
VERBOSELOG=$HOME/logs/verbose.$$
DEFAULTADDRESS="you(_at_)some(_dot_)host(_dot_)org"

# VERBOSE
# If $VERBOSEFILE exists, this will turn on verbose logging to
# $VERBOSELOG, and will then mail the resulting file to $DEFAULTADDRESS
# after procmail exits.  $VERBOSELOG is deleted.
:0
* ? $TEST -f $VERBOSEFILE
{
        LOGFILE=$VERBOSELOG
        VERBOSE=yes
        TRAP="$MAIL -s 'Procmail Log' $DEFAULTADDRESS < $VERBOSELOG; \
             $RM $VERBOSELOG"
}

If you take out the TRAP line, then you have a new log file generated
for each message; this may be preferable depending on your environment.

-- Lars

---
Lars Kellogg-Stedman * lars(_at_)bu(_dot_)edu * (617)353-8277
Office of Information Technology, Boston University