サーバー証明書を無料で発行
[root@falcon21 ~]# cd /usr/local/
[root@falcon21 local]# git clone https://github.com/certbot/certbot
Certbotクライアントインストール
[root@falcon21 local]# cd
[root@falcon21 ~]# /usr/local/certbot/certbot-auto --help
サーバー証明書取得
WEBサーバーで作成した証明書を使う
Postfix設定
[root@falcon21 ~]# vi /etc/postfix/main.cf
693 smtpd_tls_security_level = may
694 smtpd_tls_cert_file = /etc/letsencrypt/live/falcon21.space/fullchain.pem
695 tls_high_cipherlist = kEECDH:+kEECDH+SHA:kEDH:+kEDH+SHA:+kEDH+CAMELLIA:kECDH:+kECDH+SHA:kRSA:+kRSA+SHA: +kRSA+CAMELLIA:!aNULL:!eNULL:!SSLv2:!RC4:!MD5:!DES:!EXP:!SEED:!IDEA:!3DES
696 smtp_tls_ciphers = high
697 smtpd_tls_ciphers = high
698 smtpd_tls_mandatory_ciphers = high
701 smtp_tls_mandatory_protocols=!SSLv2,!SSLv3
702 smtpd_tls_protocols=!SSLv2,!SSLv3
703 smtp_tls_protocols=!SSLv2,!SSLv3
----------------------
[root@falcon21 ~]# vi /etc/postfix/master.cf
19 # -o smtpd_sasl_auth_enable=yes
26 smtps inet n - n - - smtpd
28 -o smtpd_tls_wrappermode=yes
29 -o smtpd_sasl_auth_enable=yes
-------------------------
[root@falcon21 ~]# systemctl restart postfix
[root@falcon21 ~]# systemctl status postfix -l
● postfix.service - Postfix Mail Transport Agent
Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled)
Active: active (running) since 月 2018-04-30 20:18:05 JST; 28s ago
Process: 29322 ExecStop=/usr/sbin/postfix stop (code=exited, status=0/SUCCESS)
Process: 29337 ExecStart=/usr/sbin/postfix start (code=exited, status=0/SUCCESS)
Process: 29334 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=0/SUCCESS)
Process: 29332 ExecStartPre=/usr/libexec/postfix/aliasesdb (code=exited, status=0/SUCCESS)
Main PID: 29409 (master)
CGroup: /system.slice/postfix.service
├─29410 pickup -l -t unix -u
└─29411 qmgr -l -t unix -u
4月 30 20:18:04 falcon21.space systemd[1]: Starting Postfix Mail Transport Agent...
4月 30 20:18:04 falcon21.space postfix/postfix-script[29407]: starting the Postfix mail system
4月 30 20:18:05 falcon21.space postfix/master[29409]: daemon started -- version 2.10.1, configuration /etc/postfix
4月 30 20:18:05 falcon21.space systemd[1]: Started Postfix Mail Transport Agent.
--------------------------
TCP465番ポート開放
*******************************************************************
Dovecot設定
[root@falcon21 ~]# vi /etc/dovecot/conf.d/10-ssl.conf
14 #ssl_cert = </etc/pki/dovecot/certs/dovecot.pem
15 #ssl_key = </etc/pki/dovecot/private/dovecot.pem
16 ssl_cert = </etc/letsencrypt/live/falcon21.space/fullchain.pem
17 ssl_key = </etc/letsencrypt/live/falcon21.space/privkey.pem
53 ssl_protocols = !SSLv2 !SSLv3
55 # SSL ciphers to use
56 #ssl_cipher_list = ALL:!LOW:!SSLv2:!EXP:!aNULL
57 ssl_cipher_list = EECDH+AESGCM+AES128:EECDH+AESGCM+AES256:EDH+AESGCM+AES128:EDH+AESGCM+AES25 6:EECDH+SHA256+AES128:EECDH+SHA384+AES256:EDH+SHA256+AES128:EDH+SHA256+AES256:EECDH+SHA1+AES 128:EECDH+SHA1+AES256:EDH+SHA1+AES128:EDH+SHA1+AES256:EECDH+HIGH:EDH+HIGH:AESGCM+AES128:AESG CM+AES256:SHA256+AES128:SHA256+AES256:SHA1+AES128:SHA1+AES256:HIGH:!aNULL:!eNULL:!EXPORT:!DE S:!RC4:!MD5:!PSK:!KRB5:!aECDH:!3DES
----------------
[root@falcon21 ~]# systemctl restart postfix
[root@falcon21 ~]# systemctl restart dovecot
[root@falcon21 ~]# systemctl status dovecot -l
● dovecot.service - Dovecot IMAP/POP3 email server
Loaded: loaded (/usr/lib/systemd/system/dovecot.service; enabled; vendor preset: disabled)
Active: active (running) since 月 2018-04-30 20:45:00 JST; 7s ago
Process: 30043 ExecStartPre=/usr/libexec/dovecot/prestartscript (code=exited, status=0/SUCCESS)
Main PID: 30050 (dovecot)
CGroup: /system.slice/dovecot.service
├─30058 dovecot/anvil
├─30059 dovecot/log
└─30061 dovecot/config
4月 30 20:45:00 falcon21.space systemd[1]: Starting Dovecot IMAP/POP3 email server...
4月 30 20:45:00 falcon21.space systemd[1]: Started Dovecot IMAP/POP3 email server.
4月 30 20:45:00 falcon21.space dovecot[30050]: master: Dovecot v2.2.10 starting up for imap, pop3, lmtp (core dumps disabled)
-----------------------------
TCP995番(POPの場合)またはTCP993番(IMAPの場合)ポート開放
*******************************************************************************