AlmaLinux9.2 Dovecotをインストールする方法

環境
AlmaLinux release 9.2 (Turquoise Kodkod)

操作方法
1.dovecotインストール
# dnf -y install dovecot

2.dovecot.conf ファイルを編集する
# cp -p /etc/dovecot/dovecot.conf `date '+ /etc/dovecot/dovecot.conf.%Y%m%d’`
# vi /etc/dovecot/dovecot.conf

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
#25 行目あたりに追加#
# protocols = imap pop3 lmtp
protocols = imap pop3
#30行目 : コメント解除#
# IPv4 のみリスンする場合は [::] を削除
listen = *
#25 行目あたりに追加# # protocols = imap pop3 lmtp protocols = imap pop3 #30行目 : コメント解除# # IPv4 のみリスンする場合は [::] を削除 listen = *
#25 行目あたりに追加#
# protocols = imap pop3 lmtp
protocols = imap pop3

#30行目 : コメント解除#
# IPv4 のみリスンする場合は [::] を削除
listen = *

3.10-auth.conf ファイルを編集する
# vi /etc/dovecot/conf.d/10-auth.conf

#10行目 : コメント解除し変更
プレーンテキスト認証も許可する場合
disable_plaintext_auth = no

#100行目 : 追記
auth_mechanisms = plain login

4. 10-mail.conf ファイルを編集する
# vi /etc/dovecot/conf.d/10-mail.conf
#31行目 : 追記#
mail_location = maildir:~/Maildir

5.10-master.conf ファイルを編集
# vi /etc/dovecot/conf.d/10-master.conf

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
#107-109行目 : コメント解除して追記
# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix
group = postfix
}
#107-109行目 : コメント解除して追記 # Postfix smtp-auth unix_listener /var/spool/postfix/private/auth { mode = 0666 user = postfix group = postfix }
#107-109行目 : コメント解除して追記
# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix
group = postfix
}

6. 10-ssl.conf ファイルを編集する
# vi /etc/dovecot/conf.d/10-ssl.conf

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
/**8 行目あたり*/
「ssl = required」を「ssl = yes」に変更
ssl = yes
/**8 行目あたり*/ 「ssl = required」を「ssl = yes」に変更 ssl = yes
/**8 行目あたり*/
「ssl = required」を「ssl = yes」に変更
ssl = yes

7.dovecot をサービスに登録し、起動する

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# systemctl enable dovecot.service
Created symlink /etc/systemd/system/multi-user.target.wants/dovecot.service → /usr/lib/systemd/system/dovecot.service.
# systemctl is-enabled dovecot.service
Enabled
# systemctl start dovecot.service
# systemctl enable dovecot.service Created symlink /etc/systemd/system/multi-user.target.wants/dovecot.service → /usr/lib/systemd/system/dovecot.service. # systemctl is-enabled dovecot.service Enabled # systemctl start dovecot.service
# systemctl enable dovecot.service
Created symlink /etc/systemd/system/multi-user.target.wants/dovecot.service → /usr/lib/systemd/system/dovecot.service.
# systemctl is-enabled dovecot.service
Enabled
# systemctl start dovecot.service

 

8.firewalldでPOP/IMAP サービスの許可ポート開放
POP : [110/TCP], IMAP :[143/TCP]

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# firewall-cmd --permanent --add-service=pop3
# firewall-cmd --permanent --add-service=imap
# firewall-cmd --reload
# firewall-cmd --permanent --add-service=pop3 # firewall-cmd --permanent --add-service=imap # firewall-cmd --reload
# firewall-cmd --permanent --add-service=pop3
# firewall-cmd --permanent --add-service=imap
# firewall-cmd --reload

 

AlmaLinux 9

Posted by arkgame