1 Index: mailgraph.cgi |
1 Index: mailgraph.cgi |
2 --- mailgraph.cgi.orig 2007-08-29 11:06:01 +0200 |
2 --- mailgraph.pl.orig 2007-08-29 11:06:01.000000000 +0200 |
3 +++ mailgraph.cgi 2007-08-29 19:05:41 +0200 |
3 +++ mailgraph.pl 2009-04-26 18:06:13.313712038 +0200 |
4 @@ -160,7 +160,7 @@ |
|
5 <html> |
|
6 <head> |
|
7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|
8 -<title>Mail statistics for $host</title> |
|
9 +<title>Postfix Mail statistics for $host</title> |
|
10 <meta http-equiv="Refresh" content="300" /> |
|
11 <meta http-equiv="Pragma" content="no-cache" /> |
|
12 <link rel="stylesheet" href="mailgraph.css" type="text/css" /> |
|
13 @@ -168,7 +168,7 @@ |
|
14 <body> |
|
15 HEADER |
|
16 |
|
17 - print "<h1>Mail statistics for $host</h1>\n"; |
|
18 + print "<h1>Postfix Mail statistics for $host</h1>\n"; |
|
19 |
|
20 print "<ul id=\"jump\">\n"; |
|
21 for my $n (0..$#graphs) { |
|
22 @@ -183,13 +183,6 @@ |
|
23 } |
|
24 |
|
25 print <<FOOTER; |
|
26 -<hr/> |
|
27 -<table><tr><td> |
|
28 -<a href="http://mailgraph.schweikert.ch/">Mailgraph</a> $VERSION |
|
29 -by <a href="http://david.schweikert.ch/">David Schweikert</a></td> |
|
30 -<td align="right"> |
|
31 -<a href="http://oss.oetiker.ch/rrdtool/"><img src="http://oss.oetiker.ch/rrdtool/.pics/rrdtool.gif" alt="" width="120" height="34"/></a> |
|
32 -</td></tr></table> |
|
33 </body></html> |
|
34 FOOTER |
|
35 } |
|
36 Index: mailgraph.pl |
|
37 --- mailgraph.pl.orig 2007-08-29 11:06:01 +0200 |
|
38 +++ mailgraph.pl 2007-08-29 19:03:59 +0200 |
|
39 @@ -211,6 +211,8 @@ |
4 @@ -211,6 +211,8 @@ |
40 \s |
5 \s |
41 ([-\w\.\@:]+) # host -- 6 |
6 ([-\w\.\@:]+) # host -- 6 |
42 \s+ |
7 \s+ |
43 + <[^>]+> # OSSP fsl log level |
8 + <[^>]+> # OSSP fsl log level |
44 + \s+ |
9 + \s+ |
45 (?:\[LOG_[A-Z]+\]\s+)? # FreeBSD |
10 (?:\[LOG_[A-Z]+\]\s+)? # FreeBSD |
46 (.*) # text -- 7 |
11 (.*) # text -- 7 |
47 $/x or do |
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"; |
|
18 |
|
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}; |
|
29 |
|
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 |
|
54 |
|
55 =head1 DESCRIPTION |
|
56 |