主题: iredmail 0.7.3 dovecot.log Permission denied

Sep 09 15:37:02 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)
Sep 09 15:37:02 IMAP(www@domain.com): Error: Sending log messages too fast, throttling..
Sep 09 15:37:03 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)
Sep 09 15:37:03 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)
Sep 09 15:37:03 IMAP(www@domain.com): Info: Disconnected: Logged out bytes=140/701
Sep 09 15:38:02 imap-login: Info: Login: user=<www@domain.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/.Sent/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/.Trash/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/.Drafts/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/.Junk/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir_parents(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir) failed: Permission denied
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir_parents(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir) failed: Permission denied
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir_parents(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir) failed: Permission denied
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir_parents(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir) failed: Permission denied
Sep 09 15:38:02 IMAP(www@domain.com): Error: mkdir_parents(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir) failed: Permission denied

回复: iredmail 0.7.3 dovecot.log Permission denied

bottle 写道:

Sep 09 15:37:02 IMAP(www@domain.com): Error: mkdir(///domain.com/w/w/w/www-2011.09.09.10.25.19//Maildir/cur) failed: Permission denied (euid=501(vmail) egid=502(vmail) missing +w perm: //)

Dovecot 在尝试建立 ///domain.com 这个目录,也就是 /domain.com,这肯定是没有权限的。
请检查一下你的 /etc/dovecot*.conf 设置,看看为何它会得到这个 maildir 路径。

另外:
*) 请不要在中文和英文论坛发重复的帖子。我会每天检查这两个论坛,所以只发一处即可。英文论坛的帖子会做删除处理,抱歉。
*) 发贴只粘贴日志,别人不清楚你想问什么问题。所以好歹把事情解释清楚。这样能得到更快速的解答。

3 最后由 bottle (2011-09-10 09:26:06) 编辑

回复: iredmail 0.7.3 dovecot.log Permission denied

您好:
感谢你的回复,我好象并没有在英文论坛发帖子,还他的地址也不知道在哪里,不知道为何。不过我给你发过一个邮件。
以下是关于此问题的/etc/dovecot*.conf配置内容(去除了注解):
# cat /etc/dovecot.conf

