【问题标题】:Dovecot is not locating messages in maildir, how to interpret debug log?Dovecot 不在 maildir 中定位消息,如何解释调试日志?
【发布时间】:2019-12-11 07:33:25
【问题描述】:

我正在 Ubuntu Server 18.04 上设置 Postfix 和 Dovecot。

使用 Telnet 测试设置,我能够使用所需的电子邮件名称登录,但测试未在关联帐户中找到任何电子邮件。据我所知,我的配置文件中有正确的mail_location 设置。

测试(来自 Dovecot 文档的 TestInstallation 页面)让用户登录,然后运行以下命令:

b select inbox

文档测试示例如果成功则显示以下预期结果,

b select inbox
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
* 1 EXISTS
* 1 RECENT
* OK [UIDVALIDITY 1106186941] UIDs valid
* OK [UIDNEXT 2] Predicted next UID
b OK [READ-WRITE] Select completed.

但我得到以下内容

b select inbox
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
* 0 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1575837513] UIDs valid
* OK [UIDNEXT 1] Predicted next UID
b OK [READ-WRITE] Select completed (0.001 + 0.000 secs).

我在/var/mail/vhosts/adonax.com/phil/new 中有六封电子邮件,包括在进行此测试之前发送和接收的一封(我使用cat 命令进行了验证)

以下是为会话生成的调试日志。

首先我登录并运行命令a login "phil@adonax.com" "fakepassword"

Dec 10 13:10:41 adonax dovecot: auth: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth
Dec 10 13:10:41 adonax dovecot: auth: Debug: Module loaded: /usr/lib/dovecot/modules/auth/lib20_auth_var_expand_crypt.so
Dec 10 13:10:41 adonax dovecot: auth: Debug: Read auth token secret from /var/run/dovecot/auth-token-secret.dat
Dec 10 13:10:41 adonax dovecot: auth: Debug: passwd-file /etc/dovecot/users: Read 2 users in 0 secs
Dec 10 13:10:41 adonax dovecot: auth: Debug: auth client connected (pid=10539)

到目前为止一切顺利,是吗?

其次,我运行测试命令b select inbox 并在日志文件中得到这个结果:

Dec 10 13:10:53 adonax dovecot: auth: Debug: client in: AUTH#0111#011PLAIN#011service=imap#011secured#011session=79iD8l+ZaJomADwBAADAPAA8kv/+k1+g#011lip=2600:3c01::f03c:92ff:fe93:5fa0#011rip=2600:3c01::f03c:92ff:fe93:5fa0#011lport=143#011rport=39528#011resp=AHBoaWxAYBRvbmFvbQBWtlNHmYB3b4LmN3Jk (previous base64 data may contain sensitive data)
Dec 10 13:10:53 adonax dovecot: auth: Debug: passwd-file(phil@adonax.com,2600:3c01::f03c:92ff:fe93:5fa0,<79iD8l+ZaJomADwBAADAPAA8kv/+k1+g>): lookup: user=phil@adonax.com file=/etc/dovecot/users
Dec 10 13:10:53 adonax dovecot: auth: Debug: client passdb out: OK#0111#011user=phil@adonax.com
Dec 10 13:10:53 adonax dovecot: auth: Debug: master in: REQUEST#0112679242753#01110539#0111#01118bfa959ad3d6d0c377ed53b2f0b3617#011session_pid=10541#011request_auth_token
Dec 10 13:10:53 adonax dovecot: auth: Debug: passwd-file(phil@adonax.com,2600:3c01::f03c:92ff:fe93:5fa0,<79iD8l+ZaJomADwBAADAPAA8kv/+k1+g>): lookup: user=phil@adonax.com file=/etc/dovecot/users
Dec 10 13:10:53 adonax dovecot: auth: Debug: master userdb out: USER#0112679242753#011phil@adonax.com#011uid=5000#011gid=5000#011home=/var/mail/vhosts/adonax.com/phil#011auth_token=04eb2747ef24bd23d6355aeb978ef361edbb48a3
Dec 10 13:10:53 adonax dovecot: imap-login: Login: user=<phil@adonax.com>, method=PLAIN, rip=2600:3c01::f03c:92ff:fe93:5fa0, lip=2600:3c01::f03c:92ff:fe93:5fa0, mpid=10541, secured, session=<79iD8l+ZaJomADwBAADAPAA8kv/+k1+g>

在没有完全理解上述内容的情况下,我确实看到我认为正确的“家庭”地址被正确指定为home=/var/mail/vhosts/adonax.com/phil 我可以“cd”到那个目录,它包含我认为是标准的子目录:

root@adonax:~# ls -al /var/mail/vhosts/adonax.com/phil
total 24
drwxr-sr-x 6 vmail vmail 4096 Dec  8 12:38 .
drwxr-sr-x 3 vmail vmail 4096 Dec  1 19:45 ..
drwx--S--- 2 vmail vmail 4096 Dec  2 23:44 cur
drwx--S--- 2 vmail vmail 4096 Dec 10 12:25 new
drwx--S--- 2 vmail vmail 4096 Dec 10 12:25 tmp
drwx--S--- 3 vmail vmail 4096 Dec  8 12:38 var

这是否与我的会话未吸引vmail 用户有关? (如果是,我将不得不回顾我用来设置的指南,了解他们如何以及为什么创建专门用于处理电子邮件的普通用户,以及是否正确完成。)

问题可能与我使用数据库而不是带有密码的简单文件的配置有关吗?我在下一行看到了 userdb 这个词。

Dec 10 13:10:53 adonax dovecot: auth: Debug: master userdb out: USER#0112679242753#011phil@adonax.com#011uid=5000#011gid=5000#011home=/var/mail/vhosts/adonax.com/phil#011auth_token=04eb2747ef24bd23d6355aeb978ef361edbb48a3

失败是否与搜索“收件箱”有关,而搜索应该是其他内容,或者我可能错过了未设置显式“收件箱”文件夹的步骤?

这里是来自10-mail.conf 的几行添加的内容(相关说明来自我正在使用的安装指南)。

 mail_location = maildir:~/var/mail/vhosts/adonax.com/phil
 passdb {
   driver = passwd-file
   args = username_format=%u /etc/dovecot/users
 }
 userdb {
   driver = static
   args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
 }

我在这里创建了一个很长的帖子,其中包含很多信息。我希望它主要与这个问题有关。我很高兴添加更多内容来回答后续问题。

【问题讨论】:

    标签: ubuntu-18.04 dovecot


    【解决方案1】:

    找到了!

    mail_location 设置的地址中有一个不应该有的 ~。

    基于此,它正在查找 /root/var/mail/... 而不是 /var/mail/...

    端口 143 上的 Telnet 测试现在可以工作了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-29
      • 2018-03-05
      • 2018-03-27
      • 1970-01-01
      相关资源
      最近更新 更多