大网数据广告活动
服务器运维问答

Dovecot can't see user home dir

· 52CE 我爱测

I'm testing my Dovecot configuration with mutt but without success. I have user [email omitted] , I created home directory for him with maildirmake.dovecot command. But Dovecot cant cd to home directory even if I set 0777 permiss…

问题原文

原帖链接 · QkiZ · CC BY-SA 3.0

I'm testing my Dovecot configuration with mutt but without success. I have user [email omitted], I created home directory for him with maildirmake.dovecot command. But Dovecot cant cd to home directory even if I set 0777 permissions on that home dir.

Error log:

imap([email omitted]): Error: chdir(/var/spool/mail/mailboxes/example.com/user) failed: No such file or directory
imap([email omitted]): Debug: Effective uid=5000, gid=5000, home=/var/spool/mail/mailboxes/example.com/user, chroot=/var/tmp/vmail_chroot/
imap([email omitted]): Debug: Home dir not found: /var/spool/mail/mailboxes/example.com/user
imap([email omitted]): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/var/spool/mail/mailboxes/example.com/user:LAYOUT=fs
imap([email omitted]): Debug: fs: root=/var/spool/mail/mailboxes/example.com/user, index=, indexpvt=, control=, inbox=/var/spool/mail/mailboxes/example.com/user, alt=
imap([email omitted]): Debug: Namespace : /var/spool/mail/mailboxes/example.com/user doesn't exist yet, using default permissions
imap([email omitted]): Debug: Namespace : Using permissions from /var/spool/mail/mailboxes/example.com/user: mode=0700 gid=default
imap([email omitted]): Error: user [email omitted]: Initialization failed: Namespace '': mkdir(/var/spool/mail/mailboxes/example.com/user) failed: Permission denied (euid=5000(<getpwuid() error>) egid=5000(<getgrgid() error>))
imap([email omitted]): Error: Invalid user settings. Refer to server log for more information.

Dovecot config:

# 2.2.9: /etc/dovecot/dovecot.conf
# OS: Linux 3.13.0-55-generic x86_64 Ubuntu 14.04.3 LTS ext4
auth_debug = yes
auth_debug_passwords = yes
auth_mechanisms = login digest-md5 cram-md5
auth_verbose = yes
first_valid_gid = 5000
first_valid_uid = 5000
last_valid_gid = 5000
last_valid_uid = 5000
mail_chroot = /var/tmp/vmail_chroot/
mail_debug = yes
mail_location = maildir:/var/spool/mail/mailboxes/%d/%n:LAYOUT=fs
mailbox_list_index = yes
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 = 
  type = private
}
passdb {
  args = scheme=CRYPT username_format=%u /etc/dovecot/users
  driver = passwd-file
}
plugin {
  quota_rule = *:storage=100M
}
protocols = " imap lmtp pop3"
service auth-worker {
  user = $default_internal_user
}
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0666
    user = postfix
  }
}
service imap-login {
  inet_listener imap {
    port = 0
  }
  inet_listener imaps {
    port = 993
    ssl = yes
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0600
    user = postfix
  }
}
service pop3-login {
  inet_listener pop3 {
    port = 0
  }
  inet_listener pop3s {
    port = 995
    ssl = yes
  }
}
ssl_cert = </etc/ssl/certs/x.example.com.pem
ssl_key = </etc/ssl/private/example.com.key
ssl_protocols = !SSLv2 !SSLv3
userdb {
  args = username_format=%u /etc/dovecot/users
  driver = passwd-file
}

已采纳解答

原帖链接 · QkiZ · CC BY-SA 3.0

When I run doveadm user [email omitted] I got:

field   value
uid 5000
gid 5000
home    /var/tmp/vmail_chroot//home/vmail/example.com/user
mail    sdbox:~/sdbox

There is no directory like /var/tmp/vmail_chroot//home/vmail/example.com/user

Line mail_chroot = /var/tmp/vmail_chroot/ brokes config. After disabling it everything works fine.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-02-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。