创建 Dovecot Master 用户/密码无效

创建 Dovecot Master 用户/密码无效

我已经为此绞尽脑汁好几个小时了。我想创建一个可以访问所有 dovecot 帐户的主用户。我按照教程dovecot 网站但是,它仍然显示“身份验证失败”或“等待身份验证过程响应”,并且始终不起作用。我可能做错了什么?谢谢

//dovecot.conf

# 2.0.16: /usr/local/etc/dovecot/dovecot.conf
# OS: FreeBSD 8.2-RELEASE amd64  
auth_master_user_separator = *
disable_plaintext_auth = no
mail_location = maildir:~/Maildir
namespace {
  inbox = yes
  location = 
  prefix = INBOX.
  separator = .
  type = private
}

passdb {
  args = /usr/local/etc/dovecot/dovecot-sql.conf
  driver = sql
}
passdb {
  args = /usr/local/etc/dovecot/passwd.master
  driver = passwd-file
  master = yes
}
protocols = imap pop3
service auth {
  client_limit = 6000
}
service imap {
  process_limit = 2048
  vsz_limit = 1256 M
}
service pop3 {
  process_limit = 2048
}

userdb {
  args = /usr/local/etc/dovecot/dovecot-sql.conf
  driver = sql
}
userdb {
  driver = passwd
}
protocol pop3 {
  pop3_uidl_format = UID%u-%v
}
    --> as instructed from http://wiki.dovecot.org/Authentication/MasterUsers

cat 密码.master

master:{SHA}E9RIKlmYWisBS3ObR16GwKUZNZg=  

telnet 本地主机 143

 Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    a login loginuser*master mypassword
    * OK Waiting for authentication process to respond..
    * OK Waiting for authentication process to respond..                                                                                                                   
    * BYE Disconnected for inactivity.                                                                                                                                     
    Connection closed by foreign host.

或者

telnet localhost 143                                                                                                         
Trying 127.0.0.1...                                                                                                                                                    
Connected to localhost.                                                                                                                                                
Escape character is '^]'.                                                                                                                                              
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN                                                
1 login loginuser*master mypassword                                                                                                                      
1 NO [AUTHENTICATIONFAILED] Authentication failed.                                                                                                                     
* BYE Disconnected for inactivity.                                                                                                                                     
Connection closed by foreign host.  

//鸽舍-n

# 2.0.16: /usr/local/etc/dovecot/dovecot.conf
# OS: FreeBSD 8.2-RELEASE amd64  
auth_master_user_separator = *
disable_plaintext_auth = no
login_greeting = CFI mail server ready.
mail_location = maildir:~/Maildir
namespace {
  inbox = yes
  location = 
  prefix = INBOX.
  separator = .
  type = private
}

passdb {
  args = /usr/local/etc/dovecot/dovecot-sql.conf
  driver = sql
}
passdb {
  args = /usr/local/etc/dovecot/passwd.master
  driver = passwd-file
  master = yes
}
protocols = imap pop3
service auth {
  client_limit = 6000
}
service imap {
  process_limit = 2048
  vsz_limit = 1256 M
}
service pop3 {
  process_limit = 2048
}

userdb {
  args = /usr/local/etc/dovecot/dovecot-sql.conf
  driver = sql
}
userdb {
  driver = passwd
}
protocol pop3 {
  pop3_uidl_format = UID%u-%v
}

答案1

终于让它工作了!首先,我必须用auth_master_user_separator = +代替*。这消除了 dovecot 的投诉,即用户名字符不允许auth_username_chars: 0x2a (username: loginuser*master)

然后我意识到我使用 htpasswd 命令将主密码记录添加到了错误的文件中/usr/local/etc/dovecot/dovecot.master,但在我的配置中,正确的文件是/usr/local/etc/dovecot/passwd.master。我不知道我怎么没能很快发现这一点。

最后,我没有使用 telnet 很好地测试主用户登录。我使用的1 login loginuser+master mypassword1 login [email protected]+master mypassword

最后,我在 dovecot.conf 中的配置看起来像

auth_master_user_separator = +                                                                                                                            
#auth_username_chars = *  #dovecot complains about the “*” character                                                                                                                               
auth_verbose = yes                                                                                                                                             
auth_debug = yes                                                                                                                                               
auth_debug_passwords = yes                                                                                                                                     
passdb {                                                                                                                                                       
        driver = passwd-file                                                                                                                                   
        args = /usr/local/etc/dovecot/passwd.master                                                                                                            
        master = yes                                                                                                                                           
        #pass = yes                                                                                                                                            

}                                                                                                                                                              
passdb {                                                                                                                                          
        #driver = shadow                                                                                                                                       
        driver = pam                                                                                                                                           
}                                                                                                                                                              
userdb {                                                                                                                                                       
  driver = passwd                                                                                                                                              
}

相关内容