From 4872c954e2340d1ed8460488e53b8fc351c4e117 Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Fri, 3 Jun 2005 13:25:37 +0000 Subject: add newbie/expoert mode, various other fix --- postfix_wizard/Postfix.pm | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/postfix_wizard/Postfix.pm b/postfix_wizard/Postfix.pm index 9b17a683..a659d4bb 100755 --- a/postfix_wizard/Postfix.pm +++ b/postfix_wizard/Postfix.pm @@ -105,10 +105,14 @@ my %type = ( 2 => N("Relay mail server"), ); +my %understanding = ( + 1 => N('Newbie - classical options'), + 2 => N('Expert - advanced options'), + ); $o->{pages} = { welcome => { - name => N("Internet mail configuration wizard") . "\n\n" . N("This wizard will help you configure an mail server for your network, or configure an mail relay."), + name => N("Internet mail configuration wizard") . "\n\n" . N("This wizard will help you configure an Postifx mail server for your network, or a Postfix mail relay."), no_back => 1, pre => sub { if (-f $wiz_postfix_etc) { @@ -121,7 +125,7 @@ $o->{pages} = { }, post => sub { if ($o->{var}{wiz_type} == 2) { - return 'main_server' ; + return 'understanding' ; } else { return 'relay_server'; } @@ -129,8 +133,15 @@ $o->{pages} = { data => [ { label => N("What do you want to do:"), val => \$o->{var}{wiz_level}, list => [ keys %type ], format => sub { $type{$_[0]} } }, ], - next => 'relay_server', + next => 'understanding', }, + understanding => { + name => N('Now i need to know your undestanding in Samba server configuration'), + data => [ + { label => N("What kind of user are you:"), val => \$o->{var}{wiz_understanding}, list => [ keys %understanding ], format => sub { $understanding{$_[0]} } }, + ], + next => 'main_server', + }, main_server => { name => N("Mail server") . "\n" . N("This should be chosen consistently with the address you use for incoming mail.") . "\n\n" . N("Address masquerading is a method to hide all hosts inside a domain behind their mail gateway, and to make it appear as if the mail comes from the gateway itself, instead of from individual machines."), pre => sub { @@ -193,15 +204,19 @@ $o->{pages} = { { label => N("myorigin:"), fixed_val => \$o->{var}{wiz_myorigin} }, ], post => \&do_it_relay_server, - next => 'end_relay' + next => 'end' }, summary_main => { name => N("The wizard will now configure your mail server."), post => \&do_it_main_server, next => 'end' }, - end_relay => { - name => N("Congratulations") . "\n\n" . N("The wizard successfully configured your relay mail server."), + end => { + name => N("Congratulations") . "\n\n" . N("The wizard successfully configured your Mail server."), + post => sub { + store_postfix_type($o->{var}{wiz_type}); + }, + no_back => 1, end => 1, next => 0 }, @@ -267,7 +282,7 @@ sub postfix_options { $o->{var}{wiz_relay_domains} and $postfix->{wiz_relay_domains} = $o->{var}{wiz_relay_domains}; } -sub store_samba_type { +sub store_postfix_type { # write config file to store Postfix type my ($type) = @_; output($wiz_postfix_etc, <{var}{wiz_ext_mail_relay} or return 'warning'; $o->{var}{wiz_ext_mail_relay} =~ /(\S+)\.(\S+)$/ or return 'warning'; -- cgit v1.2.1