Merge pull request #4703 from devops-ansible/master

Improve send-as behaviour
This commit is contained in:
Niklas Meyer 2022-09-27 15:39:53 +02:00 committed by GitHub
commit 8e0b1d8aee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View File

@ -323,7 +323,19 @@ hosts = unix:/var/run/mysqld/mysqld.sock
dbname = ${DBNAME} dbname = ${DBNAME}
# First select queries domain and alias_domain to determine if domains are active. # First select queries domain and alias_domain to determine if domains are active.
query = SELECT goto FROM alias query = SELECT goto FROM alias
WHERE address='%s' WHERE id IN (
SELECT COALESCE (
(
SELECT id FROM alias
WHERE address='%s'
AND (active='1' OR active='2')
), (
SELECT id FROM alias
WHERE address='@%d'
AND (active='1' OR active='2')
)
)
)
AND active='1' AND active='1'
AND (domain IN AND (domain IN
(SELECT domain FROM domain (SELECT domain FROM domain
@ -354,7 +366,7 @@ query = SELECT goto FROM alias
WHERE alias_domain.alias_domain = '%d' WHERE alias_domain.alias_domain = '%d'
AND mailbox.username = CONCAT('%u','@',alias_domain.target_domain) AND mailbox.username = CONCAT('%u','@',alias_domain.target_domain)
AND (mailbox.active = '1' OR mailbox.active ='2') AND (mailbox.active = '1' OR mailbox.active ='2')
AND alias_domain.active='1' AND alias_domain.active='1';
EOF EOF
# MX based routing # MX based routing

View File

@ -295,7 +295,7 @@ services:
- dovecot - dovecot
postfix-mailcow: postfix-mailcow:
image: mailcow/postfix:1.67 image: mailcow/postfix:1.68
depends_on: depends_on:
- mysql-mailcow - mysql-mailcow
volumes: volumes: