dポイントプレゼントキャンペーン実施中!

Red Hat Linux 8.0とsendmailとqpopperを使用してメールサーバーを構築しています。
/var/log/maillogに1時間に一回、200行ほどのログが一気に書き込まれ
ログの容量が肥大化して困っています。
ログの一部は
Feb 6 21:14:01 xxxx sm-msp-queue[680]: h15L4fBd004705: to=root, delay=15:09:16, xdelay=00:03:09, mailer=relay, pri=121617, relay=[localhost] [1.0.0.127], dsn=4.0.0, stat=Deferred: Connection timed out with [localhost]
Feb 6 21:14:01 xxxx sm-msp-queue[680]: h15L4fBe004705: to=root, delay=15:09:15, xdelay=00:00:00, mailer=relay, pri=121617, relay=[localhost], dsn=4.0.0, stat=Deferred: Connection timed out with [localhost]
Feb 6 21:14:01 xxxx sm-msp-queue[680]: h15L4fBf004705: to=root, delay=15:09:15, xdelay=00:00:00, mailer=relay, pri=121617, relay=[localhost], dsn=4.0.0, stat=Deferred: Connection timed out with [localhost]
Feb 6 21:14:01 xxxx sm-msp-queue[680]: h15L4fBg004705: to=root, delay=15:09:15, xdelay=00:00:00, mailer=relay, pri=121617, relay=[localhost], dsn=4.0.0, stat=Deferred: Connection timed out with [localhost]
Feb 6 21:14:01 xxxx sm-msp-queue[680]: h15L4fBh004705: to=root, delay=15:09:15, xdelay=00:00:00, mailer=relay, pri=121617, relay=[localhost], dsn=4.0.0, stat=Deferred: Connection timed out with [localhost]
Feb 6 21:14:01 xxxx sm-msp-queue[680]: h15L4fBi004705: to=root, delay=15:09:14, xdelay=00:00:00, mailer=relay, pri=121617, relay=[localhost], dsn=4.0.0, stat=Deferred: Connection timed out with [localhost]

このような感じです。どすれば止まるでしょうか?
困っています、教えて頂けませんか。
(xxxxは自分の設定したドメインの頭です xxxx.ne.jp)

A 回答 (6件)

localhostを理解されていないかと思います。


/etc/hostsは

192.168.0.3 xxxx.ne.jp
127.0.0.1 localhost.xxxx.ne.jp localhost

とすべきです。場合によっては、
::1 localhost.xxx.ne.jp localhost
を追加してみてください。

ところで、xxx.ne.jpはプライベートのようですが、それでいいのでしょうか?
    • good
    • 0
この回答へのお礼

/etc/hostsを正しく修正してみました。
取り敢えずはこれで滝のようなログは来なくなりました。
これが原因だったのですね?有り難う御座います。

お礼日時:2003/02/07 23:01

192.168.0.3 mail.xxxx.ne.jp mail



普通こうやりませんか? ホスト名を付けないのが最近のはやりですか。

>別のドメインを使っているか、と言うことでしょうか?
>mailもhttpもftpもすべて同じものを使っています。
mailサーバをhttpやftpサーバにも使っていて、IP Aliasの使用有無に関わらず別名を使っているかという意味です。

名前解釈のテストは、
/usr/sbin/sendmail -bt -d0.2 -v
を実行して #3の全てのパターンを行ってください。コンソール出力の最後の行を確認してください(別名を定義している場合はそれも)。

最後の架空ドメイン、つまり外部配送が $# smtp、それ以外は $# localになるのが正しい設定です。
    • good
    • 0

1時間に一回とのことなので、てっきりrootあてのシステムレポート(logchk等)がローカル配送出来ていないと思ったのですが。



sendmailを止めると来なくなるのというのは本当ですね。
システムレポートなら sendmail daemonは動いてなくてもちゃんと配送されるはずだし、メールキューも空っぽなので、やはり sendmail.cf ですかね。

とりあえず、テストモードで sendmailを実行して、いろんなパターンでどうなるかテストしてください。

----------------
user
user@localhost
user@host
user@host.domain
user@domain
user@xxx.yyy.zzz
----------------
一番下を除きすべてローカル配送になるか。
(xxx.yyy.zzzは架空のドメイン)

あと、mailサーバに別名を定義してますか。している場合それ用の設定もしてありますか。

この回答への補足

sendmail.cf を作ったときの手順ですが

