Rolf wrote:
> The idea is that there are few users on this mail server, the
> mailertable sending everything onwards. But I would like msgs to
> [EMAIL PROTECTED] and a couple of others to be delivered to a local
> user. Virtusertable entry of [EMAIL PROTECTED] localusername
> doesn't seem to be working. And I would like that localusername in
> one instance to actually be an alias to several users elsewhere, and
> setting that up is not clear.
I don't redirect postmaster to multiple accounts, nor do I redirect it
off of the local machine, but I do redirect all postmaster/abuse mail
to [EMAIL PROTECTED] on the domain hosting box here.
In filter_sender, I make sure to accept postmaster/abuse/etc mails
(because I do other checks which would otherwise reject them):
# All domains MUST accept hostmaster/postmaster/abuse mail, which
# goes to [EMAIL PROTECTED], which goes to root
$recip =~ tr/<>//d;
$recip =~ tr/A-Z/a-z/;
if ($recip =~ /^(postmaster|hostmaster|abuse)\@/) {
return ('CONTINUE',"Postmaster/hostmaster/abuse mail OK");
}
Then in filter_end I delete the "[EMAIL PROTECTED]" recipients, and
replace them with [EMAIL PROTECTED]: (Watch for line wraps)
if (exists $hosteddomains{$Domain}) {
# Make sure postmaster and hostmaster email goes to our admin
# accounts
# Let's do abuse@ as well.
foreach $recip (@Recipients) {
$recip =~ tr/<>//d;
$recip =~ tr/A-Z/a-z/;
if ($recip =~ /^postmaster\@/) {
add_recipient('[EMAIL PROTECTED]');
delete_recipient($recip);
md_syslog('info',"Redirecting [EMAIL PROTECTED] to local postmaster");
}
if ($recip =~ /^hostmaster\@/) {
add_recipient('[EMAIL PROTECTED]');
delete_recipient($recip);
md_syslog('info',"Redirecting [EMAIL PROTECTED] to local postmaster");
}
if ($recip =~ /^abuse\@/) {
add_recipient('[EMAIL PROTECTED]');
delete_recipient($recip);
md_syslog('info',"Redirecting [EMAIL PROTECTED] to local postmaster");
}
}
} # if (exists($hosteddomains{$Domain}))
%hosteddomains is a tied hash which contains information about the
domains allowed to relay through the server; I needed it here to make
sure that *outbound* mail to postmasters elsewhere didn't get redirected
locally. :/ A global variable, or simple direct check against a list
of domains should work OK as well, or checking based on the relay IP
should work.
-kgd
--
"Sendmail administration is not black magic. There are legitimate
technical reasons why it requires the sacrificing of a live chicken."
- Unknown
_______________________________________________
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang