无法使用 Postfix 和 Dovecot 在 Thunderbird 的收件箱中接收邮件

无法使用 Postfix 和 Dovecot 在 Thunderbird 的收件箱中接收邮件

我已安装 dovecot 和 postfix,并且它们运行正常。我使用 postfix 和 Dovecot 从 clientnorbert@clientnorbert-1-2 向服务器发送消息,使用在 Thunderbird 中设置的电子邮件 clientnorbert@ubuntumailsystem,在 postfix 中我创建了 ubuntumailsystem,因此我在 Thunderbid 中拥有 norbert@ubuntumailsystem 帐户。Postfix 在端口 25 上运行,dovecot 在端口 143 上运行。日志文件似乎没有问题,有状态发送。

2024-02-19T16:04:34.634091+00:00 ubuntuserver postfix/smtpd[14514]: connect from clientnorbert-1-2[192.168.1.21]
2024-02-19T16:04:34.671871+00:00 ubuntuserver postfix/smtpd[14514]: A4027E1FBA: client=clientnorbert-1-2[192.168.1.21], sasl_method=PLAIN, sasl_username=clientnorbert@ubuntumailsystem
2024-02-19T16:04:34.689052+00:00 ubuntuserver postfix/cleanup[14517]: A4027E1FBA: message-id=<0030a836-f965-488f-a802-c6a75347d83b@ubuntumailsystem>
2024-02-19T16:04:34.693262+00:00 ubuntuserver postfix/qmgr[14473]: A4027E1FBA: from=<clientnorbert@ubuntumailsystem>, size=577, nrcpt=1 (queue active)
2024-02-19T16:04:34.707728+00:00 ubuntuserver postfix/local[14475]: A4027E1FBA: to=<norbert@ubuntuserver>, orig_to=<norbert@ubuntumailsystem>, relay=local, delay=0.04, delays=0.03/0/0/0.01, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
2024-02-19T16:04:34.707934+00:00 ubuntuserver postfix/qmgr[14473]: A4027E1FBA: removed
2024-02-19T16:04:34.795140+00:00 ubuntuserver dovecot: imap(clientnorbert@ubuntumailsystem)<14047><8PbLNr4RbuvAqAEV>: Disconnected: Logged out in=828 out=2350 deleted=0 expunged=0 trashed=0 hdr_count=1 hdr_bytes=264 body_count=0 body_bytes=0
2024-02-19T16:04:34.814092+00:00 ubuntuserver dovecot: imap-login: Login: user=<clientnorbert@ubuntumailsystem>, method=PLAIN, rip=192.168.1.21, lip=192.168.1.16, mpid=14521, session=<FP31P74REOvAqAEV>
2024-02-19T16:14:20.220805+00:00 ubuntuserver postfix/local[15073]: warning: error looking up passwd info for clientnorbert: No such file or directory
2024-02-19T16:14:20.225083+00:00 ubuntuserver postfix/local[15074]: B8C66E1FBA: to=<clientnorbert@ubuntuserver>, orig_to=<clientnorbert@ubuntumailsystem>, relay=local, delay=531, delays=531/0.02/0/0.01, dsn=4.0.0, status=deferred (user lookup error)
2024-02-19T16:14:20.226011+00:00 ubuntuserver postfix/local[15074]: warning: error looking up passwd info for clientnorbert: No such file or directory
2024-02-19T16:14:20.228488+00:00 ubuntuserver postfix/local[15073]: F1ECDE1F86: to=<clientnorbert@ubuntumailsystem>, relay=local, delay=5515, delays=5515/0.03/0/0.01, dsn=4.0.0, status=deferred (user lookup error)
2024-02-19T16:14:20.229504+00:00 ubuntuserver postfix/local[15073]: warning: error looking up passwd info for clientnorbert: No such file or directory
2024-02-19T16:14:20.231247+00:00 ubuntuserver postfix/local[15074]: D18D7E2364: to=<clientnorbert@ubuntuserver>, orig_to=<clientnorbert@ubuntumailsystem>, relay=local, delay=1744, delays=1744/0.02/0/0.01, dsn=4.0.0, status=deferred (user lookup error)
2024-02-19T16:14:20.232401+00:00 ubuntuserver postfix/local[15074]: warning: error looking up passwd info for clientnorbert: No such file or directory
2024-02-19T16:14:20.233649+00:00 ubuntuserver postfix/local[15073]: C0031E1FAD: to=<clientnorbert@ubuntumailsystem>, relay=local, delay=4925, delays=4925/0.02/0/0, dsn=4.0.0, status=deferred (user lookup error)
2024-02-19T16:14:20.238131+00:00 ubuntuserver postfix/local[15074]: 70868E2099: to=<clientnorbert@ubuntumailsystem>, relay=local, delay=4861, delays=4861/0.03/0/0.01, dsn=4.0.0, status=deferred (user lookup error)
2024-02-19T16:14:20.448930+00:00 ubuntuserver postfix/postfix-script[15089]: stopping the Postfix mail system
2024-02-19T16:14:20.450704+00:00 ubuntuserver postfix/master[14470]: terminating on signal 15
2024-02-19T16:14:21.161298+00:00 ubuntuserver postfix/postfix-script[15416]: starting the Postfix mail system
2024-02-19T16:14:21.167916+00:00 ubuntuserver postfix/master[15418]: daemon started -- version 3.8.1, configuration /etc/postfix
2024-02-19T16:14:32.064544+00:00 ubuntuserver postfix/smtpd[15423]: connect from clientnorbert-1-2[192.168.1.21]
2024-02-19T16:14:32.104279+00:00 ubuntuserver postfix/smtpd[15423]: 196FEE2363: client=clientnorbert-1-2[192.168.1.21], sasl_method=PLAIN, sasl_username=clientnorbert@ubuntumailsystem
2024-02-19T16:14:32.109851+00:00 ubuntuserver postfix/cleanup[15428]: 196FEE2363: message-id=<33557326-1184-4c47-b588-179d7f5fed10@ubuntumailsystem>
2024-02-19T16:14:32.113821+00:00 ubuntuserver postfix/qmgr[15421]: 196FEE2363: from=<clientnorbert@ubuntumailsystem>, size=572, nrcpt=1 (queue active)
2024-02-19T16:14:32.130515+00:00 ubuntuserver postfix/local[15429]: 196FEE2363: to=<norbert@ubuntuserver>, orig_to=<norbert@ubuntumailsystem>, relay=local, delay=0.03, delays=0.02/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
2024-02-19T16:14:32.130753+00:00 ubuntuserver postfix/qmgr[15421]: 196FEE2363: removed
2024-02-19T16:14:32.208822+00:00 ubuntuserver dovecot: imap(clientnorbert@ubuntumailsystem)<14521><FP31P74REOvAqAEV>: Disconnected: Logged out in=976 out=3015 deleted=0 expunged=0 trashed=0 hdr_count=1 hdr_bytes=264 body_count=0 body_bytes=0
2024-02-19T16:14:32.224316+00:00 ubuntuserver dovecot: imap-login: Login: user=<clientnorbert@ubuntumailsystem>, method=PLAIN, rip=192.168.1.21, lip=192.168.1.16, mpid=15433, session=<rcCRY74RCKfAqAEV>
2024-02-19T16:14:38.067508+00:00 ubuntuserver dovecot: imap-login: Login: user=<clientnorbert@ubuntumailsystem>, method=PLAIN, rip=192.168.1.21, lip=192.168.1.16, mpid=15469, session=<yOrqY74RFqfAqAEV>

我的意思是警告:查找密码时出错,我应该通过在 postfix main.cf 中添加 virtual_alias_domains 和 virtual_alias_maps 来解决,这就是我所做的。

后配置-n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
compatibility_level = 3.6
home_mailbox = maildir:~/Maildir
inet_interfaces = all
inet_protocols = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = ubuntuserver.home, ubuntumailsystem, ubuntuserver, localhost.localdomain, localhost
mydomain = ubuntuserver
myhostname = ubuntumailsystem
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.1.0/24
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_tls_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
smtpd_tls_key_file = /etc/ssl/private/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
virtual_alias_domains = clientnorbert-1-2
virtual_alias_maps = hash:/etc/postfix/virtual

鸽舍-n

# 2.3.20 (80a5ac675d): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.5.20 (149edcf2)
# OS: Linux 6.5.0-17-generic x86_64 Ubuntu 23.10 
# Hostname: ubuntuserver
auth_verbose = yes
disable_plaintext_auth = no
mail_location = maildir:~/Maildir
passdb {
  args = /etc/dovecot/passwd
  driver = passwd-file
}
pop3_uidl_format = %g
protocols = pop3 imap
service auth {
   unix_listener /var/spool/postfix/private/auth {
   group = postfix
   mode = 0600
   user = postfix
}

} ssl = 无用户数据库 { args = uid=vmail gid=vmail home=/home/vmail/%u 驱动程序 = 静态 }

在我的别名中我有这个:

# See man 5 aliases for format
postmaster:    norbert
clamav: root
root: norbert@ubuntumailsystem

我的虚拟来自 postfix

norbert@ubuntumailsystem    norbert
clientnorbert@ubuntumailsystem  clientnorbert
clientnorbert@clientnorbert-1-2 clientnorbert

我的 dovecot 密码文件:

root@ubuntuserver:/etc/dovecot# cat passwd
norbert@ubuntumailsystem:{PLAIN}ubuntu::::::
clientnorbert@ubuntumailsystem:{PLAIN}ubuntu::::::

服务器 ubuntuserver 上的 Thunderbird 具有帐户 norbert@ubuntumailsystem,已配置 IMAP 邮件服务器 服务器名称:ubuntumailsystem 端口:143 连接安全性:无 身份验证方法:密码,不安全传输 传出服务器 SMTP 详细信息为: 服务器名称:ubuntumailsystem 端口:25 用户名:norbert@ubuntumailsystem 身份验证方法:密码,不安全传输连接安全性:无

clientnorbert-1-2 上的 Thunderbird 具有帐户 clientnorbert@ubuntumailsystem IMAP 邮件服务器 服务器名称:192.168.1.16 端口:143 用户名:clientnorbert@ubuntumailsystem 连接安全性:无 身份验证方法:密码,不安全传输 传出 SMTP 服务器 服务器名称:192.168.1.16 端口:25 用户名:clientnorbert@ubuntumailsystem 身份验证方法:密码,不安全传输 连接安全性:无

ubuntuserver(来自 postfix 的 ubuntumailsystem)与 norbert@ubuntumailsystem 是 192.168.1.16 clientnorbert-1-2 与 clientnorbert@ubuntumailsystem 是 192.168.1.21。

服务器是最新的 ubuntu 服务器版本。客户端是最新的 ubuntu 桌面版本。

可能是什么原因?SASL 机制配置不正确,dovecot LDA 或 dovecot SSL 未配置?


@Turdie

enter code here
2024-02-20T10:50:55.467018+00:00 ubuntuserver dovecot: imap-login: Disconnected: Connection closed: SSL_accept() failed: error:0A000412:SSL routines::sslv3 alert bad certificate: SSL alert number 42 (disconnected before auth was ready, waited 0 secs): user=<>, rip=127.0.0.1, lip=127.0.0.1, TLS handshaking: SSL_accept() failed: error:0A000412:SSL routines::sslv3 alert bad certificate: SSL alert number 42, session=<OAEV/M0Rkt9/AAAB>
2024-02-20T10:50:55.483192+00:00 ubuntuserver dovecot: imap-login: Disconnected: Connection closed: SSL_accept() failed: error:0A000412:SSL routines::sslv3 alert bad certificate: SSL alert number 42 (no auth attempts in 0 secs): user=<>, rip=127.0.0.1, lip=127.0.0.1, TLS handshaking: SSL_accept() failed: error:0A000412:SSL routines::sslv3 alert bad certificate: SSL alert number 42, session=<4EAV/M0Rlt9/AAAB>

2024-02-20T10:29:17.282520+00:00 ubuntuserver postfix/postfix-script[14635]: starting the Postfix mail system
2024-02-20T10:29:17.300091+00:00 ubuntuserver postfix/master[14637]: daemon started -- version 3.8.1, configuration /etc/postfix
2024-02-20T10:29:24.387122+00:00 ubuntuserver postfix/smtpd[14643]: connect from clientnorbert-1-2[192.168.1.21]
2024-02-20T10:29:24.401307+00:00 ubuntuserver postfix/smtpd[14643]: fatal: 127:0.0.1:8891: valid hostname or network address required
2024-02-20T10:29:25.391343+00:00 ubuntuserver postfix/master[14637]: warning: process /usr/lib/postfix/sbin/smtpd pid 14643 exit status 1
2024-02-20T10:29:25.391555+00:00 ubuntuserver postfix/master[14637]: warning: /usr/lib/postfix/sbin/smtpd: bad command startup -- throttling

我做了 github 教程中的所有事情。使用 STARTTLS 或 TLS/SSL 还是 None?身份验证方法 - passowrd,因为我使用 useradd 将 clientnorbert 添加到数据库,并使用 clientnorbert 的 passwd

我收到有关 ubuntuserver(我的邮件服务器)上的 TLS 错误,关于覆盖,tls 不接受。

答案1

仅尝试第一个 imap

apt-get install dovecot-core dovecot-imapd

disable_plaintext_auth = yes
mail_privileged_group = mail
mail_location = maildir:~/Maildir
#set mailbox location to Maildir style

userdb {
      driver = passwd
}

passdb {
     args = %s
     driver = pam
}

protocols = "imap"

namespace inbox {
  inbox = yes

  mailbox Trash {
    auto = subscribe
    special_use = \Trash
  }
  mailbox Sent {
    auto = subscribe
    special_use = \Sent
  }
  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Spam {
    auto = subscribe
    special_use = \Junk
  }
  mailbox Archive {
    auto = subscribe
    special_use = \Archive
  }
}
#create and autosubscribe to some default folders

service auth {
      unix_listener /var/spool/postfix/private/auth {
      mode = 0660
      user = postfix
      group = postfix
    }
}

ssl = required
ssl_cert = </path/to/cert/fullchain.pem
ssl_key = </path/to/cert/privkey.pem
#set your certificate

https://gist.github.com/howyay/57982e6ba9eedd3a5662c518f1b985c7


编辑

你的鸽舍好像缺少这个

namespace inbox {
  inbox = yes

  mailbox Trash {
    auto = subscribe
    special_use = \Trash
  }
  mailbox Sent {
    auto = subscribe
    special_use = \Sent
  }
  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Spam {
    auto = subscribe
    special_use = \Junk
  }
  mailbox Archive {
    auto = subscribe
    special_use = \Archive
  }
}
#create and autosubscribe to some default folders

相关内容