Change data models for aliases in mail_system. REQUIRES MANUAL CHANGES TO DATA!

When matching an alias do no more match it against the value of field alias
in the aliases table, but match it against the concatenation of this value
with '@' and the value of the name field in the domains table, where the
row is obtained by matching aliases.alias_domain_id and domains.id.
This commit is contained in:
ibu radempa 2020-09-04 18:10:20 +02:00
parent 6604092800
commit a900d16b53

View file

@ -7,4 +7,4 @@ user = {{ mailserver.postgresql.username }}
password = {{ mailserver.postgresql.password }}
dbname = {{ mailserver.postgresql.dbname }}
hosts = {{ mailserver.postgresql.host }}
query = SELECT unnest(forwardings) FROM aliases WHERE alias = '%s'
query = SELECT unnest(a.forwardings) FROM aliases a JOIN domains d ON a.alias_domain_id=d.id WHERE a.alias || '@' || d.name = '%s'