Dovecot 连接 imap/pop3 问题

Dovecot 连接 imap/pop3 问题

我刚刚在 Linux(最新的 Debian)上安装了 postfix/dovecot,我已经设置了 starttls。我尝试通过 imap 或 pop3 连接 thunderbird,但我收不到邮件... thunderbird 上没有错误消息,一切似乎都正常,在服务器端我找不到能给我提供有用信息的日志...请问我该如何继续了解哪里出了问题?

一些日志:

邮件信息:

Feb 14 10:23:21 ns403668 postfix/smtpd[7324]: connect from AStrasbourg-151-1-41-254.w83-194.abo.wanadoo.fr[83.194.225.254]
Feb 14 10:23:21 ns403668 postfix/smtpd[7328]: connect from AStrasbourg-151-1-41-254.w83-194.abo.wanadoo.fr[83.194.225.254]
Feb 14 10:23:21 ns403668 postfix/smtpd[7324]: lost connection after CONNECT from AStrasbourg-151-1-41-254.w83-194.abo.wanadoo.fr[83.194.225.254]
Feb 14 10:23:21 ns403668 postfix/smtpd[7324]: disconnect from AStrasbourg-151-1-41-254.w83-194.abo.wanadoo.fr[83.194.225.254]
Feb 14 10:23:21 ns403668 postfix/smtpd[7328]: lost connection after CONNECT from AStrasbourg-151-1-41-254.w83-194.abo.wanadoo.fr[83.194.225.254]
Feb 14 10:23:21 ns403668 postfix/smtpd[7328]: disconnect from AStrasbourg-151-1-41-254.w83-194.abo.wanadoo.fr[83.194.225.254]

dovecot.log:

2014-02-14 10:35:18 lda(root): Error: user root: Initialization failed: Initializing mail storage from mail_location setting failed: stat(/root/Maildir) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Fatal: Invalid user settings. Refer to server log for more information.
2014-02-14 10:35:18 lda(root): Error: chdir(/root/) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Error: chdir(/root) failed: Permission denied
2014-02-14 10:35:18 lda(root): Error: user root: Initialization failed: Initializing mail storage from mail_location setting failed: stat(/root/Maildir) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Fatal: Invalid user settings. Refer to server log for more information.
2014-02-14 10:35:18 lda(root): Error: chdir(/root/) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Error: chdir(/root) failed: Permission denied
2014-02-14 10:35:18 lda(root): Error: user root: Initialization failed: Initializing mail storage from mail_location setting failed: stat(/root/Maildir) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Fatal: Invalid user settings. Refer to server log for more information.
2014-02-14 10:35:18 lda(root): Error: chdir(/root/) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Error: chdir(/root) failed: Permission denied
2014-02-14 10:35:18 lda(root): Error: user root: Initialization failed: Initializing mail storage from mail_location setting failed: stat(/root/Maildir) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Fatal: Invalid user settings. Refer to server log for more information.
2014-02-14 10:35:18 lda(root): Error: chdir(/root/) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Error: chdir(/root) failed: Permission denied
2014-02-14 10:35:18 lda(root): Error: user root: Initialization failed: Initializing mail storage from mail_location setting failed: stat(/root/Maildir) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)
2014-02-14 10:35:18 lda(root): Fatal: Invalid user settings. Refer to server log for more information.

Dovecot 信息日志:

