1 最后由 rain6966 (2013-07-18 18:35:57) 编辑

主题: How to enable Dovecot Master User

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.8.5
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):OpenLDAP
- 使用的 Linux/BSD 发行版名称及版本号:CentOs6.4
- 与您的问题相关的日志信息:
====
Hi ,張'R
1).我按照此處的文檔試作,不知是哪裡出錯, 無法成功:
http://iredmail.org/wiki/index.php?titl … aster.User

2).錯誤訊息 及其他設定:
dovecot.log如下:

Jul 18 18:05:41 auth: Debug: Loading modules from directory: /usr/lib64/dovecot/auth
Jul 18 18:05:41 auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libauthdb_ldap.so
Jul 18 18:05:41 auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
Jul 18 18:05:41 auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_pgsql.so
Jul 18 18:05:41 auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
Jul 18 18:05:41 auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libmech_gssapi.so
Jul 18 18:05:41 auth: Error: Error in configuration file /etc/dovecot/dovecot-ldap.conf line 21: Unknown setting: user_query
Jul 18 18:05:41 master: Error: service(auth): command startup failed, throttling
Jul 18 18:05:41 log: Error: service(auth): child 2371 returned error 89 (Fatal failure)

dovecot-ldap.conf 內容如下:
第21行

# add master can  accessing other's mailbox
user_query = mail=aaaaadmin

doveconf -n 的內容:

