postfix.削除して、再インストール設定 ssl設定無し


[root@falcon21 ~]# systemctl stop postfix
[root@falcon21 ~]# systemctl stop dovecot
 

[root@falcon21 ~]# yum erase postfix

削除しました:
postfix.x86_64 2:2.10.1-7.el7

依存性の削除をしました:
fail2ban.noarch 0:0.9.7-1.el7 fail2ban-sendmail.noarch 0:0.9.7-1.el7 postfix-perl-scripts.x86_64 2:2.10.1-7.el7

完了しました!
New leaves:
fail2ban-firewalld.noarch

ーーーーーーーーーーーーーーー
念のため
[root@falcon21 ~]# rpm -qa | grep postfix
[root@falcon21 ~]# rm -rf /usr/libexec/postfix
[root@falcon21 ~]# rm -rf /etc/postfix
[root@falcon21 ~]# rm -rf /usr/sbin/post*


[root@falcon21 ~]# yum -y install postfix

インストール:
postfix.x86_64 2:2.10.1-7.el7

完了しました!
New leaves:
postfix.x86_64

 

[root@falcon21 ~]# vi /etc/postfix/main.cf

75 myhostname = mail.falcon21.space
83 mydomain = falcon21.space
99 myorigin = $mydomain

113 inet_interfaces = all
116 #inet_interfaces = localhost

165 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

267 mynetworks = 192.168.2.0/24, 192.168.0.0/24 127.0.0.0/8

420 home_mailbox = Maildir/

574 smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)

最終行へ追記
smtpd_sasl_auth_enable = yes

smtpd_recipient_restrictions =
permit_mynetworks
permit_sasl_authenticated
reject_unauth_destination

message_size_limit = 10485760


689 luser_relay = unknown_user@localhost

 

[root@falcon21 ~]# vi /etc/postfix/master.cf
16 submission inet n - n - - smtpd

19 -o smtpd_sasl_auth_enable=yes
 

 

[root@falcon21 ~]# systemctl start 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 土 2019-05-18 14:36:56 JST; 5s ago
Process: 31068 ExecStart=/usr/sbin/postfix start (code=exited, status=0/SUCCESS)
Process: 31066 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=0/SUCCESS)
Process: 31059 ExecStartPre=/usr/libexec/postfix/aliasesdb (code=exited, status=0/SUCCESS)
Main PID: 31142 (master)
Tasks: 3
CGroup: /system.slice/postfix.service
├─31142 /usr/libexec/postfix/master -w
├─31144 pickup -l -t unix -u
└─31145 qmgr -l -t unix -u

5月 18 14:36:54 falcon21.space systemd[1]: Starting Postfix Mail Transport Agent...
5月 18 14:36:56 falcon21.space postfix/postfix-script[31140]: starting the Postfix mail system
5月 18 14:36:56 falcon21.space postfix/master[31142]: daemon started -- version 2.10.1, configuration /etc/postfix
5月 18 14:36:56 falcon21.space systemd[1]: Started Postfix Mail Transport Agent.
 

 

[root@falcon21 ~]# vi /etc/dovecot/conf.d/10-mail.conf
30 mail_location = maildir:~/Maildir
190 valid_chroot_dirs = /home    *追加※OpenSSH+Chrootを導入している場合




[root@falcon21 ~]# vi /etc/dovecot/conf.d/10-auth.conf
10 disable_plaintext_auth = no
100 auth_mechanisms = plain login   メールサーバー間通信内容暗号化導入推奨

122 !include auth-system.conf.ext
125 # !include auth-passwdfile.conf.ext



[root@falcon21 ~]# vi /etc/dovecot/conf.d/10-ssl.conf

8 ssl = no                   メールサーバー間通信内容暗号化導入推奨


[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 土 2019-05-18 14:50:25 JST; 27s ago
Docs: man:dovecot(1)
http://wiki2.dovecot.org/
Process: 2556 ExecStart=/usr/sbin/dovecot (code=exited, status=0/SUCCESS)
Process: 2547 ExecStartPre=/usr/libexec/dovecot/prestartscript (code=exited, status=0/SUCCESS)
Main PID: 2558 (dovecot)
Tasks: 4
CGroup: /system.slice/dovecot.service
├─2558 /usr/sbin/dovecot
├─2561 dovecot/anvil
├─2562 dovecot/log
└─2564 dovecot/config

5月 18 14:50:25 falcon21.space systemd[1]: Starting Dovecot IMAP/POP3 email server...
5月 18 14:50:25 falcon21.space systemd[1]: PID file /var/run/dovecot/master.pid not readable (yet?) after start.
5月 18 14:50:25 falcon21.space dovecot[2558]: master: Dovecot v2.2.36 (1f10bfa63) starting up for imap, pop3, lmtp (core dumps disabled)
5月 18 14:50:25 falcon21.space systemd[1]: Started Dovecot IMAP/POP3 email server.
 

 

[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 月 2019-05-13 14:47:49 JST; 5 days ago
Main PID: 2397 (saslauthd)
CGroup: /system.slice/saslauthd.service
├─2397 /usr/sbin/saslauthd -m /run/saslauthd -a shadow
├─2401 /usr/sbin/saslauthd -m /run/saslauthd -a shadow
├─2402 /usr/sbin/saslauthd -m /run/saslauthd -a shadow
├─2403 /usr/sbin/saslauthd -m /run/saslauthd -a shadow
└─2405 /usr/sbin/saslauthd -m /run/saslauthd -a shadow

5月 13 14:47:49 falcon21.space systemd[1]: Starting SASL authentication daemon....
5月 13 14:47:49 falcon21.space systemd[1]: Started SASL authentication daemon..
5月 13 14:47:49 falcon21.space saslauthd[2397]: detach_tty : master pid is: 2397
5月 13 14:47:49 falcon21.space saslauthd[2397]: ipc_init : listening on socket: /run/saslauthd/mux
5月 18 16:00:34 falcon21.space saslauthd[2397]: do_auth : auth failure: [user=abuse] [service=smtp] [realm=falcon21.space] [m...ername]
Hint: Some lines were ellipsized, use -l to show in full.

 

存在しないユーザー宛メールの破棄
[root@falcon21 ~]# vi /etc/postfix/main.cf

local_recipient_maps =
luser_relay = unknown_user@localhost

[root@falcon21 ~]# echo unknown_user: /dev/null >> /etc/aliases
[root@falcon21 ~]# newaliases

確認
[root@falcon21 ~]# vi /etc/aliases


Portチェックテスト【外部からのPort開放確認】で「ホスト名(FQDN) または グローバルIPアドレス」にサーバー名「チェックポート番号」に25または587と入力、「ご注意・制約事項」を確認チェックして「Portチェック実行」
 

結果

ホスト:falcon21.space

ポート:25

にアクセスできました


Portチェックテスト【外部からのPort開放確認】で「ホスト名(FQDN) または グローバルIPアドレス」にサーバー名(「チェックポート番号」に110または143と入力、「ご注意・制約事項」を確認チェックして「Portチェック実行」
 

結果

ホスト:falcon21.space

ポート:110

にアクセスできました


 

投票数:5 平均点:10.00

 
Back to Top