[Postfix] Lookup credentials for user-specific sender transports
parent
4925487b44
commit
82f4f1fd15
|
@ -181,11 +181,31 @@ hosts = unix:/var/run/mysqld/mysqld.sock
|
||||||
dbname = ${DBNAME}
|
dbname = ${DBNAME}
|
||||||
query = SELECT CONCAT_WS(':', username, password) AS auth_data FROM relayhosts
|
query = SELECT CONCAT_WS(':', username, password) AS auth_data FROM relayhosts
|
||||||
WHERE id IN (
|
WHERE id IN (
|
||||||
SELECT relayhost FROM domain
|
SELECT COALESCE(
|
||||||
WHERE CONCAT('@', domain) = '%s'
|
(SELECT id FROM relayhosts
|
||||||
OR domain IN (
|
LEFT OUTER JOIN domain ON domain.relayhost = relayhosts.id
|
||||||
SELECT target_domain FROM alias_domain WHERE CONCAT('@', alias_domain) = '%s'
|
WHERE relayhosts.active = '1'
|
||||||
|
AND (domain.domain = '%d'
|
||||||
|
OR domain.domain IN (
|
||||||
|
SELECT target_domain FROM alias_domain
|
||||||
|
WHERE alias_domain = '%d'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(SELECT id FROM relayhosts
|
||||||
|
LEFT OUTER JOIN mailbox ON JSON_UNQUOTE(JSON_VALUE(mailbox.attributes, '$.relayhost')) = relayhosts.id
|
||||||
|
WHERE relayhosts.active = '1'
|
||||||
|
AND (
|
||||||
|
mailbox.username IN (
|
||||||
|
SELECT alias.goto from alias
|
||||||
|
JOIN mailbox ON mailbox.username = alias.goto
|
||||||
|
WHERE alias.active = '1'
|
||||||
|
AND alias.address = '%s'
|
||||||
|
AND alias.address NOT LIKE '@%%'
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
AND active = '1'
|
AND active = '1'
|
||||||
AND username != '';
|
AND username != '';
|
||||||
|
|
|
@ -290,7 +290,7 @@ services:
|
||||||
- dovecot
|
- dovecot
|
||||||
|
|
||||||
postfix-mailcow:
|
postfix-mailcow:
|
||||||
image: mailcow/postfix:1.65
|
image: mailcow/postfix:1.66
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql-mailcow
|
- mysql-mailcow
|
||||||
volumes:
|
volumes:
|
||||||
|
|
Loading…
Reference in New Issue