SMTPサーバ
対象バージョン
postfix-2.2.2-2
インストール
Fedora Core 4では標準のメールサーバとしてsendmailが起動しています。
こちらは使用しませんので、まず始めにsendmailサービスを停止します。
続いて新たにPostfixのパッケージを1つインストールします。
DVD-ROMドライブにFedora Core 4のDVD-ROMをセットします。
# /etc/rc.d/init.d/sendmail stop[Enter]
# mount /media/cdrom[Enter]
# cd /media/cdrom/Fedora/RPMS[Enter]
# rpm -ihv postfix-2.2.2-2.i386.rpm[Enter]
# cd /[Enter]
# umount /media/cdrom[Enter]
# mount /media/cdrom[Enter]
# cd /media/cdrom/Fedora/RPMS[Enter]
# rpm -ihv postfix-2.2.2-2.i386.rpm[Enter]
# cd /[Enter]
# umount /media/cdrom[Enter]
設定
Postfixのインストールが終了した時点でsendmailとPostfixの
2つのメールサービスがインストールされていることになります。
ここでは標準のメールサービスをPostfixに切り替えます。
ここではメールサーバの基本的な設定を行います。 viエディタで設定ファイルを開きます。
ファイル( /etc/postfix/main.cf )
設定が終わったら、rcスクリプトを使用してSMTPサービスを起動します。 ランレベルの設定は始めから自動起動になっているので変更不要です。
# alternatives --config mta[Enter]
2 プログラムがあり 'mta' を提供します。
選択 コマンド
-----------------------------------------------
*+ 1 /usr/sbin/sendmail.sendmail
2 /usr/sbin/sendmail.postfix
Enter を押して現在の選択 [+] を保持するか、選択番号を入力します:2[Enter]
2 プログラムがあり 'mta' を提供します。
選択 コマンド
-----------------------------------------------
*+ 1 /usr/sbin/sendmail.sendmail
2 /usr/sbin/sendmail.postfix
Enter を押して現在の選択 [+] を保持するか、選択番号を入力します:2[Enter]
ここではメールサーバの基本的な設定を行います。 viエディタで設定ファイルを開きます。
# vi /etc/postfix/main.cf[Enter]
ファイル( /etc/postfix/main.cf )
※該当箇所のみ変更※
#myhostname = host.domain.tld
↓変更
myhostname = svr1.ranonet.ne.jp
#mydomain = domain.tld
↓変更
mydomain = ranonet.ne.jp
#myorigin = $mydomain
↓変更
myorigin = $mydomain
#inet_interfaces = all
↓変更
inet_interfaces = all
inet_interfaces = localhost
↓変更
#inet_interfaces = localhost
mydestination = $myhostname, localhost.$mydomain, localhost
↓変更
#mydestination = $myhostname, localhost.$mydomain, localhost
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
↓変更
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
#mynetworks = 168.100.189.0/28, 127.0.0.0/8
↓変更
mynetworks = 192.168.0.0/24, 127.0.0.0/8
#myhostname = host.domain.tld
↓変更
myhostname = svr1.ranonet.ne.jp
#mydomain = domain.tld
↓変更
mydomain = ranonet.ne.jp
#myorigin = $mydomain
↓変更
myorigin = $mydomain
#inet_interfaces = all
↓変更
inet_interfaces = all
inet_interfaces = localhost
↓変更
#inet_interfaces = localhost
mydestination = $myhostname, localhost.$mydomain, localhost
↓変更
#mydestination = $myhostname, localhost.$mydomain, localhost
#mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
↓変更
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
#mynetworks = 168.100.189.0/28, 127.0.0.0/8
↓変更
mynetworks = 192.168.0.0/24, 127.0.0.0/8
設定が終わったら、rcスクリプトを使用してSMTPサービスを起動します。 ランレベルの設定は始めから自動起動になっているので変更不要です。
# /etc/rc.d/init.d/postfix start[Enter]
