因此,我在 Ubuntu Server 16.04 上完成了 Postfix 和 Dovecot 的基本安装,但在使用 Thunderbird 设置/登录我的帐户时遇到了麻烦。
按照本指南中的步骤 1-5 安装 Postfix: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-on-ubuntu-16-04 通过以下链接安装 Dovecot:https://help.ubuntu.com/community/Dovecot
我从 Thunderbird 收到的错误是“无法验证配置 - 用户名或密码是否错误?”。当我查看 syslog、auth.log 和 mail.log 时,我无法看到登录失败的原因和位置。Mail.err 也不包含任何详细信息。
如果我运行“postconf -n”,我会得到以下结果:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 104857600
mydestination = $myhostname, example.com, mail.example.com, localhost.example.com, localhost
myhostname = localhost.localdomain
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = hash:/etc/postfix/virtual
如果我运行“dovecot -n”,我会得到以下结果:
# 2.2.22 (fe789d2): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.13 (7b14904)
# OS: Linux 4.4.0-93-generic x86_64 Ubuntu 16.04.3 LTS
mail_location = maildir:~/Maildir
namespace inbox {
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
passdb {
driver = pam
}
protocols = imap
service imap-login {
inet_listener imaps {
port = 993
ssl = yes
}
}
ssl_cert = </etc/ssl/certs/ssl-cert-snakeoil.pem
ssl_key = </etc/ssl/private/ssl-cert-snakeoil.key
userdb {
driver = passwd
}
如果我运行“telnet localhost imap2”,然后运行 A1 LOGIN 用户名密码,我会得到以下结果:
anders@toshiban:~$ telnet localhost imap2
Trying ::1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN] Dovecot ready.
A1 LOGIN anders password
A1 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SPECIAL-USE] Logged in
e logout
* BYE Logging out
e OK Logout completed.
Connection closed by foreign host.
请让我知道我是否可以对这个问题添加任何内容,以帮助您帮我解决这个问题。
致以最诚挚的问候 Anders
答案1
使用 imap.example.com 和 smtp.example.com 的正确设置更新了我的 DNS,并使其正常工作。