* 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
This commit is contained in:
2024-12-20 00:36:26 -05:00
parent de44e4000a
commit abba39ab3c
14 changed files with 54 additions and 14 deletions

View File

@@ -0,0 +1,2 @@
#change myorigin to local domain for outgoing emails
@{$SystemName} @{$DomainName}

View File

@@ -1,2 +1,7 @@
myorigin = $mydomain
{
# do not put a domain that will be used to recieve emails there
# if you do so you will lose email with the virtual rewriting process.
# this will complete local sent email and virtual right hands
}# do not put real domain there to avoid loop, or catch-all issues
myorigin = $myhostname
append_at_myorigin = yes

View File

@@ -1,5 +1,5 @@
{
# qmail compatibility - instead of +
# default empty
}
recipient_delimiter = -
}recipient_delimiter = -
expand_owner_alias = yes

View File

@@ -1,5 +1,5 @@
# SME Primary domain and host: looks up all recipients in /etc/passwd and /etc/aliases
mydestination = $myhostname $mydomain $myhostname.$mydomain localhost.$mydomain localhost {
mydestination = $myorigin $myhostname $mydomain $myhostname.$mydomain localhost.$mydomain localhost {
$OUT = " ";
my $i = 0;
use esmith::DomainsDB;

View File

@@ -1,7 +1,5 @@
{
# we use the value of EmailUnknownUser (default to returntosender)
# this option night ignore all virtual_maps entries... like pseudonyms and groups in case of virtual domain
# see /etc/e-smith/templates//etc/postfix/virtual/95unknownusers
#return "# we bounce all unknown address $EmailUnknownUser not set or equal to returntosender " unless (defined $EmailUnknownUser and $EmailUnknownUser ne 'returntosender');
#$OUT ="luser_relay = $EmailUnknownUser";
}# if enabled, we catch all unknown users in virtual
return "# we bounce all unknown address $EmailUnknownUser not set or equal to returntosender " unless (defined $EmailUnknownUser and $EmailUnknownUser ne 'returntosender');
$OUT ="luser_relay = $EmailUnknownUser";
}

View File

@@ -1 +1 @@
smtp_helo_name = { $qpsmtpd{HeloHost} || '$myhostname'}
smtp_helo_name = { $qpsmtpd{HeloHost} || '$mydomain' }

View File

@@ -0,0 +1,2 @@
# rewrite addresse of outgoing emails
smtp_generic_maps = hash:/etc/postfix/generic

View File

@@ -15,7 +15,6 @@ root admin
for my $acct ($adb->get_all_by_prop(type=>"system"))
{
next if ($acct->key eq "admin");
next if ($acct->key eq "alias");
next if ($acct->key eq "shared");
next if ($acct->key eq "root");

View File

@@ -1,2 +1,19 @@
# SME users
# not needed postfix will map all system users directly
{
my $dms = $DelegateMailServer;
return "# DelegateMailServer is set" if ($dms && ($dms !~ /^\s*$/));
$OUT = "";
use esmith::AccountsDB;
my $adb = esmith::AccountsDB->open_ro or die "Couldn't open AccountsDB";
for my $user ($adb->users)
{
#next unless ($pseudo->key =~ /@/); <== aliase to emails or catch-all @domain.com are ok
$OUT .= $user->key . "\t\t\t".$user->key."\n";
}
}

View File

@@ -1,7 +1,8 @@
{
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 = "";
$OUT = "catch-all";
my $i = 0;
use esmith::DomainsDB;
my $ddb = esmith::DomainsDB->open_ro;