# 2.0.21: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-358.el6.x86_64 x86_64 CentOS release 6.4 (Final)
auth_debug = yes
auth_debug_passwords = yes
auth_master_user_separator = *
auth_mechanisms = PLAIN LOGIN
auth_verbose = yes
dict {
  acl = mysql:/etc/dovecot/dovecot-share-folder.conf
  quotadict = mysql:/etc/dovecot/dovecot-used-quota.conf
}
first_valid_uid = 2000
last_valid_uid = 2000
listen = *
log_path = /var/log/dovecot.log
mail_debug = yes
mail_gid = 2000
mail_location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/
mail_plugins = quota
mail_uid = 2000
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave
namespace {
  inbox = yes
  location = maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/
  prefix =
  separator = /
  subscriptions = yes
  type = private
}
namespace {
  list = children
  location = maildir:/%%Lh/Maildir/:INDEX=/%%Lh/Maildir/Shared/%%u
  prefix = Shared/%%u/
  separator = /
  type = shared
}
passdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
}
passdb {
  args = /etc/dovecot/dovecot-master-user-password
  driver = passwd-file
  master = yes
}
plugin {
  acl = vfile
  acl_shared_dict = proxy::acl
  auth_socket_path = /var/run/dovecot/auth-master
  autocreate = INBOX
  autocreate2 = Sent
  autocreate3 = Trash
  autocreate4 = Drafts
  autocreate5 = Junk
  autosubscribe = INBOX
  autosubscribe2 = Sent
  autosubscribe3 = Trash
  autosubscribe4 = Drafts
  autosubscribe5 = Junk
  expire = Trash 7 Trash/* 7 Junk 30
  expire_dict = proxy::expire
  quota = dict:user::proxy::quotadict
  quota_rule = *:storage=1G
  quota_warning = storage=85%% quota-warning 85 %u
  quota_warning2 = storage=90%% quota-warning 90 %u
  quota_warning3 = storage=95%% quota-warning 95 %u
  sieve = /%Lh/sieve/dovecot.sieve
  sieve_dir = /%Lh/sieve
  sieve_global_dir = /var/vmail/sieve
  sieve_global_path = /var/vmail/sieve/dovecot.sieve
}
protocols = pop3 imap sieve
service auth {
  unix_listener /var/spool/postfix/dovecot-auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-master {
    group = vmail
    mode = 0666
    user = vmail
  }
  unix_listener auth-userdb {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service dict {
  unix_listener dict {
    group = vmail
    mode = 0660
    user = vmail
  }
}
service imap-login {
  process_limit = 500
  service_count = 1
}
service pop3-login {
  service_count = 1
}
service quota-warning {
  executable = script /usr/local/bin/dovecot-quota-warning.sh
  unix_listener quota-warning {
    group = vmail
    mode = 0660
    user = vmail
  }
}
ssl = required
ssl_cert = </etc/pki/tls/certs/iRedMail_CA.pem
ssl_key = </etc/pki/tls/private/iRedMail.key
userdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
}
protocol lda {
  auth_socket_path = /var/run/dovecot/auth-master
  lda_mailbox_autocreate = yes
  log_path = /var/log/sieve.log
  mail_plugins = quota sieve autocreate acl
  postmaster_address = root
}
protocol imap {
  imap_client_workarounds = tb-extra-mailbox-sep
  mail_plugins = quota  imap_quota autocreate expire acl imap_acl
}
protocol pop3 {
  mail_plugins = quota
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
  pop3_uidl_format = %08Xu%08Xv
}

3).Dovecot是有開起  share folder 功能, 故mail_plugins 加入acl 及imap_acl

4). 請 張'R 幫忙, 感恩!

回复: How to enable Dovecot Master User

rain6966 写道:

Jul 18 18:05:41 auth: Error: Error in configuration file /etc/dovecot/dovecot-ldap.conf line 21: Unknown setting: user_query

dovecot-ldap.conf 內容如下:

# add master can  accessing other's mailbox
user_query = mail=aaaaadmin

它明确提示你 user_query 有误。
你的 user_query 为何是 mail=aaaaadmin 而不是 mail=master_user?这里的 'master_user' 需要 hard-coded,而不是修改为你自己添加的 master user 的用户名。

回复: How to enable Dovecot Master User

Hi, 張'R

1). 我試了多次,一樣不行.
dovecot-ldap.conf 改為這樣?
user_query = mail=master_user

2).dovecot.log內容:

Jul 24 17:23:48 auth: Debug: Loading modules from directory: /usr/lib64/dovecot/auth
Jul 24 17:23:48 auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libauthdb_ldap.so
Jul 24 17:23:48 auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_mysql.so
Jul 24 17:23:48 auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_pgsql.so
Jul 24 17:23:48 auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libdriver_sqlite.so
Jul 24 17:23:48 auth: Debug: Module loaded: /usr/lib64/dovecot/auth/libmech_gssapi.so
Jul 24 17:23:48 auth: Error: Error in configuration file /etc/dovecot/dovecot-ldap.conf line 21: Unknown setting: user_query
Jul 24 17:23:48 master: Error: service(auth): command startup failed, throttling
Jul 24 17:23:48 log: Error: service(auth): child 10460 returned error 89 (Fatal failure)
 

3). dovecot-master-user-password 檔案內容:
cat dovecot-master-user-password
master_user:jhuKH6FUAubm6

4.) maillog內容:

Jul 24 17:25:18 mail1 roundcube: IMAP Error: Login failed for test@aaaa.com*master_user from 192.168.1.66. Unable to send co mmand: A0002 LOGIN "test@aaaa.com*master_user" master_password in /var/www/roundcubemail-0.9.2/program/lib/Roundcube/rcube_i map.php on line 184 (POST /mail/?_task=login&_action=login)

張'R , 請再幫我看看問題出在哪?
ps: 此篇文章是在 iredAdmin-Pro 章節的文件,我現在測試的是iredMail ,會有差別?

回复: How to enable Dovecot Master User

抱歉,刚才查了一下,Dovecot Master User 暂不支持 OpenLDAP backend:"pass=yes doesn't work with PAM or LDAP with auth_bind=yes, because both of them require knowing the user's password."

已更新了 wiki 文档,做了提示: http://iredmail.org/wiki/index.php?titl … aster.User

rain6966 写道:

ps: 此篇文章是在 iredAdmin-Pro 章節的文件,我現在測試的是iredMail ,會有差別?

你可以看到通篇都只是修改 iRedMail 的配置文件,所以与 iRedAdmin-Pro 是没有直接关系的,只是以后可能在 iRedAdmin-Pro 里使用到 Dovecot Master User。例如使用这个帐号,通过 managesieve 协议来设置用户的 vacation setting,等。