From 027a732513b5a7730c43a31ab3588c6503e6a92f Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Tue, 7 Jun 2005 01:34:31 +0000 Subject: cp default configuration, fix wiz_relay wiz_domains (thx anne) --- postfix_wizard/Postfix.pm | 18 ++++++++++-------- 1 file 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 +# Authors: Antoine Ginies # Arnaud Desmons # Florent Villard # @@ -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; -- cgit v1.2.1