postfix-mailgraph/postfix-mailgraph.patch

Sun, 26 Apr 2009 18:18:24 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sun, 26 Apr 2009 18:18:24 +0200
changeset 199
bf21249327af
parent 171
b72f2be1f619
child 201
3be96a4c8c18
permissions
-rw-r--r--

Renew patch and introduce option '--multi-rule-spam' counting more spam.

     1 Index: mailgraph.cgi
     2 --- mailgraph.pl.orig	2007-08-29 11:06:01.000000000 +0200
     3 +++ mailgraph.pl	2009-04-26 18:06:13.313712038 +0200
     4 @@ -211,6 +211,8 @@
     5              \s
     6              ([-\w\.\@:]+)        # host  -- 6
     7              \s+
     8 +            <[^>]+>              # OSSP fsl log level
     9 +            \s+
    10              (?:\[LOG_[A-Z]+\]\s+)?  # FreeBSD
    11              (.*)                 # text  -- 7
    12              $/x or do
    13 @@ -420,6 +422,7 @@
    14  	print "  --rrd-name=NAME    use NAME.rrd and NAME_virus.rrd for the rrd files\n";
    15  	print "  --rbl-is-spam      count rbl rejects as spam\n";
    16  	print "  --virbl-is-virus   count virbl rejects as viruses\n";
    17 +	print "  --multi-rule-spam  count several typical reject messages as spam\n";
    19  	exit;
    20  }
    21 @@ -432,7 +435,7 @@
    22  		'daemon_pid|daemon-pid=s', 'daemon_rrd|daemon-rrd=s',
    23  		'daemon_log|daemon-log=s', 'ignore-localhost!', 'ignore-host=s@',
    24  		'only-mail-rrd', 'only-virus-rrd', 'rrd_name|rrd-name=s',
    25 -		'rbl-is-spam', 'virbl-is-virus'
    26 +		'rbl-is-spam', 'virbl-is-virus', 'multi-rule-spam'
    27  		) or exit(1);
    28  	usage if $opt{help};
    30 @@ -610,6 +613,18 @@
    31  			elsif($opt{'rbl-is-spam'} and $text    =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: .*: 554.* blocked using/) {
    32  				event($time, 'spam');
    33  			}
    34 +			elsif($opt{'multi-rule-spam'} and $text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: .*: 554.* Client host rejected: Access denied/) {
    35 +				event($time, 'spam');
    36 +			}
    37 +			elsif($opt{'multi-rule-spam'} and $text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: .*: 450.* Helo command rejected: Host not found/) {
    38 +				event($time, 'spam');
    39 +			}
    40 +			elsif($opt{'multi-rule-spam'} and $text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: .*: 450.* Sender address rejected: Domain not found/) {
    41 +				event($time, 'spam');
    42 +			}
    43 +			elsif($opt{'multi-rule-spam'} and $text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: .*: 450.* Client host rejected: cannot find your hostname/) {
    44 +				event($time, 'spam');
    45 +			}
    46  			elsif($text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: /) {
    47  				event($time, 'rejected');
    48  			}
    49 @@ -924,6 +939,7 @@
    50   --rrd-name=NAME    use NAME.rrd and NAME_virus.rrd for the rrd files
    51   --rbl-is-spam      count rbl rejects as spam
    52   --virbl-is-virus   count virbl rejects as viruses
    53 + --multi-rule-spam  count several typical reject messages as spam
    55  =head1 DESCRIPTION

mercurial