explicitely set the "GnuGP" setting of gpg-ezmlm, since its pre-configured default value is vey unlikely to work (/usr/local/bin/gpg)

This commit is contained in:
lars 2008-10-02 22:46:40 +00:00
parent 950a4fbfe6
commit cae467c8f1
2 changed files with 14 additions and 3 deletions

View file

@ -65,6 +65,7 @@ The Mail::Ezmlm::GpgEzmlm class is inherited from the Mail::Ezmlm class.
# == Begin site dependant variables ==
$GPG_EZMLM_BASE = '/usr/bin'; # Autoinserted by Makefile.PL
$GPG_BIN = '/usr/bin/gpg' # Autoinserted by Makefile.PL
# == clean up the path for taint checking ==
local $ENV{PATH};
@ -101,6 +102,7 @@ sub new {
bless $self, ref $class || $class || 'Mail::Ezmlm::GpgEzmlm';
# define the available (supported) options for gpg-ezmlm ==
@{$self->{SUPPORTED_OPTIONS}} = (
"GnupG",
"KeyDir",
"RequireSub",
"RequireSigs",
@ -321,14 +323,16 @@ sub update {
my ($result);
# restore the ususal ezmlm-idx config file (for v0.4xx)
&_enable_plaintext_config_file($self->thislist());
# let ezmlm-make do the setup
$result = $self->SUPER::update($options);
# restore the gpg-ezmlm config file
&_enable_encryption_config_file($self->thislist());
# "repair" the dotqmail files
# "repair" the dotqmail files (use "gpg-ezmlm-send" instead of "ezmlm-send")
&_cleanup_dotqmail_files($self->thislist());
# the normal configuration via "ezmlm-make" may not happen, since
# this would overwrite the dotqmail files. Thus we just do nothing.
return the result of the ezmlm-make run
return $result;
}
@ -352,6 +356,11 @@ sub update_special {
return undef;
}
# always set the default value for the "gpg" setting explicitely - otherwise
# gpg-ezmlm breaks on most systems (its default location is
# /usr/local/bin/gpg)
$ok_switches{GnuPG} = $GPG_BIN;
@delete_switches = ();
# check if all supplied settings are supported
# btw we change the case (upper/lower) of the setting to the default one

View file

@ -200,6 +200,7 @@ EOM
or die "Unable to read temp file: $!";
while(<TMP>) {
s{^\$GPG_EZMLM_BASE\s*=\s*['"].+?['"]\s*;\s*(#.*|)$}{\$GPG_EZMLM_BASE = '$gpg_ezmlm_path'; # Autoinserted by Makefile.PL};
s{^\$GPG_BIN\s*=\s*['"].+?['"]\s*;\s*(#.*|)$}{\$GPG_BIN = '$gpg_bin'; # Autoinserted by Makefile.PL} if ($gpg_bin_requested);
print GPGEZMLM;
}
close TMP; close GPGEZMLM;
@ -228,3 +229,4 @@ EOM
return {};
}