Postfix + psql(验证问题)

时间:2015-10-30 18:36:07

标签: postgresql email postfix-mta

我遇到了后缀服务器配置问题但无法找到答案

我正在设置一个邮件服务器,因为我使用postfix像controller和postgresql来保存用户数据,我可以运行除pgsql连接之外的所有服务器配置。

连接数据库的用户是“app_postfix”,并且传递“ab_cd”(不是真正的密码)

我在文件pg_hba.conf中使用postgres的配置是下一个:

# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD
host    email           app_postfix     127.0.0.1/32            md5
host    email           app_courier     127.0.0.1/32            md5
host    email           app_sasl        127.0.0.1/32            md5

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5

Y paralaconexiónconla base de datos realizo lo siguiente,en el archivo de postfix: 对于与数据库的连接,我在main.cf中使用它:

virtual_mailbox_maps = pgsql:/etc/postfix/db/users.cf
virtual_maps = pgsql:/etc/postfix/db/aliases.cf

aliases.cf:

#hosts = 127.0.0.1
user = app_postfix
password = ab_cd
dbname = email
query = SELECT "email_local" FROM users_aliases WHERE "email_alias" = '%s'

users.cf:

#hosts = 127.0.0.1
user = app_postfix
password = ab_cd
dbname = email
query = SELECT "path_maildir" FROM users WHERE "email_local" = '%s' AND "user_active" = '1'

错误代码是这一个:

warning: connect to pgsql server localhost: FATAL:  password authentication failed for user "app_postfix"?FATAL:  password authentication failed for user "app_postfix"?

谢谢!

1 个答案:

答案 0 :(得分:0)

尽量不要在密码中使用#,$,!,(,)之类的特殊字符。

当我无法将postfix连接到postgres时,我发现的唯一解决方案是从我的密码中删除特殊字符。