Here are the patches I made for 0.29 while preparing my RPM and .deb
files, and which still apply cleanly to the trunk (revision 458), so I
guess I would like to see them in 0.30, when it is released.

I am posting one patch per mail to make it easier to discuss them
separately.

This one makes the config directory and the plugin directory
configurable.

The config dir is taken from an env. variable QPSMTPD_CONFIG, if it
exists.

The plugin dir is taken from $self->config('plugin_dir').

The defaults are unchanged.

        hp

-- 
   _  | Peter J. Holzer    | Ich sehe nun ein, dass Computer wenig
|_|_) | Sysadmin WSR       | geeignet sind, um sich was zu merken.
| |   | [EMAIL PROTECTED]         |
__/   | http://www.hjp.at/ |    -- Holger Lembke in dan-am
--- lib/Qpsmtpd.pm.2005-04-19T12:48:28  Thu Mar  3 03:30:16 2005
+++ lib/Qpsmtpd.pm      Mon Apr 25 18:37:56 2005
@@ -67,12 +67,20 @@
   my $configdir = ($ENV{QMAIL} || '/var/qmail') . '/control';
   my ($name) = ($0 =~ m!(.*?)/([^/]+)$!);
   $configdir = "$name/config" if (-e "$name/config/$config");
+  if (exists $ENV{QPSMTPD_CONFIG}) {
+    $configdir = $ENV{QPSMTPD_CONFIG} if (-e "$ENV{QPSMTPD_CONFIG}/$config");
+  }
   return $configdir;
 }
 
 sub plugin_dir {
-    my ($name) = ($0 =~ m!(.*?)/([^/]+)$!);
-    my $dir = "$name/plugins";
+    my $self = shift;
+    my $plugin_dir = $self->config('plugin_dir');
+    unless (defined($plugin_dir)) {
+      my ($name) = ($0 =~ m!(.*?)/([^/]+)$!);
+      $plugin_dir = "$name/plugins";
+    }
+    return $plugin_dir;
 }
 
 sub get_qmail_config {

Attachment: pgp8BwJiwwezo.pgp
Description: PGP signature

Reply via email to