- [CentOS6] Postfixによるメールサーバ構築 その1 (PostfixをSRPMからリビルド)
- [CentOS6] Postfixによるメールサーバ構築 その2 (MySQLの設定とpostfixadminのインストール)
- [CentOS6] Postfixによるメールサーバ構築 その3 (Postfixの設定)
- [CentOS6] Postfixによるメールサーバ構築 その4 (Dovecotの設定)
Dovecotのインストールと設定を行います。
yum install dovecot dovecot-mysql yum install cyrus-sasl-plain cyrus-sasl-md5 cd /etc/dovecot/ vi dovecot.conf ---------------------------------------------------- dict { #quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext #expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext quotadict = mysql:/etc/dovecot/dovecot-dict-sql.conf } mail_plugins = quota ---------------------------------------------------- vi dovecot-dict-sql.conf ---------------------------------------------------- connect = dbname=postfix user=postfix host=/var/lib/mysql/mysql.sock password=skpMrLvw9fiX map { pattern = priv/quota/storage table = quota2 username_field = username value_field = bytes } map { pattern = priv/quota/messages table = quota2 username_field = username value_field = messages } ---------------------------------------------------- cd /etc/dovecot/conf.d vi 20-imap.conf ---------------------------------------------------- mail_plugins = $mail_plugins imap_quota ---------------------------------------------------- vi 90-quota.conf ---------------------------------------------------- plugin { #quota_rule = *:storage=1G #quota_rule2 = Trash:storage=+100M quota = dict:user::proxy::quotadict quota_rule = *:storage=10M:messages=1000 quota_rule2 = Trash:storage=+100M } plugin { quota_warning = storage=95%% quota-warning 95 %u quota_warning2 = storage=80%% quota-warning 80 %u } ---------------------------------------------------- vi 10-auth.conf ---------------------------------- #disable_plaintext_auth = yes disable_plaintext_auth = no #auth_mechanisms = plain auth_mechanisms = plain login cram-md5 #!include auth-system.conf.ext !include auth-sql.conf.ext ---------------------------------- vi 10-logging.conf -------------------------------------------- #auth_verbose = no auth_verbose = yes -------------------------------------------- vi 10-mail.conf -------------------------------------------- #mail_location = mail_location = maildir:/mail/%d/%u #first_valid_gid = 1 #last_valid_gid = 0 first_valid_uid = 10000 first_valid_gid = 10000 -------------------------------------------- vi 10-master.conf -------------------------------------------- service lmtp { unix_listener lmtp { #mode = 0666 } unix_listener /var/spool/postfix/private/dovecot-lmtp { group = postfix mode = 0600 user = postfix } } # Postfix smtp-auth unix_listener /var/spool/postfix/private/auth { mode = 0666 } unix_listener dict { #mode = 0600 #user = #group = mode = 0600 user = vuser group = vuser } -------------------------------------------- vi /etc/dovecot/dovecot-sql.conf.ext -------------------------------------------- driver = mysql default_pass_scheme = CRAM-MD5 connect = dbname=postfix user=postfix host=/var/lib/mysql/mysql.sock password=skpMrLvw9fiX password_query = SELECT password, 10000 AS userdb_uid, 10000 AS userdb_gid, CONCAT('*:bytes=', CAST(mailbox.quota AS CHAR)) AS userdb_quota_rule FROM mailbox, domain WHERE username = '%u' AND mailbox.domain = domain.domain AND mailbox.active = '1' AND domain.active = '1' user_query = SELECT concat('/mail/', maildir) AS home, 10000 AS uid, 10000 AS gid, CONCAT('*:bytes=', CAST(mailbox.quota AS CHAR)) AS quota_rule FROM mailbox, domain WHERE username = '%u' AND mailbox.domain = domain.domain AND mailbox.active = '1' AND domain.active = '1' iterate_query = SELECT username FROM mailbox --------------------------------------------