3月 202013
 

安装Dovecot服务

添加用户

[root@mail dovecot-2.1.15]# groupadd dovenull 
[root@mail dovecot-2.1.15]# useradd -M dovenull -s /sbin/nologin -g dovenull 
[root@mail dovecot-2.1.15]# groupadd dovecot 
[root@mail dovecot-2.1.15]# useradd -M dovecot -s /sbin/nologin -g dovecot

编译安装

[root@mail dovecot-2.1.15]# ./configure --prefix=/usr/local/dovecot --with-mysql 
[root@mail dovecot-2.1.15]# make 
[root@mail dovecot-2.1.15]# make install

配置dovecot

复制示例配置文件

# cd /usr/local/dovecot/etc/dovecot
# cp -R /usr/local/dovecot/share/doc/dovecot/example-config/conf.d/ ./
# cp /usr/local/dovecot/share/doc/dovecot/example-config/dovecot.conf ./
# cp /usr/local/dovecot/share/doc/dovecot/example-config/dovecot-sql.conf.ext ./

编辑dovecot.conf

 [root@mail dovecot]# vi dovecot.conf
 protocols = imap pop3 lmtp
 listen = *
 login_greeting = Dovecot ready.

编辑10-auth.conf

disable_plaintext_auth = no
 auth_mechanisms = plain login cram-md5
#!include auth-system.conf.ext
 !include auth-sql.conf.ext

编辑10-mail.conf

[root@mail conf.d]# vi 10-mail.conf
 mail_location = maildir:/var/vmail/%d/%u
 mail_uid = 8
 mail_gid = 12
 first_valid_uid = 8
 last_valid_uid = 8
 first_valid_gid = 12
 last_valid_gid = 12
 mail_plugins = quota

编辑10-master.conf

default_login_user = dovenull 
default_internal_user = dovecot
service auth {
 unix_listener auth-userdb {
 mode = 0600
 user = mail
 group = mail
 }

unix_listener /var/spool/postfix/private/auth {
 mode = 0660
 user = postfix
 group = postfix
 }
 }
service auth-worker {
 user = mail
 }
service lmtp {
 unix_listener /var/spool/postfix/private/dovecot-lmtp {
 mode = 0660
 user = postfix
 group = postfix
 }
 }

编辑10-logging.conf

[root@mail conf.d]# vi 10-logging.conf
 log_path = /var/log/dovecot.log

编辑10-ssl.conf

[root@mail conf.d]# vi 10-ssl.conf
 ssl = no
 #ssl_cert = </etc/ssl/certs/dovecot.pem
 #ssl_key = </etc/ssl/private/dovecot.pem

编辑20-imap.conf

[root@mail conf.d]# vi 20-imap.conf
 mail_plugins = $mail_plugins imap_quota

编辑auth-sql.conf.ext

 passdb {
 driver = sql
 args = /usr/local/dovecot/etc/dovecot/dovecot-sql.conf.ext
 }
userdb {
 driver = prefetch
 }
userdb {
 driver = sql
 args = /usr/local/dovecot/etc/dovecot/dovecot-sql.conf.ext
 }

编辑dovecot-sql.conf.ext

 [root@mail dovecot]# vi dovecot-sql.conf.ext
 driver = mysql
 connect = host=localhost dbname=postfix user=postfix password=mypapass
 default_pass_scheme = MD5
user_query = SELECT CONCAT('/var/mail/', maildir) AS home, \
 CONCAT('*:bytes=', quota) AS quota_rule \
 FROM mailbox WHERE username = '%u' AND active = 1
password_query = SELECT CONCAT('/var/mail/', maildir) AS userdb_home, \
 username AS user, password, CONCAT('*:bytes=', quota) AS userdb_quota_rule \
 FROM mailbox WHERE username = '%u' AND active = 1

相关下载:
(1) Dovecot 2.1.15

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据