postfix-mailgraph/postfix-mailgraph.patch

Tue, 29 Mar 2011 20:04:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 20:04:34 +0200
changeset 334
4a34d7a82eab
parent 201
3be96a4c8c18
permissions
-rw-r--r--

Rework package yet again, correcting and introducing new buildconf logic:
Conditionally disable bootstrap stage comparison correctly, correct
english grammar, better find system as(1) and ld(1), indotruce detailed
optimization option messages, more completely guess cpu types, allow
profiled bootstrapping without a preinstalled GCC because many other
compilers have long since implemented 64-bit arithmetic, instruct make
to build sequentially (not in sparallel) when building a profiled
bootstrap as GCC online documents recommend, and generally improve
comment blocks.

The single most important correction in this changeset relates to the
GCC changed optimization policy since at least GCC 4.5, in which -march
is always passed and not always correctly guessed. In the case of this
package, allowing GCC to guess the architecture leads to wild build
errors at various subcomponents (zlib, libgcc, libiberty...) and
bootstrap stages. It seems quite platform specific, and the safest
approach to correcting this seems to be explicitly always specifying the
-march argument when bootstrapping GCC. Because the best choice 'native'
is not available when bootstrapping using a foreign (non GCC) compiler,
a guess is made according to rpmmacros l_platform in that case.

It is questionable as to whether these recent optimization changes
on the part of GCC or this package are compatible with each other,
or if either are complete or correct at all. At least applying these
corrections allows this package to build again in most cases test.

michael@201 1 Index: mailgraph.cgi
michael@201 2 --- mailgraph.cgi.orig 2007-08-29 11:06:01 +0200
michael@201 3 +++ mailgraph.cgi 2007-08-29 19:05:41 +0200
michael@201 4 @@ -183,13 +183,6 @@
michael@201 5 }
michael@201 6
michael@201 7 print <<FOOTER;
michael@201 8 -<hr/>
michael@201 9 -<table><tr><td>
michael@201 10 -<a href="http://mailgraph.schweikert.ch/">Mailgraph</a> $VERSION
michael@201 11 -by <a href="http://david.schweikert.ch/">David Schweikert</a></td>
michael@201 12 -<td align="right">
michael@201 13 -<a href="http://oss.oetiker.ch/rrdtool/"><img src="http://oss.oetiker.ch/rrdtool/.pics/rrdtool.gif" alt="" width="120" height="34"/></a>
michael@201 14 -</td></tr></table>
michael@201 15 </body></html>
michael@201 16 FOOTER
michael@201 17 }
michael@171 18 Index: mailgraph.cgi
michael@199 19 --- mailgraph.pl.orig 2007-08-29 11:06:01.000000000 +0200
michael@199 20 +++ mailgraph.pl 2009-04-26 18:06:13.313712038 +0200
michael@171 21 @@ -211,6 +211,8 @@
michael@171 22 \s
michael@171 23 ([-\w\.\@:]+) # host -- 6
michael@171 24 \s+
michael@171 25 + <[^>]+> # OSSP fsl log level
michael@171 26 + \s+
michael@171 27 (?:\[LOG_[A-Z]+\]\s+)? # FreeBSD
michael@171 28 (.*) # text -- 7
michael@171 29 $/x or do
michael@199 30 @@ -420,6 +422,7 @@
michael@199 31 print " --rrd-name=NAME use NAME.rrd and NAME_virus.rrd for the rrd files\n";
michael@199 32 print " --rbl-is-spam count rbl rejects as spam\n";
michael@199 33 print " --virbl-is-virus count virbl rejects as viruses\n";
michael@199 34 + print " --multi-rule-spam count several typical reject messages as spam\n";
michael@199 35
michael@199 36 exit;
michael@199 37 }
michael@199 38 @@ -432,7 +435,7 @@
michael@199 39 'daemon_pid|daemon-pid=s', 'daemon_rrd|daemon-rrd=s',
michael@199 40 'daemon_log|daemon-log=s', 'ignore-localhost!', 'ignore-host=s@',
michael@199 41 'only-mail-rrd', 'only-virus-rrd', 'rrd_name|rrd-name=s',
michael@199 42 - 'rbl-is-spam', 'virbl-is-virus'
michael@199 43 + 'rbl-is-spam', 'virbl-is-virus', 'multi-rule-spam'
michael@199 44 ) or exit(1);
michael@199 45 usage if $opt{help};
michael@199 46
michael@199 47 @@ -610,6 +613,18 @@
michael@199 48 elsif($opt{'rbl-is-spam'} and $text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: .*: 554.* blocked using/) {
michael@199 49 event($time, 'spam');
michael@199 50 }
michael@199 51 + elsif($opt{'multi-rule-spam'} and $text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: .*: 554.* Client host rejected: Access denied/) {
michael@199 52 + event($time, 'spam');
michael@199 53 + }
michael@199 54 + elsif($opt{'multi-rule-spam'} and $text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: .*: 450.* Helo command rejected: Host not found/) {
michael@199 55 + event($time, 'spam');
michael@199 56 + }
michael@199 57 + elsif($opt{'multi-rule-spam'} and $text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: .*: 450.* Sender address rejected: Domain not found/) {
michael@199 58 + event($time, 'spam');
michael@199 59 + }
michael@199 60 + elsif($opt{'multi-rule-spam'} and $text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: .*: 450.* Client host rejected: cannot find your hostname/) {
michael@199 61 + event($time, 'spam');
michael@199 62 + }
michael@199 63 elsif($text =~ /^(?:[0-9A-Z]+: |NOQUEUE: )?reject: /) {
michael@199 64 event($time, 'rejected');
michael@199 65 }
michael@235 66 @@ -628,7 +643,12 @@
michael@235 67 }
michael@235 68 }
michael@235 69 elsif($prog eq 'cleanup') {
michael@235 70 - if($text =~ /^[0-9A-Z]+: (?:reject|discard): /) {
michael@235 71 + if($text =~ /^(?:[0-9A-Z]+: )?milter-reject: /) {
michael@235 72 + if($text =~ /Intercepted/) {
michael@235 73 + event($time, 'virus');
michael@235 74 + }
michael@235 75 + }
michael@235 76 + elsif($text =~ /^[0-9A-Z]+: (?:reject|discard): /) {
michael@235 77 event($time, 'rejected');
michael@235 78 }
michael@235 79 }
michael@235 80 @@ -924,6 +944,7 @@
michael@199 81 --rrd-name=NAME use NAME.rrd and NAME_virus.rrd for the rrd files
michael@199 82 --rbl-is-spam count rbl rejects as spam
michael@199 83 --virbl-is-virus count virbl rejects as viruses
michael@199 84 + --multi-rule-spam count several typical reject messages as spam
michael@199 85
michael@199 86 =head1 DESCRIPTION
michael@199 87

mercurial