Connect postfix to postgres
Connect postfix to postgres
cf. htps : // 우우키. 겐토오. 오 rg / u / / mp ぇ _ ゔ ぃ r ㄴ ㄴ
/etc/postfix/main.cf
#
# Settings required to support virtual mail delivery using lookups in
# the Postgres database.
#
# A list of all virtual domains serviced by this instance of postfix.
virtual_mailbox_domains = pgsql:/etc/postfix/pgsql/virtual_mailbox_domains.cf
# Look up the mailbox location based on the email address received.
virtual_mailbox_maps = pgsql:/etc/postfix/pgsql/virtual_mailbox_maps.cf
# Any aliases that are supported by this system
virtual_alias_maps = pgsql:/etc/postfix/pgsql/virtual_alias_maps.cf
/etc/postfix/pgsql/virtual_alias_maps.cfvirtual_alias_maps
# virtual_alias_maps.cf
user = postfix
password = $password
dbname = postfix
#hosts = localhost
query = SELECT goto FROM alias WHERE address='%s' AND active='1';
Run the query on the database to verify its output:
# psql -U postfix postfix
postfix=>SELECT goto FROM alias WHERE address='[email protected]' AND active='1';
goto
------------------
[email protected]
(1 row)
Make Postfix use this database mapping:
# postconf -e virtual_alias_maps=pgsql:/etc/postfix/pgsql/virtual_alias_maps.cf
Test if the mapping file works as expected:
# postmap -q [email protected] pgsql:/etc/postfix/pgsql/virtual_alias_maps.cf
Reference
이 문제에 관하여(Connect postfix to postgres), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/tkprof/items/3ba0a2bac889aadd4005텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)