ActiveDirectoryと連携したメールサービス(Postfix + Dovecot)を設定

ActiveDirectoryと連携してLinuxサーバへSSH接続の設定が済んでることが前提です。
Active Dicrectoryユーザ宛のメールは自動的にメールボックスを作成し、受信出来るようになります。

■設定環境
ドメイン   :ys-network.info
OS      :CentOS6 64bit
dovecot   :Ver 2.0.9
postfix   :Ver 2.6.6
その他winbind等の関連パッケージはActiveDirectoryと連携してLinuxサーバへSSH接続と同じです

■概要
1.Postfixの設定
 1.1 main.cfの設定
 1.2 postfixサービスを再起動(設定を反映)

2.Dovecotの設定
 2.1 dovecotをインストール
 2.2 10-auth.confを設定
 2.3 10-mail.confを設定
 2.4 dovecotサービスを起動

1.1 main.cfの設定

# vi /etc/postfix/main.cf

変更前(追記前)
#myhostname = host.domain.tld
#myhostname = virtual.domain.tld
変更後(追記後)
#myhostname = host.domain.tld
#myhostname = virtual.domain.tld
hostname = ys-network.info

変更前(追記前)
#mydomain = domain.tld
変更後(追記後)
#mydomain = domain.tld
mydomain = ys-network.info

変更前(追記前)
#myorigin = $myhostname
変更後(追記後)
#myorigin = $myhostname
myorigin = $mydomain

変更前
#inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
inet_interfaces = localhost
変更後
#inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
inet_interfaces = all

変更前
#mydestination = $myhostname, localhost.$mydomain, localhost
変更後
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

変更前
#home_mailbox = Mailbox
#home_mailbox = Maildir/
変更後(コメントアウトを削除)
#home_mailbox = Mailbox
home_mailbox = Maildir/

1.2 postfixサービスを再起動(設定を反映)

# /etc/rc.d/init.d/postfix restart
postfix を停止中:                                          [  OK  ]
postfix を起動中:                                          [  OK  ]

2.1 dovecotをインストール

# yum install dovecot
~~~~~~~~~~~~~~省略~~~~~~~~~~~~~~
Dependencies Resolved

===========================================================================
 Package                 Arch       Version              Repository   Size
===========================================================================
Installing:
 dovecot                 x86_64     1:2.0.9-2.el6_1.1    updates     1.9 M

Transaction Summary
===========================================================================
Install       1 Package(s)
Upgrade       0 Package(s)
~~~~~~~~~~~~~~省略~~~~~~~~~~~~~~

2.2 10-auth.confを設定

# vi /etc/dovecot/conf.d/10-auth.conf

変更前
#disable_plaintext_auth = yes
変更後(コメントアウトを削除して変更)
disable_plaintext_auth = no

変更前
#auth_username_format =
変更後(コメントアウトを削除して変更)
auth_username_format = %n

変更前
#auth_use_winbind = no
変更後(コメントアウトを削除して変更)
auth_use_winbind = yes

変更前
#auth_winbind_helper_path = /usr/bin/ntlm_auth
変更後(コメントアウトを削除)
auth_winbind_helper_path = /usr/bin/ntlm_auth

2.3 10-mail.confを設定

# vi /etc/dovecot/conf.d/10-mail.conf

変更前
#mail_location =
変更後(コメントアウトを削除して変更)
mail_location = maildir:~/Maildir

2.4 dovecotサービスを起動

# /etc/rc.d/init.d/dovecot start
Dovecot Imap を起動中:                                     [  OK  ]

======================================================================
設定環境
OS:CentOS6 x64
postfix-2.6.6-2.1.el6_0.x86_64
dovecot-2.0.9-2.el6_1.1.x86_64

dovecotはVer2以降は設定方法が大きく変わってます。