hosts = {{ salt['pillar.get']("model:postgres:host") }}
user = {{ salt['pillar.get']("model:postgres:user") }}
password = {{ salt['pillar.get']("model:postgres:password") }}
dbname = {{ salt['pillar.get']("model:postgres:database") }}
query = SELECT a.goto FROM alias_domain ad LEFT JOIN alias a ON a.domain = ad.target_domain WHERE ad.alias_domain = '%d' AND ad.active = true AND a.address = '%u' || '@' || ad.target_domain
