summaryrefslogtreecommitdiffstats
path: root/postfix_wizard/Postfix.pm
diff options
context:
space:
mode:
Diffstat (limited to 'postfix_wizard/Postfix.pm')
-rwxr-xr-xpostfix_wizard/Postfix.pm15
1 files changed, 8 insertions, 7 deletions
diff --git a/postfix_wizard/Postfix.pm b/postfix_wizard/Postfix.pm
index 2565c688..45c0552c 100755
--- a/postfix_wizard/Postfix.pm
+++ b/postfix_wizard/Postfix.pm
@@ -44,6 +44,7 @@ use Data::Dumper;
print Dumper($postfix);
my $wiz = new MDK::Wizard::Wizcommon;
+my $in = interactive->vnew;
my $wiz_domain_name = $wiz->{net}->network_get("DOMAINNAME");
my $wiz_host_name = $wiz->{net}->network_get("HOSTNAME");
my $wiz_postfix_etc = "/etc/sysconfig/wizard_postfix";
@@ -118,7 +119,7 @@ $o->{pages} = {
pre => sub {
$postfix->{relayhost} and $o->{var}{wiz_type} = 2;
if (-f $wiz_postfix_etc) {
- $::in->ask_warn(N("Information"), N("It seems you previously setup a Postfix configuration. This wizard will re-read your old configuration, and show you the Postfix server type you choose"));
+ $in->ask_warn(N("Information"), N("It seems you previously setup a Postfix configuration. This wizard will re-read your old configuration, and show you the Postfix server type you choose")) or $in->exit;
my $data = cat_($wiz_postfix_etc);
# detect old Postfix type
my ($old_type) = $data =~ /type=(\d)/;
@@ -161,11 +162,11 @@ $o->{pages} = {
],
complete => sub {
if (!$o->{var}{wiz_smtpd_banner}) {
- $::in->ask_warn(N('Error'), N('Please provide an Smtpd banner.')); return 1; }
+ $in->ask_warn(N('Error'), N('Please provide an Smtpd banner.')); return 1; }
if (!$o->{var}{wiz_myhostname}) {
- $::in->ask_warn(N('Error'), N('You must provide an internet hostname of this mail system.')); return 1; }
+ $in->ask_warn(N('Error'), N('You must provide an internet hostname of this mail system.')); return 1; }
if (!$o->{var}{wiz_mydomain}) {
- $::in->ask_warn(N('Error'), N('You must specify the local internet domain name.')); return 1; }
+ $in->ask_warn(N('Error'), N('You must specify the local internet domain name.')); return 1; }
},
},
main_server => {
@@ -182,7 +183,7 @@ $o->{pages} = {
],
complete => sub {
if ($o->{var}{wiz_masquerade_domains} !~ /\w+\.\w+\s\w+\.\w+$/ and $o->{var}{wiz_masquerade_domains}) {
- $::in->ask_warn(N("Error"), N("Masquerade should be a valid domain name such as \"domain_to_masquerade.com with_this_domain.com\"!"));
+ $in->ask_warn(N("Error"), N("Masquerade should be a valid domain name such as \"domain_to_masquerade.com with_this_domain.com\"!"));
return 1;
} else { return 0; };
},
@@ -198,7 +199,7 @@ $o->{pages} = {
{ label => N('Relay host:'), val => \$o->{var}{wiz_relayhost}, help => 'The default host to send non-local mail to when no entry is matched in the optional transport(5) table. ie: relayhost = [gateway.my.domain], relayhost = uucphost, relayhost = [an.ip.add.ress].' },
{ label => N('Relay domains:'), val => \$o->{var}{wiz_relay_domains}, help => N('What destination domains (and subdomains thereof) this system will relay mail to. ie: mydomain.com') },
],
- complete => sub { if (!$o->{var}{wiz_relayhost}) { $::in->ask_warn(N('Error'), N('Need a relayhost.')); return 1; } else { return 0; }; },
+ complete => sub { if (!$o->{var}{wiz_relayhost}) { $in->ask_warn(N('Error'), N('Need a relayhost.')); return 1; } else { return 0; }; },
next => 'message_config',
},
network_config => {
@@ -216,7 +217,7 @@ $o->{pages} = {
{ label => N('my destination:'), val => \$o->{var}{wiz_mydestination}, help => N('The list of domains that are delivered via the $local_transport mail delivery transport. ie: $myhostname, localhost.$mydomain, /etc/postfix/destinations') },
{ label => N('my networks:'), val => \$o->{var}{wiz_mynetworks}, help => N('The list of trusted SMTP clients. ie: 127.0.0.0/32, 192.168.1.0/24') },
],
- complete => sub { if (!$o->{var}{wiz_mynetworks}) { $::in->ask_warn(N('Error'), N('This is the list of trusted SMTP clients. For security reason, please provide one. ie: 127.0.0.0/32, 192.168.1.0/24')); return 1; } else { return 0; }; },
+ complete => sub { if (!$o->{var}{wiz_mynetworks}) { $in->ask_warn(N('Error'), N('This is the list of trusted SMTP clients. For security reason, please provide one. ie: 127.0.0.0/32, 192.168.1.0/24')); return 1; } else { return 0; }; },
post => sub {
if ($o->{var}{wiz_type} == 1) {
return 'summary_main' ;