peter
User
 Junior Boarder
| Posts: 6 |   | Karma: 0
|
Patch for path to mail queue dirs - 2007/07/06 15:39
The path to the mail queue dirs (mqueue.in and mqueue) are hardcoded to /var/spool. I don't use that and get empty graphs for inbound and outbound queues as well as always a zero for pending mail. These patches add an option for your own path.
I hope they can be included in the next release of Vispan.
| Code: |
--- Vispan.conf.070706 Fri Jul 6 16:47:57 2007
+++ Vispan.conf Fri Jul 6 16:49:47 2007
@@ -99,6 +99,9 @@
# in your mailscanner config file.
LogFile = /var/log/maillog
+# Mail queue path prefix, default /var/spool
+QueuePathPrefix = /var/spool
+
# Space separated list of extra mail queue directories - used to work out
# the queue length.
Queue_Dirs =
--- Print.pm.070706 Fri Jul 6 16:47:38 2007
+++ Print.pm Fri Jul 6 17:25:51 2007
@@ -836,7 +836,8 @@
}
# Get the length of the inbound mail queue
- opendir(QDIR, "/var/spool/mqueue.in");
+ my $queue_path_prefix = Vispan::Config::Value(QueuePathPrefix);
+ opendir(QDIR, $queue_path_prefix . "/mqueue.in");
$mcount += scalar(grep { /^qf/ } readdir(QDIR));
closedir(QDIR);
--- Stats.pm.070706 Fri Jul 6 16:47:29 2007
+++ Stats.pm Fri Jul 6 17:24:03 2007
@@ -963,9 +963,10 @@
my $Days = Vispan::Config::Value(Days) || 365;
my $Months = Vispan::Config::Value(Months) || 24;
my $Years = Vispan::Config::Value(Years) || 10;
+ my $queue_path_prefix = Vispan::Config::Value(QueuePathPrefix);
- foreach $mqueue (mailq_dir("/var/spool/mqueue")) {
+ foreach $mqueue (mailq_dir($queue_path_prefix . "/mqueue")) {
opendir(QDIR, $mqueue);
$mcount += scalar(grep { /^qf/ } readdir(QDIR));
closedir(QDIR);
@@ -973,7 +974,7 @@
$ThisInt{OutQueue} = $mcount;
$mcount = 0;
- opendir(QDIR, "/var/spool/mqueue.in");
+ opendir(QDIR, $queue_path_prefix . "/mqueue.in");
$mcount += scalar(grep { /^qf/ } readdir(QDIR));
closedir(QDIR);
$ThisInt{Queue} = $mcount;
|
Post edited by: peter, at: 2007/07/06 16:43
Post edited by: peter, at: 2007/07/06 16:44
|