配置dovecot错处问题解决修改dovecot主配置文件如下[root@rhel6~]#grep-v'^#'/etc/dovecot/dovecot.conf|grep-v'^$'|grep-v'#'!includeconf.d/*.conf//该配置项说明conf.d下的所以conf结尾的文件均有效,注意最前面的!号protocols=imappop3lmtplogin_trusted_networks=192.168.50.0/24//指定允许登录的网段地址dict{}若未设置login_trusted_networks参数值,使用telnet登录110端口,将会出现如下错误,不知道这个值能不能设置为四个零,这个还有待测试…freebsd#telnet192.168.50.24110Trying192.168.50.24...Connectedto192.168.50.24.Escapecharacteris'^]'.+OKDovecotready.2564.2.4d106a4d.NTUFLnbszkRtt73yHZq2iw==@rhel6.766.comuserOracle-ERRPlaintextauthenticationdisallowedonnon-secure(SSL/TLS)connections.passoracle-ERRPlaintextauthenticationdisallowedonnon-secure(SSL/TLS)connections.quit+OKLoggingoutConnectionclosedbyforeignhost.[root@rhel6~]#tail-f/var/log/maillogDec2116:51:00rhel6dovecot:pop3-login:Abortedlogin(triedtousedisabledplaintextauth):rip=192.168.50.211,lip=192.168.50.24,mpid=05:设置/etc/dovecot/conf.d/10-mail.conf配置文件如下:[root@rhel6~]#grep-v'^#'/etc/dovecot/conf.d/10-mail.conf|grep-v'^$'|grep-v'#'mail_location=mbox:~/mail:INBOX=/var/mail/%umbox_write_locks=fcntl如未设置mail_location参数值,将会出现如下错误:freebsd#telnet192.168.50.24110Trying192.168.50.24...Connectedto192.168.50.24.Escapecharacteris'^]'.+OKDovecotready.2656.1.4d106ad9.Ovoh/mkl1gK+XPX5qohEbA==@rhel6.766.comuseroracle+OKpassoracleConnectionclosedbyforeignhost.[root@rhel6~]#tail-f/var/log/maillogDec2116:52:50rhel6dovecot:pop3-login:Login:user=oracle,method=PLAIN,rip=192.168.50.211,lip=192.168.50.24,mpid=9826,securedDec2116:52:50rhel6dovecot:pop3(oracle):Error:useroracle:Initializationfailed:mail_locationnotsetandautodetectionfailed:Mailstorageautodetectionfailedwithhome=/u01/oracleDec2116:52:50rhel6dovecot:pop3(oracle):Error:Invalidusersettings.Refertoserverlogformoreinformation.设置完mail_location值后,需要重启dovecot服务,同时需要创建相关的目录,否则还会出现如下错误freebsd#telnet192.168.50.24110Trying192.168.50.24...Connectedto192.168.50.24.Escapecharacteris'^]'.+OKDovecotready.2781.1.4d106bc3.JFuUEG+bO68ixpY2W1zihg==@rhel6.766.comuseroracle+OKpassoracle-ERR[IN-USE]Couldn'topenINBOX:Internalerroroccurred.Refertoserverlogformoreinformation.[2010-12-2116:56:40]Connectionclosedbyforeignhost.[root@rhel6~]#tail-f/var/log/maillogDec2116:56:40rhel6dovecot:pop3-login:Login:user=oracle,method=PLAIN,rip=192.168.50.211,lip=192.168.50.24,mpid=10115,securedDec2116:56:41rhel6dovecot:pop3(oracle):Error:chown(/u01/oracle/mail/.imap/INBOX,-1,12(mail))failed:Operationnotpermitted(egid=501(dba),groupbasedon/var/mail/oracle)Dec2116:56:41rhel6dovecot:pop3(oracle):Error:mkdir(/u01/oracle/mail/.imap/INBOX)failed:OperationnotpermittedDec2116:56:41rhel6dovecot:pop3(oracle):Error:Couldn'topenINBOX:Internalerroroccurred.Refertoserverlogformoreinformation.[2010-12-2116:56:40]Dec2116:56:41rhel6dovecot:pop3(oracle):Couldn'topenINBOXtop=0/0,retr=0/0,del=0/0,size=0[root@rhel6~]#su-oracle[oracle@rhel6~]$mkdir-p/u01/oracle/mail/.imap/INBOX[oracle@rhel6~]$exitlogout[root@rhel6~]#mail-s'Postfixmailtest'oracle@rhel6.766.com/etc/hostsfreebsd#telnet192.168.50.24110Trying192.168.50.24...Connectedto192.168.50.24.Escapecharacteris'^]'.+OKDovecotready.2867.1.4d106ca7.L311rFiY7/LIWOTM2Cp3Xg==@rhel6.766.comuseroracle+OKpassoracle+OKLoggedin.list+OK5messages:16726:为了使新创建的用户可以自动创建这个目录,可以修改/etc/skel/.bash_profile文件如下[root@rhel6~]#tail-4/etc/skel/.bash_profileif[!-d~/mail/.imap/INBOX];thenmkdir-p~/mail/.imap/INBOXfi7:新建一个用户,并在win7客户端收信测试[root@rhel6~]#useraddtiger[root@rhel6~]#echo'123456'|passwd--stdintiger更改用户tiger的密码。passwd:所有的身份验证令牌已经成功更新。[root@rhel6~]#mail-s'tiger'tiger@rhel6.766.com/etc/issue.net