From e00efc0daf09e2c3078da363d9e25ee358c4357a Mon Sep 17 00:00:00 2001 From: Arnaud Desmons Date: Wed, 21 Aug 2002 15:45:15 +0000 Subject: fillfunc added --- postfix_wizard/scripts/Postfixconf.pm | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'postfix_wizard/scripts') diff --git a/postfix_wizard/scripts/Postfixconf.pm b/postfix_wizard/scripts/Postfixconf.pm index 03c5658e..52cc13f2 100644 --- a/postfix_wizard/scripts/Postfixconf.pm +++ b/postfix_wizard/scripts/Postfixconf.pm @@ -7,9 +7,27 @@ use MDK::Common; use strict; my $o = DrakconnectConf->new(); +my $wiz_domain_name = $o->get("DomainName"); +my $wiz_host_name = $o->get("SystemName"); + +sub get_mail_masquerade { + my $login = `logname`; + my $relayhost = `postconf -h relayhost`; + chomp($relayhost); + ($relayhost) = $relayhost =~ /.*\.(.*\..*)/; + !length $relayhost and $relayhost = $wiz_domain_name; + chomp($login); + "$login\@$relayhost"; +} + +sub get_mail_relay { + my $relayhost = `postconf -h relayhost`; + chomp $relayhost; + !length $relayhost and $relayhost = "smtp.$wiz_domain_name"; + $relayhost; +} sub do_it { - my $wiz_domain_name = $o->get("DomainName"); my $wiz_host_name = $o->get("SystemName"); my @conf = qw(/etc/postfix/aliases /etc/postfix/canonical @@ -38,7 +56,7 @@ sub do_it { my $canon = "\n\@$wiz_domain_name \@$ENV{wiz_mail_masquerade}"; my $t; foreach (cat_($file)) { - if (/^\s*(?!\#)\s*\@.*\@.*\@.*\..*/) { + if (/^\s*(?!\#)\s*\@.*\@.*\@.*/) { $t = $_; last; } -- cgit v1.2.1