protocols = pop3 pop3s imap imaps managesieve
listen = *
mail_uid = 501
mail_gid = 502
first_valid_uid = 501
last_valid_uid = 501
log_path = /var/log/dovecot.log
mail_process_size = 1024
disable_plaintext_auth = no
login_process_per_connection=yes
auth_default_realm = domain.com
plugin {
    quota_warning = storage=85%% /usr/local/bin/dovecot-quota-warning.sh 85
    quota_warning2 = storage=90%% /usr/local/bin/dovecot-quota-warning.sh 90
    quota_warning3 = storage=95%% /usr/local/bin/dovecot-quota-warning.sh 95
}
ssl = yes
verbose_ssl = no
ssl_key_file = /etc/pki/tls/private/iRedMail.key
ssl_cert_file = /etc/pki/tls/certs/iRedMail_CA.pem
ssl_ca_file = /etc/pki/tls/certs/iRedMail_CA.pem
mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/
plugin {
    quota = dict:user::proxy::quotadict
    quota_rule = *:storage=0
}
dict {
    expire = db:/var/lib/dovecot/expire/expire.db
}
plugin {
    expire = Trash 7 Trash/* 7 Junk 30
    expire_dict = proxy::expire
    auth_socket_path = /var/run/dovecot/auth-master
}
plugin {
    sieve = /pathtovmail/sieve/%Ld/%Ln/dovecot.sieve
}
protocol lda {
    postmaster_address = root
    auth_socket_path = /var/run/dovecot/auth-master
    mail_plugins = quota sieve autocreate
    sieve_global_path = /pathtovmail/sieve/dovecot.sieve
    log_path = /var/log/sieve.log
}
protocol imap {
    mail_plugins = quota imap_quota autocreate
    imap_client_workarounds = tb-extra-mailbox-sep
}
protocol pop3 {
    mail_plugins = quota
    pop3_uidl_format = %08Xu%08Xv
    pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
}
auth default {
    mechanisms = plain login
    user = vmail
    passdb sql {
        args = /etc/dovecot-mysql.conf
    }
    userdb sql {
        args = /etc/dovecot-mysql.conf
    }
    socket listen {
        master {
            path = /var/run/dovecot/auth-master
            mode = 0666
            user = vmail
            group = vmail
        }
        client {
            path = /var/spool/postfix/dovecot-auth
            mode = 0666
            user = postfix
            group = postfix
        }
    }
}
plugin {
    autocreate = INBOX
    autocreate2 = Sent
    autocreate3 = Trash
    autocreate4 = Drafts
    autocreate5 = Junk
    autosubscribe = INBOX
    autosubscribe2 = Sent
    autosubscribe3 = Trash
    autosubscribe4 = Drafts
    autosubscribe5 = Junk
}
dict {
    quotadict = mysql:/etc/dovecot-used-quota.conf
}
namespace private {
    separator = /
    prefix =
    inbox = yes
}
namespace shared {
    separator = /
    prefix = Shared/%%u/
    location = maildir:/%%Lh/Maildir/:INDEX=/%%Lh/Maildir/Shared/%%u
    subscriptions = yes
    list = children
}
plugin {
    acl = vfile
    acl_shared_dict = proxy::acl
}
dict {
    acl = mysql:/etc/dovecot-share-folder.conf
}
protocol managesieve {
    listen = 127.0.0.1:4190 # 原端口安装后是 2000,与 pysieved冲突,所以这里改了
}
plugin {
    sieve = /pathtovmail/sieve/%Ld/%Ln/dovecot.sieve
    sieve_dir = /pathtovmail/sieve/%Ld/%Ln/
}

# cat /etc/dovecot-mysql.conf

driver = mysql
default_pass_scheme = CRYPT
connect = host=127.0.0.1 dbname=vmail user=vmail password=pwd
password_query = SELECT password FROM mailbox WHERE username='%u' AND active='1'
user_query = SELECT CONCAT(mailbox.storagebasedirectory, '/', mailbox.storagenode, '/', mailbox.maildir) AS home, CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule FROM mailbox,domain WHERE mailbox.username='%u' AND mailbox.domain='%d' AND mailbox.enable%Ls%Lc=1 AND mailbox.domain=domain.domain AND domain.backupmx=0 AND domain.active=1 AND mailbox.active=1

# cat /etc/dovecot-used-quota.conf

connect = host=127.0.0.1 dbname=vmail user=vmailadmin password=pwd
map {
    pattern = priv/quota/storage
    table = mailbox
    username_field = username
    value_field = bytes
}
map {
    pattern = priv/quota/messages
    table = mailbox
    username_field = username
    value_field = messages
}

# cat /etc/dovecot-share-folder.conf

connect = host=127.0.0.1 dbname=vmail user=vmailadmin password=pwd
map {
    pattern = shared/shared-boxes/user/$to/$from
    table = share_folder
    value_field = dummy

    fields {
        from_user = $from
        to_user = $to
    }
}
SELECT `username` , `domain` , `name` , `transport` , `rank` , `local_part` , `storagebasedirectory` , `storagenode` , `maildir`
FROM `mailbox`
WHERE username = 'service@domain.com'

结果为:
username='service@domain.com'
domain=domain.com
name=service
transport=''
rank=normal
local_part=service
storagebasedirectory=''
storagenode=''
maildir = service@domain.com/

4 最后由 bottle (2011-09-10 09:44:39) 编辑

回复: iredmail 0.7.3 dovecot.log Permission denied

问题找到了
storagebasedirectory=''
storagenode=''
数据库中这两项为空,不知道是为什么,我手动添加这两项内容后就OK了,
我的服务器是使用nginx+php+php-fpm+mysql,我怕ieadadmin不支持nginx下的web.py,所以没有安装ieadadmin,而是使用postfixadmin
看来postfixadmin在创建邮箱时并没有把storagebasedirectory,storagenode写入数据库。
但安装iredmail时的第一个账号应该对storagebasedirectory,storagenode进行设置的呀,事实上也没有,postmaster@domain.com的这两项也为空

现在,我是去改/etc/dovecot-mysql.conf中的sql还是去改postfixadmin呢,要怎样改才正确?
storagebasedirectory,storagenode, maildir分别是什么做为,是否可能随意设置,如:
storagebasedirectory=/vmail
storagenode=/user@domain.com
maildir=/store
或者
storagebasedirectory=''
storagenode=''
maildir=/vmail/user@domain.com/store

回复: iredmail 0.7.3 dovecot.log Permission denied

请注意您贴的 /etc/dovecot-mysql.conf 的内容,里面已经解释了 storagebasedirectory, storagenonde, maildir 的作用。
不要只是将日志、配置文件往论坛里一丢,应该自己分析一下。