summaryrefslogtreecommitdiffstats
path: root/postfix_wizard/Postfix.pm
diff options
context:
space:
mode:
Diffstat (limited to 'postfix_wizard/Postfix.pm')
-rwxr-xr-xpostfix_wizard/Postfix.pm18
1 files changed, 10 insertions, 8 deletions
diff --git a/postfix_wizard/Postfix.pm b/postfix_wizard/Postfix.pm
index 35ab07c5..582fa39b 100755
--- a/postfix_wizard/Postfix.pm
+++ b/postfix_wizard/Postfix.pm
@@ -4,7 +4,7 @@
# Copyright (C) 2002, 2005 Mandrakesoft
#
-# Authors: Antoine Giniès <aginies at mandriva.com>
+# Authors: Antoine Ginies <aginies at mandriva.com>
# Arnaud Desmons <adesmons@mandrakesoft.com>
# Florent Villard <warly@mandrakesoft.com>
#
@@ -33,6 +33,8 @@ use MDK::Wizard::Varspaceval;
use Libconf qw(:functions);
use Libconf::Glueconf::Postfix::Main_cf;
+
+if (!-f "/etc/postfix/main.cf") { cp_af("/etc/postfix/main.cf.dist", "/etc/postfix/main.cf") }
my $postfix = new Libconf::Glueconf::Postfix::Main_cf({ filename => '/etc/postfix/main.cf', });
use Data::Dumper;
print Dumper($postfix);
@@ -84,9 +86,9 @@ my $o = {
check_sendmail();
my $t = any { /$wiz_host_name/ } cat_("/etc/hosts");
if ($t == 0) {
- return 0, N("Error, can't find your hostname in /etc/hosts. Exiting. Please launch drakconnect and choose static IP address.")
+ return 0, N("Error, can't find your hostname in /etc/hosts. Exiting. Please launch drakconnect and choose static IP address.");
}
- 1
+ 1;
},
needed_rpm => [ 'postfix' ],
defaultimage => "$ENV{__WIZ_HOME__}postfix_wizard/images/courrier.png"
@@ -167,7 +169,7 @@ $o->{pages} = {
pre => sub {
$o->{var}{wiz_smtpd_helo_required} ||= $postfix->{smtpd_helo_required};
$o->{var}{wiz_disable_vrfy_command} ||= $postfix->{disable_vrfy_command};
- $postfix->{masquerade_domains} and $o->{var}{wiz_masquerade_domains};
+ $o->{var}{wiz_masquerade_domains} ||=$postfix->{masquerade_domains};
},
data => [
{ label => N('helo required:'), val => \$o->{var}{wiz_smtpd_helo_required}, fixed_list => \@yesorno },
@@ -361,8 +363,8 @@ sub do_it_relay_server {
save_config();
postfix_options();
- $o->{var}{wiz_relayhost} and $postfix->{wiz_relayhost} = $o->{var}{wiz_relayhost};
- $o->{var}{wiz_relay_domains} and $postfix->{wiz_relay_domains} = $o->{var}{wiz_relay_domains};
+ $o->{var}{wiz_relayhost} and $postfix->{relayhost} = $o->{var}{wiz_relayhost};
+ $o->{var}{wiz_relay_domains} and $postfix->{relay_domains} = $o->{var}{wiz_relay_domains};
# remove server unwanted options
$postfix->{smtpd_helo_required} and delete $postfix->{smtpd_helo_required};
@@ -389,8 +391,8 @@ sub do_it_main_server {
$o->{var}{wiz_delay_warning_time} and $postfix->{delay_warning_time} = $o->{var}{wiz_delay_warning_time};
# remove relay options
- $o->{var}{wiz_relay_domains} and delete $o->{var}{wiz_relay_domains};
- $o->{var}{wiz_relayhost} and delete $o->{var}{wiz_relayhost};
+ $postfix->{relayhost} and delete $postfix->{relayhost};
+ $postfix->{relay_domains} and delete $postfix->{relay_domains};
cmd_needed();
undef $w;