Jean-Philippe Pialasse abba39ab3c * Fri Dec 20 2024 Jean-Philippe Pialasse <jpp@koozali.org> 1.0-7.sme
- fix catch-all behaviour [SME: 12382]
  myorigin now is hostname
  in case email sent outside by deamon generic rewrite occurs
2024-12-20 00:36:26 -05:00

18 lines
724 B
Plaintext

{
return "" ; #not used
# as we might have virtualdomains we prefer this over luser_relay
return "# we bounce all unknown address $EmailUnknownUser not set or equal to returntosender " unless (defined $EmailUnknownUser and $EmailUnknownUser ne 'returntosender');
$OUT = "catch-all";
my $i = 0;
use esmith::DomainsDB;
my $ddb = esmith::DomainsDB->open_ro;
my @domains = map { $_->key } $ddb->get_all_by_prop('type' => 'domain');
foreach my $domain ( @domains )
{
my $d = $ddb->get($domain);
next if (($d->prop('VirtualMail') || "disabled") eq "enabled");
next unless (($d->prop('MailServer') || '') eq '');
$OUT .= "\@$domain $EmailUnknownUser\n";
}
}