From 3afe1b82ef3f34f9301301fcdb9deb8dcd395f60 Mon Sep 17 00:00:00 2001
From: Julien Valroff
Date: Tue, 8 Mar 2011 21:00:56 +0100
Subject: Fix patch to set default location of rrd files
---
debian/patches/001_default-rrd-location.diff | 34 ++++++++++++++++++++++++++++
debian/patches/series | 2 +-
2 files changed, 35 insertions(+), 1 deletion(-)
create mode 100644 debian/patches/001_default-rrd-location.diff
(limited to 'debian/patches')
diff --git a/debian/patches/001_default-rrd-location.diff b/debian/patches/001_default-rrd-location.diff
new file mode 100644
index 0000000..e971e1c
--- /dev/null
+++ b/debian/patches/001_default-rrd-location.diff
@@ -0,0 +1,34 @@
+Description: Set path to rrd files to /var/lib/mailgraph/
+Forwarded: not-needed
+
+--- a/mailgraph.cgi
++++ b/mailgraph.cgi
+@@ -18,7 +18,7 @@
+ my $ypoints_err = 96;
+ my $rrd = 'mailgraph.rrd'; # path to where the RRD database is
+ my $rrd_virus = 'mailgraph_virus.rrd'; # path to where the Virus RRD database is
+-my $tmp_dir = '/tmp/mailgraph'; # temporary directory where to store the images
++my $tmp_dir = '/var/lib/mailgraph'; # temporary directory where to store the images
+
+ my @graphs = (
+ { title => 'Last Day', seconds => 3600*24, },
+--- a/mailgraph.pl
++++ b/mailgraph.pl
+@@ -373,7 +373,7 @@
+
+ my $daemon_logfile = '/var/log/mailgraph.log';
+ my $daemon_pidfile = '/var/run/mailgraph.pid';
+-my $daemon_rrd_dir = '/var/log';
++my $daemon_rrd_dir = '/var/lib/mailgraph';
+
+ # global variables
+ my $logfile;
+@@ -411,7 +411,7 @@
+ print " --host=HOST use only entries for HOST (regexp) in syslog\n";
+ print " -d, --daemon start in the background\n";
+ print " --daemon-pid=FILE write PID to FILE instead of /var/run/mailgraph.pid\n";
+- print " --daemon-rrd=DIR write RRDs to DIR instead of /var/log\n";
++ print " --daemon-rrd=DIR write RRDs to DIR instead of /var/lib/mailgraph\n";
+ print " --daemon-log=FILE write verbose-log to FILE instead of /var/log/mailgraph.log\n";
+ print " --ignore-localhost ignore mail to/from localhost (used for virus scanner)\n";
+ print " --ignore-host=HOST ignore mail to/from HOST regexp (used for virus scanner)\n";
diff --git a/debian/patches/series b/debian/patches/series
index d5835d9..e07de45 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,4 @@
-001_path-to-rrd.diff
+001_default-rrd-location.diff
002_script-name.diff
003_web-bug.diff
101_dspam-virus-notifications.diff
--
cgit v1.2.3
From d7b40e5247376aab389e2b69926a301cc2730db4 Mon Sep 17 00:00:00 2001
From: Julien Valroff
Date: Sun, 13 Mar 2011 08:15:05 +0100
Subject: Fix previous commit
---
debian/patches/001_default-rrd-location.diff | 10 ++++++---
debian/patches/001_path-to-rrd.diff | 31 ----------------------------
2 files changed, 7 insertions(+), 34 deletions(-)
delete mode 100644 debian/patches/001_path-to-rrd.diff
(limited to 'debian/patches')
diff --git a/debian/patches/001_default-rrd-location.diff b/debian/patches/001_default-rrd-location.diff
index e971e1c..54be53f 100644
--- a/debian/patches/001_default-rrd-location.diff
+++ b/debian/patches/001_default-rrd-location.diff
@@ -3,11 +3,15 @@ Forwarded: not-needed
--- a/mailgraph.cgi
+++ b/mailgraph.cgi
-@@ -18,7 +18,7 @@
+@@ -16,9 +16,9 @@
+ my $points_per_sample = 3;
+ my $ypoints = 160;
my $ypoints_err = 96;
- my $rrd = 'mailgraph.rrd'; # path to where the RRD database is
- my $rrd_virus = 'mailgraph_virus.rrd'; # path to where the Virus RRD database is
+-my $rrd = 'mailgraph.rrd'; # path to where the RRD database is
+-my $rrd_virus = 'mailgraph_virus.rrd'; # path to where the Virus RRD database is
-my $tmp_dir = '/tmp/mailgraph'; # temporary directory where to store the images
++my $rrd = '/var/lib/mailgraph/mailgraph.rrd'; # path to where the RRD database is
++my $rrd_virus = '/var/lib/mailgraph/mailgraph_virus.rrd'; # path to where the Virus RRD database is
+my $tmp_dir = '/var/lib/mailgraph'; # temporary directory where to store the images
my @graphs = (
diff --git a/debian/patches/001_path-to-rrd.diff b/debian/patches/001_path-to-rrd.diff
deleted file mode 100644
index 442ea58..0000000
--- a/debian/patches/001_path-to-rrd.diff
+++ /dev/null
@@ -1,31 +0,0 @@
-Description: Set path to rrd files to /var/lib/mailgraph/
-Forwarded: not-needed
-
---- a/mailgraph.cgi
-+++ b/mailgraph.cgi
-@@ -16,9 +16,9 @@
- my $points_per_sample = 3;
- my $ypoints = 160;
- my $ypoints_err = 96;
--my $rrd = 'mailgraph.rrd'; # path to where the RRD database is
--my $rrd_virus = 'mailgraph_virus.rrd'; # path to where the Virus RRD database is
--my $tmp_dir = '/tmp/mailgraph'; # temporary directory where to store the images
-+my $rrd = '/var/lib/mailgraph/mailgraph.rrd'; # path to where the RRD database is
-+my $rrd_virus = '/var/lib/mailgraph/mailgraph_virus.rrd'; # path to where the Virus RRD database is
-+my $tmp_dir = '/var/lib/mailgraph/'; # temporary directory where to store the images
-
- my @graphs = (
- { title => 'Last Day', seconds => 3600*24, },
---- a/mailgraph.pl
-+++ b/mailgraph.pl
-@@ -377,8 +377,8 @@
-
- # global variables
- my $logfile;
--my $rrd = "mailgraph.rrd";
--my $rrd_virus = "mailgraph_virus.rrd";
-+my $rrd = "/var/lib/mailgraph/mailgraph.rrd";
-+my $rrd_virus = "/var/lib/mailgraph/mailgraph_virus.rrd";
- my $year;
- my $this_minute;
- my %sum = ( sent => 0, received => 0, bounced => 0, rejected => 0, virus => 0, spam => 0 );
--
cgit v1.2.3
From c6eee8fb7e2ba294afaae402177794247de1957d Mon Sep 17 00:00:00 2001
From: Julien Valroff
Date: Sun, 13 Mar 2011 08:44:39 +0100
Subject: Add greylisting support
---
debian/patches/050_greylist.diff | 261 ++++++++++++++++++++++
debian/patches/051_postgrey.diff | 256 ---------------------
debian/patches/101_dspam-virus-notifications.diff | 2 +-
debian/patches/102_clamav-milter.diff | 2 +-
debian/patches/series | 1 +
5 files changed, 264 insertions(+), 258 deletions(-)
create mode 100644 debian/patches/050_greylist.diff
delete mode 100644 debian/patches/051_postgrey.diff
(limited to 'debian/patches')
diff --git a/debian/patches/050_greylist.diff b/debian/patches/050_greylist.diff
new file mode 100644
index 0000000..598deb8
--- /dev/null
+++ b/debian/patches/050_greylist.diff
@@ -0,0 +1,261 @@
+Description: Add postgrey and greylisting support to mailgraph
+Author: Alexander Bech
+Origin: http://www.bakarasse.de/pages/en/linux/mailgraph.php
+
+--- a/mailgraph.cgi
++++ b/mailgraph.cgi
+@@ -16,6 +16,7 @@
+ my $points_per_sample = 3;
+ my $ypoints = 160;
+ my $ypoints_err = 96;
++my $ypoints_grey = 96;
+ my $rrd = '/var/lib/mailgraph/mailgraph.rrd'; # path to where the RRD database is
+ my $rrd_virus = '/var/lib/mailgraph/mailgraph_virus.rrd'; # path to where the Virus RRD database is
+ my $tmp_dir = '/var/lib/mailgraph'; # temporary directory where to store the images
+@@ -28,12 +29,14 @@
+ );
+
+ my %color = (
+- sent => '000099', # rrggbb in hex
+- received => '009900',
+- rejected => 'AA0000',
+- bounced => '000000',
+- virus => 'DDBB00',
+- spam => '999999',
++ sent => '000099', # rrggbb in hex
++ received => '009900',
++ rejected => 'AA0000',
++ bounced => '000000',
++ virus => 'DDBB00',
++ spam => '999999',
++ greylisted => '999999',
++ delayed => '006400',
+ );
+
+ sub rrd_graph(@)
+@@ -151,6 +154,36 @@
+ );
+ }
+
++sub graph_grey($$)
++{
++ my ($range, $file) = @_;
++ my $step = $range*$points_per_sample/$xpoints;
++ rrd_graph($range, $file, $ypoints_grey,
++ "DEF:greylisted=$rrd_greylist:greylisted:AVERAGE",
++ "DEF:mgreylisted=$rrd_greylist:greylisted:MAX",
++ "CDEF:rgreylisted=greylisted,60,*",
++ "CDEF:dgreylisted=greylisted,UN,0,greylisted,IF,$step,*",
++ "CDEF:sgreylisted=PREV,UN,dgreylisted,PREV,IF,dgreylisted,+",
++ "CDEF:rmgreylisted=mgreylisted,60,*",
++ "AREA:rgreylisted#$color{greylisted}:Greylisted",
++ 'GPRINT:sgreylisted:MAX:total\: %8.0lf msgs',
++ 'GPRINT:rgreylisted:AVERAGE:avg\: %5.2lf msgs/min',
++ 'GPRINT:rmgreylisted:MAX:max\: %4.0lf msgs/min\l',
++
++ "DEF:delayed=$rrd_greylist:delayed:AVERAGE",
++ "DEF:mdelayed=$rrd_greylist:delayed:MAX",
++ "CDEF:rdelayed=delayed,60,*",
++ "CDEF:ddelayed=delayed,UN,0,delayed,IF,$step,*",
++ "CDEF:sdelayed=PREV,UN,ddelayed,PREV,IF,ddelayed,+",
++ "CDEF:rmdelayed=mdelayed,60,*",
++ "LINE2:rdelayed#$color{delayed}:Delayed ",
++ 'GPRINT:sdelayed:MAX:total\: %8.0lf msgs',
++ 'GPRINT:rdelayed:AVERAGE:avg\: %5.2lf msgs/min',
++ 'GPRINT:rmdelayed:MAX:max\: %4.0lf msgs/min\l',
++ );
++}
++
++
+ sub print_html()
+ {
+ print "Content-Type: text/html\n\n";
+@@ -180,6 +213,7 @@
+ print "$graphs[$n]{title}
\n";
+ print "
\n";
+ print "
\n";
++ print "
\n";
+ }
+
+ print <