问题描述
我有一个安装了Postfix的VPS,并且我想配置我的postfix和dovecot以供Outlook,邮件,雷鸟或其他客户端使用,但是当我配置邮件时,我总是从smtp服务器收到消息"用户名或密码错误"或无法连接到此SMTP服务器...我尝试使用其他组合,请提出任何建议,对不起,但我是该领域的新手.
I have a VPS with postfix installed and i want to configure my postfix and dovecot to be used by a client like outlook, mail, thunderbird or other, but when i configure my mail i always receive the message from the smtp server "username o password is incorrect" or Cannot connect to this SMTP server...i tried using different combinations, please any suggestion, sorry but i'm new in this area.
这是我的postfix.conf
this is my postfix.conf
# TLS parameters
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mail.kitlearn.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, mail.kitlearn.com, localhost.kitlearn.com, , localhost,kitlearn.com,brinapptics.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 189.180.0.0/16
mailbox_size_limit = 0
recipient_delimiter = +
inet_protocols = all
virtual_alias_maps = hash:/etc/postfix/virtual
sender_bcc_maps = hash:/etc/postfix/bcc
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtp_tls_security_level = may
allow_percent_hack = no
mynetworks_style = subnet
relayhost = [mail.kitlearn.com]:587
推荐答案
根据您的配置,您实际上尚未定义如何对postfix进行ssl身份验证,仅允许SMTP连接使用sasl auth.
Based on your config you haven't actually defined how to sasl auth to postfix, only that sasl auth is allowed for SMTP connections.
从我的postconf -n
From my postconf -n
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
我使用dovecot作为我的身份验证提供程序,您需要确保dovecot允许postfix查询身份验证请求-从dovecot配置中
I'm using dovecot as my auth provider, you need to make sure dovecot is allowing postfix to query for auth requests -- From dovecot config
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0666
user = postfix
}
unix_listener auth-client {
group = postfix
mode = 0660
user = postfix
}
unix_listener auth-master {
group = vmail
mode = 0660
user = vmail
}
unix_listener auth-userdb {
mode = 0600
user = vmail
}
user = dovecot
}
userdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
然后,您需要进行身份验证配置,我的操作是通过mysql表-来自/etc/dovecot/dovecot-sql.conf.ext
Then you need to have the auth configuration, mine is through a mysql table -- Example from /etc/dovecot/dovecot-sql.conf.ext
driver = mysql
connect = host=localhost dbname=postfixadmin user=postfixadmin password=postfixadmin
default_pass_scheme = MD5-CRYPT
password_query = SELECT username as user, password, '/home/vmail/%d/%n' as userdb_home, 'maildir:/home/vmail/%d/%n' as userdb_mail, 150 as userdb_uid, 8 as userdb_gid FROM mailbox WHERE username = '%u' AND active = '1'
user_query = SELECT '/home/vmail/%d/%n' as home, 'maildir:/home/vmail/%d/%n' as mail, 2000 AS uid, 2000 AS gid, CONCAT('*:storage=',round(quota/1024)) AS quota_rule FROM mailbox WHERE username = '%u' AND active = '1'
这篇关于如何配置我的后缀以使用Outlook,Thunderbird的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!