2014-02-14 07:53:39 pop3-login: Info: Disconnected (no auth attempts in 59 secs): user=<>, rip=186.215.187.166, lip=135.189.135.219, session=<orsNRFjyKAC617um>
2014-02-14 07:53:40 pop3-login: Info: Aborted login (auth failed, 1 attempts in 19 secs): user=<admin>, method=PLAIN, rip=186.215.187.166, lip=135.189.135.219, session=<Fvj+QljyjwC617um>
2014-02-14 07:53:44 pop3-login: Info: Aborted login (auth failed, 1 attempts in 19 secs): user=<admin>, method=PLAIN, rip=186.215.187.166, lip=135.189.135.219, session=<xJo3Q1jyMQC617um>
2014-02-14 07:53:48 pop3-login: Info: Aborted login (auth failed, 1 attempts in 19 secs): user=<admin>, method=PLAIN, rip=186.215.187.166, lip=135.189.135.219, session=<Q7ZvQ1jyxgC617um>
2014-02-14 07:53:51 pop3-login: Info: Aborted login (auth failed, 1 attempts in 19 secs): user=<admin>, method=PLAIN, rip=186.215.187.166, lip=135.189.135.219, session=<jxuoQ1jy7gC617um>
2014-02-14 07:53:55 pop3-login: Info: Aborted login (auth failed, 1 attempts in 19 secs): user=<admin>, method=PLAIN, rip=186.215.187.166, lip=135.189.135.219, session=<FhTgQ1jyNAC617um>
2014-02-14 10:20:47 lda(service.conception-site-web): Info: msgid=<[email protected]>: saved mail to INBOX
2014-02-14 10:23:21 pop3-login: Info: Aborted login (no auth attempts in 0 secs): user=<>, rip=83.194.225.254, lip=135.189.135.219, session=<Nc1lW1ryzQBTwuH+>
2014-02-14 10:23:21 imap-login: Info: Aborted login (no auth attempts in 0 secs): user=<>, rip=83.194.225.254, lip=135.189.135.219, session=<NdNlW1ryyQBTwuH+>
2014-02-14 10:23:21 pop3-login: Info: Aborted login (no auth attempts in 0 secs): user=<>, rip=83.194.225.254, lip=135.189.135.219, session=<sN5lW1ry0gBTwuH+>
2014-02-14 10:23:21 imap-login: Info: Aborted login (no auth attempts in 0 secs): user=<>, rip=83.194.225.254, lip=135.189.135.219, session=<iBtmW1ry0ABTwuH+>

我的 dovecot.conf:

# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 3.10.9-xxxx-grs-ipv6-64 x86_64
auth_mechanisms = plain login
base_dir = /var/run/dovecot/
disable_plaintext_auth = no
info_log_path = /var/log/dovecot/dovecot-info.log
log_path = /var/log/dovecot/dovecot.log
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_location = maildir:~/Maildir
passdb {
  args = failure_show_msg=yes
  driver = pam
}
plugin {
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/.Sieve
}
protocols = imap pop3
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-master {
    mode = 0666
  }
}
service imap-login {
  executable = /usr/lib/dovecot/imap-login
  inet_listener imap {
    address = 135.189.135.219
    port = 143
  }
  inet_listener imaps {
    address = 135.189.135.219
    port = 993
  }
}
service imap {
  executable = /usr/lib/dovecot/imap
}
service pop3-login {
  executable = /usr/lib/dovecot/pop3-login
  inet_listener pop3 {
    address = *
    port = 110
  }
  inet_listener pop3s {
    address = *
    port = 995
  }
}
service pop3 {
  executable = /usr/lib/dovecot/pop3
}
ssl_ca = </etc/dovecot/ssl_keys/ca.crt
ssl_cert = </etc/dovecot/ssl_keys/imap.crt
ssl_cipher_list = ALL:!LOW:!SSLv2
ssl_key = </etc/dovecot/ssl_keys/imap.key
userdb {
  driver = passwd
}
verbose_ssl = yes
protocol imap {
  imap_logout_format = bytes ( in=%i : out=%o )
  mail_plugin_dir = /usr/lib/dovecot/imap
}
protocol pop3 {
  mail_plugin_dir = /usr/lib/dovecot/pop3
  pop3_enable_last = no
  pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s
}

答案1

你的问题是这样的:

mail_location = maildir:~/Maildir

在您的情况下,Dovecot 以 nobody:nogroup 的身份运行,并且该用户无法更改为 /root(无论如何都应该如此)。

2014-02-14 10:35:18 lda(root): Error: chdir(/root/) failed: Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +x perm: /root, dir owned by 0:0 mode=0700)

您不应该直接将电子邮件发送给用户“root”,而是使用别名并将其直接发送到机器上的用户帐户。查看文档以了解如何执行此操作。

说实话,整个方法有点过时,除非您打算将该服务器用于测试目的或只是为了好玩。

相关内容