procmail
[Top] [All Lists]

Re: Creating a condensed log output

2001-07-25 16:11:25
On 25 Jul, Tim Rice wrote:
| Hi all,
| 
| Not sure if this is possible but I wanted to ask your advice.
| 
| I'm using a crontab file to mail my procmail log to me twice a day. I'm
| using numerous filters including spambouncer. What I want to do is to
| create the log with only filtered items reported. IE: all good mail goes to
| DEFAULT=/var/mail/rice which I dont need to see. 
| 
| Is there any way to create the log with only items NOT sent to
| /var/mail/rice?
| 
| I have LOGFILE=$HOME/log in my procmail.rc file which is working fine for
| all mail. Just looking to condense it some. I do have variables set for
| most redirected mail, maybe they can be used for logging? Any help is much
| appreciated.
| 
| Some of the variables in my config:
| DEFAULT=/var/mail/rice
| ADMINFOLDER=$DEFAULT
| LOGFILE=$HOME/log
| BLOCKFOLDER=/usr/boxes/rice/thaistuff.com/spam
| SPAMFOLDER=/usr/boxes/rice/thaistuff.com/spam

I manage multiple log files and change verbosity according to need. Log
files and verbosity are managed globally, by rcfile, and by recipe.
At any point in time I'll usually have a procmaillog, procmaillog.dbg,
procmaillog.tmp, procmaillog.spam and others all being used at the same
time. I've been known to use procmaillog.tmp.tmp, procmaillog.dbg.tmp,
or even zlog too. :-)  I frequently use a separate log file for
debugging a single rcfile or an individual recipe.

So, for example, if a particular rcfile of your's only delivers to
SPAMFOLDER, at the top you could do something like:

LOGFILEIN=$LOGFILE
LOGFILE=$SPAMFOLDER/spamlog  # if SPAMFOLDER is a directory, or
LOGFILE=$SPAMFOLDER.log      # if it's a file, or
LOGFILE=${SPAMFOLDER}log     # ditto

and at the end something like:

LOGFILE=$LOGFILEIN

That way, if procmail drops off the bottom without a delivery, whatever
log file was in use when you enter that rcfile is restored before
the next rcfile is processed. But if a message is delivered to
$SPAMFOLDER it'll be logged accordingly. If the recipes aren't
segregated that way, then you'd have to do this recipe by recipe. You
can also manage verbosity in the same way if that's necessary. Then you
can just retrieve the the specific loges you're interested in each day.

Of course, you could use the same concept to just turn off logging
altogether for those recipes that you "don't need to see". But I
wouldn't recommend that, personally. If they're working seemingly
correctly you can turn VERBOSE=off and LOGABSTRACT=no and quiet the
logs. But at least you'll still see error messages.

-- 
                   /"\
Don Hammond        \ /     ASCII Ribbon Campaign
Raleigh, NC US      X        Against HTML Mail,
                   / \      and News Too

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