`postfix` relays to local mailbox only if the RCPT TO domain can be
found in `$mydestination` and RCPT TO address can be found in
`$alias_maps`. This commit sets these variables to query the address
book.
--- /dev/null
+user = dovecot
+password =
+
+dbname = mail_db
+
+query = SELECT DISTINCT domain
+ FROM users
+ WHERE domain = '%s'
smtpd_tls_mandatory_ciphers = high
smtpd_tls_security_level = encrypt
+# SMTPd
+## Domain names of local (no forward) recipients.
+mydestination = pgsql:/etc/postfix/domains.cf
+## Addresses of local recipients.
+alias_maps = pgsql:/etc/postfix/address_book.cf
+## Deliver to dovecot.
mailbox_transport = lmtp:unix:private/dovecot-lmtp
# Message rewrite