Apply slight variation on patch from Peter Holzer to allow specification of

an explicit $QPSMTPD_CONFIG variable to specify where the config lives,
overriding $QMAIL/control and /var/qmail/control if set.  The usual "last
location with the file wins" rule still applies.


git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@529 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Devin Carraway 2005-07-29 08:05:42 +00:00
parent a9bb35d180
commit deb3380d06
2 changed files with 8 additions and 0 deletions

View File

@ -17,6 +17,10 @@
The unrecognized_command hook now uses DENY_DISCONNECT return The unrecognized_command hook now uses DENY_DISCONNECT return
for disconnecting the user. for disconnecting the user.
If the environment variable $QPSMTPD_CONFIG is set, qpsmtpd will look
for its config files in the directory given therein, in addition to (and
in preference to) other locations. (Peter J. Holzer)
Updated documentation Updated documentation

View File

@ -114,6 +114,10 @@ sub config_dir {
my $configdir = ($ENV{QMAIL} || '/var/qmail') . '/control'; my $configdir = ($ENV{QMAIL} || '/var/qmail') . '/control';
my ($name) = ($0 =~ m!(.*?)/([^/]+)$!); my ($name) = ($0 =~ m!(.*?)/([^/]+)$!);
$configdir = "$name/config" if (-e "$name/config/$config"); $configdir = "$name/config" if (-e "$name/config/$config");
if (exists $ENV{QPSMTPD_CONFIG}) {
$ENV{QPSMTPD_CONFIG} =~ /^(.*)$/; # detaint
$configdir = $1 if -e "$1/$config";
}
return $configdir; return $configdir;
} }