diff options
author | Antoine Ginies <aginies@mandriva.com> | 2005-06-07 01:34:31 +0000 |
---|---|---|
committer | Antoine Ginies <aginies@mandriva.com> | 2005-06-07 01:34:31 +0000 |
commit | 027a732513b5a7730c43a31ab3588c6503e6a92f (patch) | |
tree | 12fbf76fe74a7d5011601abf5c162a3e3df6400e /postfix_wizard | |
parent | 78c5af1ba86a9202c79d31faf3dbec830f254529 (diff) | |
download | drakwizard-027a732513b5a7730c43a31ab3588c6503e6a92f.tar drakwizard-027a732513b5a7730c43a31ab3588c6503e6a92f.tar.gz drakwizard-027a732513b5a7730c43a31ab3588c6503e6a92f.tar.bz2 drakwizard-027a732513b5a7730c43a31ab3588c6503e6a92f.tar.xz drakwizard-027a732513b5a7730c43a31ab3588c6503e6a92f.zip |
cp default configuration, fix wiz_relay wiz_domains (thx anne)
Diffstat (limited to 'postfix_wizard')
-rwxr-xr-x | postfix_wizard/Postfix.pm | 18 |
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; |