************************************************************
postfixインストール 設定
[root@falcon21 ~]# yum -y install postfix
インストール:
postfix.i686 2:2.6.6-8.el6
***************************
postfix 設定
[root@falcon21 ~]# vi /etc/postfix/main.cf
75 myhostname = mail.falcon21.space // mail.falcon21.space
83 mydomain = falcon21.space
99 myorigin = $mydomain
116 inet_interfaces = all
119 inet_protocols = ipv4
164 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
264 mynetworks = 192.168.2.0/24, 192.168.0.0/24 127.0.0.0/8
419 home_mailbox = Maildir/
571 smtpd_banner = $myhostname ESMTP
最終行へ追記
mailbox_size_limit = 1073741824
smtpd_sasl_type = dovecot
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject
---------------------------
[root@falcon21 ~]# vi /etc/postfix/master.cf
19 -o smtpd_sasl_auth_enable=yes
------------------------
SMTP認証設定
[root@falcon21 ~]# yum -y install cyrus-sasl
[root@falcon21 ~]# systemctl start saslauthd
[root@falcon21 ~]# systemctl enable saslauthd
[root@falcon21 ~]# systemctl status saslauthd
● saslauthd.service - SASL authentication daemon.
Loaded: loaded (/usr/lib/systemd/system/saslauthd.service; enabled; vendor preset: disabled)
Active: active (running) since 月 2018-04-30 09:32:41 JST; 8h ago
Main PID: 765 (saslauthd)
CGroup: /system.slice/saslauthd.service
├─772 /usr/sbin/saslauthd -m /run/saslauthd -a shadow
├─773 /usr/sbin/saslauthd -m /run/saslauthd -a shadow
├─774 /usr/sbin/saslauthd -m /run/saslauthd -a shadow
└─775 /usr/sbin/saslauthd -m /run/saslauthd -a shadow
4月 30 09:32:39 falcon21.space systemd[1]: Starting SASL authentication daemon....
4月 30 09:32:39 falcon21.space saslauthd[765]: detach_tty : master pid is: 765
4月 30 09:32:39 falcon21.space saslauthd[765]: ipc_init : listening on socke...ux
4月 30 09:32:41 falcon21.space systemd[1]: Started SASL authentication daemon..
Hint: Some lines were ellipsized, use -l to show in full.
----------------------
メールボックス自動作成設定
[root@falcon21 ~]# mkdir -p /etc/skel/Maildir/{new,cur,tmp}
[root@falcon21 ~]# chmod -R 700 /etc/skel/Maildir/
----------------------
存在しないユーザー宛メールの破棄
[root@falcon21 ~]# vi /etc/postfix/main.cf
最終行へ追加
689 luser_relay = unknown_user@localhost
[root@falcon21 ~]# echo unknown_user: /dev/null >> /etc/aliases
[root@falcon21 ~]# newaliases
--------------------
[root@falcon21 ~]# systemctl restart postfix
[root@falcon21 ~]# systemctl enable postfix
[root@falcon21 ~]# systemctl status postfix
● 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 19:05:56 JST; 35s ago
Main PID: 27906 (master)
CGroup: /system.slice/postfix.service
├─27907 pickup -l -t unix -u
└─27908 qmgr -l -t unix -u
4月 30 19:05:56 falcon21.space systemd[1]: Starting Postfix Mail Transport ....
4月 30 19:05:56 falcon21.space postfix/postfix-script[27904]: starting the P...
4月 30 19:05:56 falcon21.space postfix/master[27906]: daemon started -- vers...
4月 30 19:05:56 falcon21.space systemd[1]: Started Postfix Mail Transport A....
Hint: Some lines were ellipsized, use -l to show in full.
---------------------------
TCP25番、TCP587番ポート開放
*************************************************************
Dovecotインストール設定
[root@falcon21 ~]# yum -y install dovecot
[root@falcon21 ~]# vi /etc/dovecot/conf.d/10-mail.conf
[root@falcon21 ~]# vi /etc/dovecot/conf.d/10-auth.conf
[root@falcon21 ~]# vi /etc/dovecot/conf.d/10-ssl.conf
---------------------------------------
Dovecot起動
[root@falcon21 ~]# systemctl start dovecot
[root@falcon21 ~]# systemctl enable 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 09:32:49 JST; 9h ago
Main PID: 1440 (dovecot)
CGroup: /system.slice/dovecot.service
├─1496 dovecot/anvil
├─1497 dovecot/log
└─1501 dovecot/config
4月 30 09:32:49 falcon21.space systemd[1]: Starting Dovecot IMAP/POP3 email server...
4月 30 09:32:49 falcon21.space systemd[1]: Started Dovecot IMAP/POP3 email server.
4月 30 09:32:50 falcon21.space dovecot[1440]: master: Dovecot v2.2.10 starting up for imap, pop3, lmtp (core dumps disabled)
4月 30 09:32:50 falcon21.space dovecot[1440]: master: Warning: /root/.gvfs is no longer mounted. See http://wiki2.dovecot.org/Mountpoints
Warning: /root/.gvfs is no longer mounted. は、restart dovecot で、解消。
[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 19:40:34 JST; 7s ago
Process: 28626 ExecStartPre=/usr/libexec/dovecot/prestartscript (code=exited, status=0/SUCCESS)
Main PID: 28633 (dovecot)
CGroup: /system.slice/dovecot.service
├─28641 dovecot/anvil
├─28642 dovecot/log
└─28644 dovecot/config
4月 30 19:40:34 falcon21.space systemd[1]: Starting Dovecot IMAP/POP3 email server...
4月 30 19:40:34 falcon21.space systemd[1]: Started Dovecot IMAP/POP3 email server.
4月 30 19:40:34 falcon21.space dovecot[28633]: master: Dovecot v2.2.10 starting up for imap, pop3, lmtp (core dumps disabled)
**********************************************************************