Use $ENV{QMAIL} to override /var/qmail for where to find the
control/ directory. git-svn-id: https://svn.perl.org/qpsmtpd/trunk@169 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
53efac2e14
commit
e006f74d23
@ -53,15 +53,14 @@ sub get_qmail_config {
|
|||||||
if ($self->{_config_cache}->{$config}) {
|
if ($self->{_config_cache}->{$config}) {
|
||||||
return wantarray ? @{$self->{_config_cache}->{$config}} : $self->{_config_cache}->{$config}->[0];
|
return wantarray ? @{$self->{_config_cache}->{$config}} : $self->{_config_cache}->{$config}->[0];
|
||||||
}
|
}
|
||||||
my $configdir = '/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");
|
||||||
|
|
||||||
my $configfile = "$configdir/$config";
|
my $configfile = "$configdir/$config";
|
||||||
|
|
||||||
if ($type and $type eq "map") {
|
if ($type and $type eq "map") {
|
||||||
warn "MAP!";
|
return +{} unless -e $configfile . ".cdb";
|
||||||
return +{} unless -e $configfile;
|
|
||||||
eval { require CDB_File };
|
eval { require CDB_File };
|
||||||
|
|
||||||
if ($@) {
|
if ($@) {
|
||||||
|
Loading…
Reference in New Issue
Block a user