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.

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

mercurial