質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

Postfix

Postfixは、電子メールサーバソフトウェアで、 メールを配送するシステムMTAの一種です。

Q&A

解決済

1回答

11876閲覧

Postfixにて、mailコマンドが利用できない

kumakumatan

総合スコア213

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

Postfix

Postfixは、電子メールサーバソフトウェアで、 メールを配送するシステムMTAの一種です。

0グッド

0クリップ

投稿2016/04/06 00:36

CentOS release 6.5 (Final)にて、postfixを利用してmailコマンドにてメール送信
しようと考えています。

mailxはインストール済みです(mailx.x86_64 12.4-8.el6_6 @base )。
「alternatives --config mta」コマンドにてmtaを確認すると、
「/usr/sbin/sendmail.postfix」になっています。

コマンドにて、「mail abc@test.co.jp」と入力すると、
「send-mail: fatal: config variable inet_interfaces: host not found: inet_protocols」
と表示されてしまいます。

その時の/var/log/maillogは、

DB01 postfix/master[1851]: warning: process /usr/libexec/postfix/qmgr pid 3713 exit status 1
DB01 postfix/master[1851]: warning: /usr/libexec/postfix/qmgr: bad command startup -- throttling
DB01 postfix/master[1851]: warning: process /usr/libexec/postfix/smtpd pid 3714 exit status 1
DB01 postfix/master[1851]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
DB01 postfix/pickup[3715]: fatal: config variable inet_interfaces: host not found: inet_protocols
DB01 postfix/master[1851]: warning: process /usr/libexec/postfix/pickup pid 3715 exit status 1
DB01 postfix/master[1851]: warning: /usr/libexec/postfix/pickup: bad command startup -- throttling
DB01 postfix/trivial-rewrite[3741]: fatal: config variable inet_interfaces: host not found: inet_protocols
DB01 postfix/master[1851]: warning: process /usr/libexec/postfix/trivial-rewrite pid 3741 exit status 1
DB01 postfix/master[1851]: warning: /usr/libexec/postfix/trivial-rewrite: bad command startup -- throttling
DB01 postfix/sendmail[3757]: fatal: config variable inet_interfaces: host not found: inet_protocols
DB01 postfix/smtpd[3759]: fatal: config variable inet_interfaces: host not found: inet_protocols
DB01 postfix/qmgr[3758]: fatal: config variable inet_interfaces: host not found: inet_protocols
DB01 postfix/master[1851]: warning: process /usr/libexec/postfix/qmgr pid 3758 exit status 1
DB01 postfix/master[1851]: warning: /usr/libexec/postfix/qmgr: bad command startup -- throttling
DB01 postfix/master[1851]: warning: process /usr/libexec/postfix/smtpd pid 3759 exit status 1
DB01 postfix/master[1851]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
DB01 postfix/pickup[3760]: fatal: config variable inet_interfaces: host not found: inet_protocols
DB01 postfix/master[1851]: warning: process /usr/libexec/postfix/pickup pid 3760 exit status 1
DB01 postfix/master[1851]: warning: /usr/libexec/postfix/pickup: bad command startup -- throttling
DB01 postfix/trivial-rewrite[3774]: fatal: config variable inet_interfaces: host not found: inet_protocols
DB01 postfix/master[1851]: warning: process /usr/libexec/postfix/trivial-rewrite pid 3774 exit status 1
DB01 postfix/master[1851]: warning: /usr/libexec/postfix/trivial-rewrite: bad command startup -- throttling

と表示されます。

「service postfix restart」とすると、
Shutting down postfix: [FAILED]
Starting postfix: [FAILED]
と表示されてしまいます。
以前は、「/etc/postfix/main.cf」の設定を特にしなくてもmailコマンドは利用できたのですが、
何か設定などはあるのでしょうか?
また、postfixのステータスを見ると、「-b (pid 1851) is running...」となって起動はしているみたいです。

どうすれば「mail」コマンドにてメール送信をできるようになりますでしょうか?

宜しくお願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

Postfix の設定を確認してください。
main.cf で inet_interfaces と inet_protocols が別の行であるところが 1行になっていませんか?
設定修正後、postfix check でエラーが出力されないことを確認ください。

投稿2016/04/06 00:56

TaichiYanagiya

総合スコア12146

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

kumakumatan

2016/04/06 01:04

ご回答ありがとうございます。 inet_interfaces = localhost inet_protocols = IPv4 と別の行になっています。 「postfix check」をすると、 postfix: fatal: config variable inet_interfaces: host not found: inet_protocols となってしまいます。 宜しくお願いします。
TaichiYanagiya

2016/04/06 01:16

なぜでしょうね? localhost の後に空白が続いていて、改行されているように見えているけれど実際には改行されていないとか? 「postconf -n | cat -n -」で行番号とともに出力するとどうなりますか?
kumakumatan

2016/04/06 01:38

ありがとうございます。 「postconf -n | cat -n - /etc/postfix/main.cf」にて行番号を確認すると、同じ行にありました。修正後「postfix check」をすると、今度は、 「postfix: fatal: unknown inet_protocols value "IPv4" in "IPv4"」 と表示されてしまい、mail送信できないです。
TaichiYanagiya

2016/04/06 01:44

「ipv4」と小文字で設定する必要があります。 「man 5 postconf」を参照ください。
kumakumatan

2016/04/06 01:57

ありがとうございます。上記のメッセージは消えたのですが、 今度は、「postfix: fatal: config variable inet_interfaces: host not found: inet_protocols」と表示されてしまいます。
kumakumatan

2016/04/06 02:04

追記です。 「postconf -n | cat -n - /etc/postfix/main.cf」にて行番号を確認すると、inet_interfaces と inet_protocols が違う行になっています。
kumakumatan

2016/04/06 03:01

ipv4の行頭で空白文字が存在していた為でした。 空白カットをしたら、エラーがなくなり、起動できるようになりました。 ネットワークの設定にて、許可する事項はsmtp25番ポートのINとOUTのみでよかったでしょうか? 宜しくお願いします。
kumakumatan

2016/04/06 03:28

maillogを見ると、 DB01 postfix/pickup[9615]: C3DDA2222: uid=0 from=<root> DB01 postfix/cleanup[10327]: C3DDA2222: message-id=<2016040603 2008.C7DDA2222@DB01.localdomain> DB01 postfix/qmgr[9616]: C3DDA2222: from=<root@DB01.localdom DB01 postfix/smtp[10329]: connect to mail.test.co.jp[xxx.xxx.xxx.xxx]:25: Connection timed out DB01 postfix/smtp[10329]: C3DDA2222: to=<ABC@a.test.co.jp>, relay=none, delay=30, delays=0.06/0.01/30/0, dsn=4.4.1, status=deferred (connect to mail.test.co.jp[xxx.xxx.xxx.xxx]:25: Connection timed out) となって送信できていません。postfixは正常起動しています。 宜しくお願いします。
kumakumatan

2016/04/06 05:44

ありがとうございます。 ポートのout(出口)を許可したら送信できました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問