Sendmailの退避
#mv /usr/sbin/sendmail /usr/sbin/sendmail.OFF
#mv /usr/bin/newaliases /usr/bin/newaliases.OFF
#mv /usr/bin/mailq /usr/bin/mailq.OFF

キューの初期化
#/usr/sbin/sendmail.OFF -q

Sendmailの無効化
#chmod 755 /usr/sbin/sendmail.OFF
#chmod 755 /usr/bin/newaliases.OFF
#chmod 755 /usr/bin/mailq.OFF

postfixのインストール
#yum -y install postfix
#cd /etc/postfix

/etc/postfix/main.cf
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = netv01.send.test
mydomain = send.test
myorigin = $myhostname
mynetworks = 192.168.1.0/24, 192.168.2.0/24
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
        PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
        xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.2.8/samples
readme_directory = /usr/share/doc/postfix-2.2.8/README_FILES
transport_maps=hash:/etc/postfix/transport
minimal_backoff_time=30s←最初は30Sで再送を試みる
maximal_backoff_time=240s←240Sになるまで30→60→120と再送間隔を増やしていく
maximal_queue_lifetime=600s←600Sになったらqueueから削除

/etc/postfix/transport
STATIC配送の設定
send.test smtp:[192.168.1.108]
recv.test smtp:[192.168.1.208]

設定後
#postmap transport

セキュリティ関連

バナーを隠す。main.cfに以下を追記。
smtpd_banner = $mydomain ESMTP

Receivedヘッダ中のIPアドレスを隠す。
①/etc/postfix/header_checksファイルに以下を記入
以下の設定では127.0.0.1,192.168.,172.16を消す。
/^Received:\sfrom .*\[127\.0\.0\.1\]|^Received:\sfrom .*\[192\.168.*\]|^Received:\sfrom .*\[172\.16.*\]/ IGNORE
②main.cfに以下を追記
header_checks = regexp:/etc/postfix/header_checks
最終更新:2008年07月14日 00:49