diff --git a/Changes b/Changes index 4b5a02e..2f0e11d 100644 --- a/Changes +++ b/Changes @@ -17,6 +17,10 @@ The unrecognized_command hook now uses DENY_DISCONNECT return 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 diff --git a/lib/Qpsmtpd.pm b/lib/Qpsmtpd.pm index b5b7169..6fb2a45 100644 --- a/lib/Qpsmtpd.pm +++ b/lib/Qpsmtpd.pm @@ -114,6 +114,10 @@ sub config_dir { my $configdir = ($ENV{QMAIL} || '/var/qmail') . '/control'; my ($name) = ($0 =~ m!(.*?)/([^/]+)$!); $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; }