FC4/sendmail/MTA としての sendmail の設定(メールを送るために最低限度すべき事)
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
#contents
----
* sendmail? [#peba31f4]
Fedora Core 4 では標準の MTA として sendmail(センドメー...
とりあえず最低限使うための設定をここに記述します。詳し...
* 設定ファイルの場所 [#x8263d26]
sendmail の諸設定ファイルは /etc/mail 以下のディレクト...
$ ls -al /etc/mail
合計 276
drwxr-xr-x 3 root root 4096 6月 14 19:13 .
drwxr-xr-x 93 root root 12288 6月 24 20:05 ..
-rw-r--r-- 1 root root 1035 5月 6 21:35 Makefile
-rw-r--r-- 1 root root 331 5月 6 21:35 access
-rw-r----- 1 root root 12288 6月 14 19:09 access.db
-rw-r--r-- 1 root root 0 5月 6 21:35 domaintable
-rw-r----- 1 root root 12288 6月 14 19:09 domaintable...
-rw-r--r-- 1 root root 5588 5月 6 21:35 helpfile
-rw-r--r-- 1 root root 64 5月 6 21:35 local-host-...
-rw-r--r-- 1 root root 0 5月 6 21:35 mailertable
-rw-r----- 1 root root 12288 6月 14 19:09 mailertable...
-rw-r--r-- 1 root root 58079 6月 14 19:09 sendmail.cf
-rw-r--r-- 1 root root 7069 5月 6 21:35 sendmail.mc
drwxr-xr-x 2 root root 4096 6月 14 19:13 spamassassin
-r--r--r-- 1 root root 41348 5月 6 21:35 submit.cf
-rw-r--r-- 1 root root 952 5月 6 21:35 submit.mc
-rw-r--r-- 1 root root 127 5月 6 21:35 trusted-users
-rw-r--r-- 1 root root 0 5月 6 21:35 virtusertable
-rw-r----- 1 root root 12288 6月 14 19:09 virtusertab...
このなかで頻繁にお世話になるのが【 access 】と【 sendma...
** local-host-names の編集 [#z21f73b6]
/etc/mail/local-host-names
このファイルの中にサーバが扱う(このサーバにメールが送...
たとえば、該当サーバで【 ユーザ@example.jp 】と【 ユー...
# local-host-names - include all aliases for your machin...
example.jp
hoehoe.jp
この記述は「サーバが扱うメールのドメイン名」の定義です...
** sendmail.mc の設定 [#uf6f3967]
sendmail.mc は sendmail の設定ファイル sendmail.cf の元...
vi /etc/mail/sendmail.mc
などで、ファイルを編集します。
編集点は下記の通りです。まず 112 行目を変更します。
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
初期状態では 127.0.0.1(自分自身)に対してのみ SMTP ポー...
DAEMON_OPTIONS(`Port=smtp,Addr=210.239.46.254, Name=MTA'...
Addr の後ろに該当サーバの IP アドレスを記述するか、以下...
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')...
次は 151 行目の編集です。
LOCAL_DOMAIN(`localhost.localdomain')dnl
初期状態ではこのように、自ホスト名が localhost.localdom...
このままではメールの配送に支障が出ますので、自分のホス...
LOCAL_DOMAIN(`hoehoe.jp')dnl
このように書き換えます。
最後に、自ホスト名を Cw で定義します。sendmail.mc の末...
Cwhoehoe.jp
このようにして記述しておきます。この記述は無くてもよい...
以上で sendmail.m4 の最低限の設定は終わりです。
** sendmail.mc から sendmail.cf の作成 [#a03f7f69]
次のコマンドを実行して sendmail.cf の構築を行います。
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
実行しても特に結果は出ません。sendmail.cf ファイルがこ...
** /etc/mail/access による利用者の制限 [#r3e97d82]
このファイルで「制限」を行わないと、世界中の誰でもその...
vi エディタでファイルを開き【許可する環境 RELAY】のよ...
# Check the /usr/share/doc/sendmail/README.cf file for a...
# of the format of this file. (search for access_db in t...
# The /usr/share/doc/sendmail/README.cf is part of the s...
# package.
#
# by default we allow relaying from localhost...
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
example.jp RELAY
192.168. RELAY
記述が終わったら access.db ファイルを構築します(sendma...
# makemap hash /etc/mail/access.db < /etc/mail/access
この access ファイルに記述されていない環境から送信を試...
Jun 24 20:54:02 sion sendmail[4937]: j5OBs2fs004937: rul...
arg1=<to@example.jp>, relay=dhcp102.internal [192.168.11...
reject=550 5.7.1 <from@example.jp>... Relaying denied
【 reject=550 5.7.1 】の【 Relaying denied 】=メールの...
** sendmail の起動テスト [#bdc00684]
# /sbin/service sendmail start
sendmail を起動中: ...
sm-client を起動中: ...
特に問題なければ、そのまま OK と表示されます。
** sendmail の自動起動設定 [#h2cbb310]
初期状態で sendmail パッケージが選択されていれば、自動...
# /sbin/chkconfig --list sendmail
sendmail 0:off 1:off 2:on 3:on 4:on ...
もし自動起動しないような設定であれば、chkconfig で変更...
# /sbin/chkconfig sendmail on
----
引き続きメール受信サーバ(MRA) dovecot の設定を行う場合...
[[dovecot による MRA(メール受信サーバ)を用いた pop3,pop3s...
終了行:
#contents
----
* sendmail? [#peba31f4]
Fedora Core 4 では標準の MTA として sendmail(センドメー...
とりあえず最低限使うための設定をここに記述します。詳し...
* 設定ファイルの場所 [#x8263d26]
sendmail の諸設定ファイルは /etc/mail 以下のディレクト...
$ ls -al /etc/mail
合計 276
drwxr-xr-x 3 root root 4096 6月 14 19:13 .
drwxr-xr-x 93 root root 12288 6月 24 20:05 ..
-rw-r--r-- 1 root root 1035 5月 6 21:35 Makefile
-rw-r--r-- 1 root root 331 5月 6 21:35 access
-rw-r----- 1 root root 12288 6月 14 19:09 access.db
-rw-r--r-- 1 root root 0 5月 6 21:35 domaintable
-rw-r----- 1 root root 12288 6月 14 19:09 domaintable...
-rw-r--r-- 1 root root 5588 5月 6 21:35 helpfile
-rw-r--r-- 1 root root 64 5月 6 21:35 local-host-...
-rw-r--r-- 1 root root 0 5月 6 21:35 mailertable
-rw-r----- 1 root root 12288 6月 14 19:09 mailertable...
-rw-r--r-- 1 root root 58079 6月 14 19:09 sendmail.cf
-rw-r--r-- 1 root root 7069 5月 6 21:35 sendmail.mc
drwxr-xr-x 2 root root 4096 6月 14 19:13 spamassassin
-r--r--r-- 1 root root 41348 5月 6 21:35 submit.cf
-rw-r--r-- 1 root root 952 5月 6 21:35 submit.mc
-rw-r--r-- 1 root root 127 5月 6 21:35 trusted-users
-rw-r--r-- 1 root root 0 5月 6 21:35 virtusertable
-rw-r----- 1 root root 12288 6月 14 19:09 virtusertab...
このなかで頻繁にお世話になるのが【 access 】と【 sendma...
** local-host-names の編集 [#z21f73b6]
/etc/mail/local-host-names
このファイルの中にサーバが扱う(このサーバにメールが送...
たとえば、該当サーバで【 ユーザ@example.jp 】と【 ユー...
# local-host-names - include all aliases for your machin...
example.jp
hoehoe.jp
この記述は「サーバが扱うメールのドメイン名」の定義です...
** sendmail.mc の設定 [#uf6f3967]
sendmail.mc は sendmail の設定ファイル sendmail.cf の元...
vi /etc/mail/sendmail.mc
などで、ファイルを編集します。
編集点は下記の通りです。まず 112 行目を変更します。
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
初期状態では 127.0.0.1(自分自身)に対してのみ SMTP ポー...
DAEMON_OPTIONS(`Port=smtp,Addr=210.239.46.254, Name=MTA'...
Addr の後ろに該当サーバの IP アドレスを記述するか、以下...
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')...
次は 151 行目の編集です。
LOCAL_DOMAIN(`localhost.localdomain')dnl
初期状態ではこのように、自ホスト名が localhost.localdom...
このままではメールの配送に支障が出ますので、自分のホス...
LOCAL_DOMAIN(`hoehoe.jp')dnl
このように書き換えます。
最後に、自ホスト名を Cw で定義します。sendmail.mc の末...
Cwhoehoe.jp
このようにして記述しておきます。この記述は無くてもよい...
以上で sendmail.m4 の最低限の設定は終わりです。
** sendmail.mc から sendmail.cf の作成 [#a03f7f69]
次のコマンドを実行して sendmail.cf の構築を行います。
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
実行しても特に結果は出ません。sendmail.cf ファイルがこ...
** /etc/mail/access による利用者の制限 [#r3e97d82]
このファイルで「制限」を行わないと、世界中の誰でもその...
vi エディタでファイルを開き【許可する環境 RELAY】のよ...
# Check the /usr/share/doc/sendmail/README.cf file for a...
# of the format of this file. (search for access_db in t...
# The /usr/share/doc/sendmail/README.cf is part of the s...
# package.
#
# by default we allow relaying from localhost...
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
example.jp RELAY
192.168. RELAY
記述が終わったら access.db ファイルを構築します(sendma...
# makemap hash /etc/mail/access.db < /etc/mail/access
この access ファイルに記述されていない環境から送信を試...
Jun 24 20:54:02 sion sendmail[4937]: j5OBs2fs004937: rul...
arg1=<to@example.jp>, relay=dhcp102.internal [192.168.11...
reject=550 5.7.1 <from@example.jp>... Relaying denied
【 reject=550 5.7.1 】の【 Relaying denied 】=メールの...
** sendmail の起動テスト [#bdc00684]
# /sbin/service sendmail start
sendmail を起動中: ...
sm-client を起動中: ...
特に問題なければ、そのまま OK と表示されます。
** sendmail の自動起動設定 [#h2cbb310]
初期状態で sendmail パッケージが選択されていれば、自動...
# /sbin/chkconfig --list sendmail
sendmail 0:off 1:off 2:on 3:on 4:on ...
もし自動起動しないような設定であれば、chkconfig で変更...
# /sbin/chkconfig sendmail on
----
引き続きメール受信サーバ(MRA) dovecot の設定を行う場合...
[[dovecot による MRA(メール受信サーバ)を用いた pop3,pop3s...
ページ名: