1.1 --- a/postfix-mailgraph/postfix-mailgraph.patch Fri Apr 24 17:37:04 2009 +0200 1.2 +++ b/postfix-mailgraph/postfix-mailgraph.patch Sun Apr 26 18:18:24 2009 +0200 1.3 @@ -1,41 +1,6 @@ 1.4 Index: mailgraph.cgi 1.5 ---- mailgraph.cgi.orig 2007-08-29 11:06:01 +0200 1.6 -+++ mailgraph.cgi 2007-08-29 19:05:41 +0200 1.7 -@@ -160,7 +160,7 @@ 1.8 - <html> 1.9 - <head> 1.10 - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 1.11 --<title>Mail statistics for $host</title> 1.12 -+<title>Postfix Mail statistics for $host</title> 1.13 - <meta http-equiv="Refresh" content="300" /> 1.14 - <meta http-equiv="Pragma" content="no-cache" /> 1.15 - <link rel="stylesheet" href="mailgraph.css" type="text/css" /> 1.16 -@@ -168,7 +168,7 @@ 1.17 - <body> 1.18 - HEADER 1.19 - 1.20 -- print "<h1>Mail statistics for $host</h1>\n"; 1.21 -+ print "<h1>Postfix Mail statistics for $host</h1>\n"; 1.22 - 1.23 - print "<ul id=\"jump\">\n"; 1.24 - for my $n (0..$#graphs) { 1.25 -@@ -183,13 +183,6 @@ 1.26 - } 1.27 - 1.28 - print <<FOOTER; 1.29 --<hr/> 1.30 --<table><tr><td> 1.31 --<a href="http://mailgraph.schweikert.ch/">Mailgraph</a> $VERSION 1.32 --by <a href="http://david.schweikert.ch/">David Schweikert</a></td> 1.33 --<td align="right"> 1.34 --<a href="http://oss.oetiker.ch/rrdtool/"><img src="http://oss.oetiker.ch/rrdtool/.pics/rrdtool.gif" alt="" width="120" height="34"/></a> 1.35 --</td></tr></table> 1.36 - </body></html> 1.37 - FOOTER 1.38 - } 1.39 -Index: mailgraph.pl 1.40 ---- mailgraph.pl.orig 2007-08-29 11:06:01 +0200 1.41 -+++ mailgraph.pl 2007-08-29 19:03:59 +0200 1.42 +--- mailgraph.pl.orig 2007-08-29 11:06:01.000000000 +0200 1.43 ++++ mailgraph.pl 2009-04-26 18:06:13.313712038 +0200 1.44 @@ -211,6 +211,8 @@ 1.45 \s 1.46 ([-\w\.\@:]+) # host -- 6 1.47 @@ -45,3 +10,47 @@ 1.48 (?:\[LOG_[A-Z]+\]\s+)? # FreeBSD 1.49 (.*) # text -- 7 1.50 $/x or do 1.51 +@@ -420,6 +422,7 @@ 1.52 + print " --rrd-name=NAME use NAME.rrd and NAME_virus.rrd for the rrd files\n"; 1.53 + print " --rbl-is-spam count rbl rejects as spam\n"; 1.54 + print " --virbl-is-virus count virbl rejects as viruses\n"; 1.55 ++ print " --multi-rule-spam count several typical reject messages as spam\n"; 1.56 + 1.57 + exit; 1.58 + } 1.59 +@@ -432,7 +435,7 @@ 1.60 + 'daemon_pid|daemon-pid=s', 'daemon_rrd|daemon-rrd=s', 1.61 + 'daemon_log|daemon-log=s', 'ignore-localhost!', 'ignore-host=s@', 1.62 + 'only-mail-rrd', 'only-virus-rrd', 'rrd_name|rrd-name=s', 1.63 +- 'rbl-is-spam', 'virbl-is-virus' 1.64 ++ 'rbl-is-spam', 'virbl-is-virus', 'multi-rule-spam' 1.65 + ) or exit(1); 1.66 + usage if $opt{help}; 1.67 + 1.68 +@@ -610,6 +613,18 @@ 1.69 + elsif($opt{'rbl-is-spam'} and $text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: .*: 554.* blocked using/) { 1.70 + event($time, 'spam'); 1.71 + } 1.72 ++ elsif($opt{'multi-rule-spam'} and $text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: .*: 554.* Client host rejected: Access denied/) { 1.73 ++ event($time, 'spam'); 1.74 ++ } 1.75 ++ elsif($opt{'multi-rule-spam'} and $text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: .*: 450.* Helo command rejected: Host not found/) { 1.76 ++ event($time, 'spam'); 1.77 ++ } 1.78 ++ elsif($opt{'multi-rule-spam'} and $text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: .*: 450.* Sender address rejected: Domain not found/) { 1.79 ++ event($time, 'spam'); 1.80 ++ } 1.81 ++ elsif($opt{'multi-rule-spam'} and $text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: .*: 450.* Client host rejected: cannot find your hostname/) { 1.82 ++ event($time, 'spam'); 1.83 ++ } 1.84 + elsif($text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: /) { 1.85 + event($time, 'rejected'); 1.86 + } 1.87 +@@ -924,6 +939,7 @@ 1.88 + --rrd-name=NAME use NAME.rrd and NAME_virus.rrd for the rrd files 1.89 + --rbl-is-spam count rbl rejects as spam 1.90 + --virbl-is-virus count virbl rejects as viruses 1.91 ++ --multi-rule-spam count several typical reject messages as spam 1.92 + 1.93 + =head1 DESCRIPTION 1.94 +