sendmail.mcの
次の行をコメントアウトしました。
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
dnl EXPOSED_USER(`root')dnl

かえたのはここだけです。
後は、m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf でcfを作成しました。

>>テストモードで sendmailを実行して、
telnet localhost 25
Trying 192.168.0.3..
Connected to localhost.
Escape character is '^]'.
220 xxxx.ne.jp ESMTP
HELO localhost
250 xxxx.ne.jp Hello xxxx.ne.jp [192.168.0.3], pleased to meet you
MAIL FROM:aaaa@localhost
250 2.1.0 aaaa@localhost... Sender ok
RCPT TO:bbbb@localhost
250 2.1.5 bbbb@localhost... Recipient ok
DATA
354 Enter mail, end with "." on a line by itself
FROM:aaaa@localhost
subject:a
hello
.
250 2.0.0 h16LW1AM000950 Message accepted for delivery
quit
221 2.0.0 xxxx.ne.jp closing connection
Connection closed by foreign host.

windowsマシンでtelnetで操作しましたが、local配送できています。
この時のログは
Feb 7 06:35:07 xxxx sendmail[950]: h16LW1AM000950: from=aaaa@localhost, size=37, class=0, nrcpts=1, msgid=<200302062133.h16LW1AM000950@xxxx.ne.jp>, proto=SMTP, daemon=MTA, relay=xxxx.ne.jp [192.168.0.3]
Feb 7 06:35:08 xxxx sendmail[967]: h16LW1AM000950: to=bbbb@localhost, ctladdr=aaaa@localhost (505/505), delay=00:01:15, xdelay=00:00:01, mailer=local, pri=30288, dsn=2.0.0, stat=Sent

となっています。
(ちゃんとsendmailと出ていて、sm-msp-queueとは出ていません。
sm-msp-queueとは何でしょうか。)

>>あと、mailサーバに別名を定義してますか
別のドメインを使っているか、と言うことでしょうか?
mailもhttpもftpもすべて同じものを使っています。

補足日時:2003/02/07 06:27
    • good
    • 0

URLが長いのでこちらに示しますが、



http://www.mail-archive.com/cgi-bin/htsearch?met …

で検索したところ、/etc/hostsに
::1 localhost localhost.yourdomain
というような行をいれてみてはということです。これはIPv6のlocalhostです。
だめもとでどうぞ。

この回答への補足

現在 /etc/hosts は

192.168.0.3 xxxx.ne.jp localhost
127.0.0.1 xxxx.ne.jp localhost
127.0.0.1 localhost.xxxx.ne.jp localhost

のように設定しています。
(xxxx.ne.jpは自分のドメイン)

あとログが少し?変わったみたいです。

Feb 7 06:11:49 xxxx sm-msp-queue[679]: h16FJw0P000678: to=root, delay=05:50:28, xdelay=00:00:00, mailer=relay, pri=211616, relay=xxxx.ne.jp., dsn=4.0.0, stat=Deferred: Connection refused by xxxx.ne.jp.
Feb 7 06:11:49 xxxx sm-msp-queue[679]: h16F7JXk002153: to=postmaster, delay=06:00:59, xdelay=00:00:00, mailer=relay, pri=302823, relay=xxxx.ne.jp., dsn=4.0.0, stat=Deferred: Connection refused by xxxx.ne.jp.
Feb 7 06:11:50 xxxx sm-msp-queue[679]: h16F7JXl002153: to=postmaster, delay=06:01:00, xdelay=00:00:00, mailer=relay, pri=302973, relay=xxxx.ne.jp., dsn=4.0.0, stat=Deferred: Connection refused by xxxx.ne.jp.
Feb 7 06:12:19 xxxx sm-msp-queue[679]: h16EF5eJ001774: to=root, ctladdr=root (0/0), delay=06:57:14, xdelay=00:00:00, mailer=relay, pri=390265, relay=xxxx.ne.jp., dsn=4.0.0, stat=Deferred: Connection refused by xxxx.ne.jp.
Feb 7 06:12:19 xxxx sm-msp-queue[679]: h16EF5eJ001774: h16LBY92000679: sender notify: Warning: could not send message for past 4 hours
Feb 7 06:12:20 xxxx sm-msp-queue[679]: h16LBY92000679: to=root, delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=31617, relay=xxxx.ne.jp., dsn=4.0.0, stat=Deferred: Connection refused by xxxx.ne.jp.

補足日時:2003/02/07 06:20
    • good
    • 0

ローカル配送用のデーモン(2行目)は動いてますか?



#ps ax | grep sendmail

524 ? S 0:00 sendmail: accepting connections
534 ? S 0:00 sendmail: Queue runner@01:00:00 for /var/spool/client
755 pts/0 S 0:00 grep sendmail

この回答への補足

ps ax | grep sendmail と打ち込んだところ
667 ? S 0:00 sendmail: accepting connections
677 ? S 0:00 sendmail: Queue runner@01:00:00 for /var/spool/client
905 pts/0 S 0:00 grep sendmail

のようになりましたので、動いているかと思います。

補足日時:2003/02/07 06:15
    • good
    • 0

rootあてのメールがキューにたまってるのに、localhostに送ろうとしています。



rootがメールを受け取れる設定になっているかどうか(変な転送の設定をしていないか)、localhostがsmtpの接続できる状態か(パケットフィルタリングしてないか)、調べてください。

キューに何が入っているかはmailqコマンドで調べられます。キューの中身は消すのは簡単ですが、rootがちゃんと受け取れるようにするのが先決でしょう。

この回答への補足

早速のお返事ありがとございます。

>> rootがメールを受け取れる設定になっているかどうか

これは、/var/spool/mail/root にメールが溜まっていればいいわけですよね?
cronなどから、メールが来ていますので大丈夫だと思います。

>> localhostがsmtpの接続できる状態か
telnet localhost 25 で接続が可能です。


>> キューに何が入っているかは

/var/spool/mqueue is empty
Total requests: 0

こういうメッセージが出ました。

これでもまだ駄目でしょうか?まだログが書き込まれ続けています。
sendmailを止めると来なくなるのですが。
sendmail.cfの設定がマズイのでしょうか。

補足日時:2003/02/07 00:08
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!