如何配置我的后缀以使用Outlook,Thunderbird

时间:2018-07-11 08:59:02

标签: postfix-mta

我有一个安装了Postfix的VPS,我想配置我的postfix和dovecot以供Outlook,邮件,Thunderbird或其他客户端使用,但是当我配置邮件时,我总是从smtp服务器收到消息”用户名或密码错误”或无法连接到此SMTP服务器...我尝试使用其他组合,请提出任何建议,对不起,但我是该领域的新手。

enter image description here

这是我的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

1 个答案:

答案 0 :(得分:0)

根据您的配置,您实际上尚未定义如何将SAS身份验证添加到后缀,仅允许SMTP连接使用SAS身份验证。

从我的postconf -n

smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot

我使用dovecot作为我的身份验证提供程序,您需要确保dovecot允许postfix查询身份验证请求-从dovecot配置中

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

中的示例
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'