From 79ebb3ff33dbcf841194bbc0932c070b055b1907 Mon Sep 17 00:00:00 2001 From: Ian C Date: Sun, 22 Aug 2004 19:03:21 +0000 Subject: Added dumpheaders variable --- doc/INSTRUCTION | 7 ++++++- src/config.c | 7 +++++++ src/config.h | 3 ++- src/kbs.c | 16 ++++++++++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/doc/INSTRUCTION b/doc/INSTRUCTION index 1ac9e8e..5ab1ddc 100644 --- a/doc/INSTRUCTION +++ b/doc/INSTRUCTION @@ -115,6 +115,11 @@ And understand the following variables: for early runs to ensure your rules are not too harsh (or too easy for that matter). + dumpheaders + Simply dumps the parsed From and Subject for each + message read from the server into the delete log. + Mainly for debugging purposes. + Include files ============= @@ -270,4 +275,4 @@ done in this order: ------------------------------------------------------------------------------- -$Id: INSTRUCTION,v 1.7 2004-01-26 02:01:49 ianc Exp $ +$Id: INSTRUCTION,v 1.8 2004-08-22 19:03:21 ianc Exp $ diff --git a/src/config.c b/src/config.c index 66ea944..cf1a751 100644 --- a/src/config.c +++ b/src/config.c @@ -71,6 +71,7 @@ typedef enum { TOK_VarBlockHTML, TOK_VarVerbose, TOK_VarShowmatch, + TOK_VarDumpHeaders, TOK_ConstOn, TOK_ConstOff, TOK_ConstBlock, @@ -107,6 +108,7 @@ static int testmode=FALSE; static int blockhtml=FALSE; static int verbose=TRUE; static int show_match=TRUE; +static int dump_headers=FALSE; static int no_macro=0; static Macro *macro=NULL; @@ -147,6 +149,7 @@ static const Command cmd_table[]= {"blockhtml", TOK_VarBlockHTML}, {"verbose", TOK_VarVerbose}, {"showmatch", TOK_VarShowmatch}, + {"dumpheaders", TOK_VarDumpHeaders}, /* Constants */ @@ -236,6 +239,7 @@ static int DoSet(FILE *fp) {TOK_VarBlockHTML, TYPE_ONOFF, (void *)&blockhtml}, {TOK_VarVerbose, TYPE_ONOFF, (void *)&verbose}, {TOK_VarShowmatch, TYPE_ONOFF, (void *)&show_match}, + {TOK_VarDumpHeaders, TYPE_ONOFF, (void *)&dump_headers}, {TOK_EOF,0,NULL} }; @@ -939,6 +943,9 @@ int ConfigInt(ConfigIntVar var) case CONFIG_SHOWMATCH: return show_match; + case CONFIG_DUMPHEADERS: + return dump_headers; + default: return 0; } diff --git a/src/config.h b/src/config.h index d545531..d9641e7 100644 --- a/src/config.h +++ b/src/config.h @@ -55,7 +55,8 @@ typedef enum CONFIG_TESTMODE, CONFIG_BLOCKHTML, CONFIG_VERBOSE, - CONFIG_SHOWMATCH + CONFIG_SHOWMATCH, + CONFIG_DUMPHEADERS } ConfigIntVar; /* ---------------------------------------- INTERFACES diff --git a/src/kbs.c b/src/kbs.c index ef6ab1e..168793c 100644 --- a/src/kbs.c +++ b/src/kbs.c @@ -133,6 +133,22 @@ int main(int argc, char *argv[]) int tot=0; int del=0; + if (ConfigInt(CONFIG_DUMPHEADERS)) + { + Log(fp,"---- MESSAGE DUMP ----\n"); + + for(f=0;msg[f].to;f++) + { + Log(fp,"Message %d\n",f+1); + Log(fp,"From %s <%s@%s>\n",msg[f].from, + msg[f].from_uname, + msg[f].from_domain); + Log(fp,"Subject %.40s\n",msg[f].subject); + } + + Log(fp,"---- END MESSAGE DUMP ----\n"); + } + for(f=0;msg[f].to;f++) { tot++; -- cgit v1.2.3