R.A. Epigonos et al.

[exim] Mail failure - message too big を解決するには message_size_limit を増やす

cron の結果を通知するメールのサイズが大きすぎたことが原因で (Mail failure - message too big) となってしまい、メッセージの大部分が捨てられた問題。

以下の様な感じのメールが通知される。

Return-path: <>
Received: from Debian-exim by ****************** with local (Exim 4.84)
        id ********************************
        for ************@************; ***, ** *** **** 15:27:51 +0900
To: ************@************
Subject: Mail failure - message too big
From: Mail Delivery System <Mailer-Daemon@************>
Envelope-to: ************@************
Delivery-date: ***, ** *** **** 15:27:51 +0900
Auto-Submitted: auto-replied
Message-Id: <*****************@******************>
Date: ***, ** *** **** 15:27:50 +0900

A message that you sent was longer than the maximum size allowed on this
system. It was not delivered to any recipients.

------ This is a copy of your message, including all the headers.
------ No more than 100K characters of the body are included.

From: root (Cron Daemon)
From: root@************ (Cron Daemon)
To: ************
To: ************@************
Subject: Cron <************@************> hoge

exim の設定をダンプするには "exim -bP" を使う。今回問題になっているのは、message_size_limit の値。問題になっている変数の名前がわかっていれば コマンド引数として与えることも可能。

# exim -bP | grep message_size_limit
message_size_limit = 50M
# exim -bP message_size_limit
message_size_limit = 50M

message_size_limit の定義されている設定ファイルを検索。陽に指定しているファイルはない感じ

# find /etc/default/ /etc/exim4/ -type f -print0 | xargs -0 -r grep -i message_size_limit
/etc/exim4/exim4.conf.template:# Message size limit. The default (used when MESSAGE_SIZE_LIMIT
/etc/exim4/exim4.conf.template:.ifdef MESSAGE_SIZE_LIMIT
/etc/exim4/exim4.conf.template:message_size_limit = MESSAGE_SIZE_LIMIT
/etc/exim4/conf.d/main/02_exim4-config_options:# Message size limit. The default (used when MESSAGE_SIZE_LIMIT
/etc/exim4/conf.d/main/02_exim4-config_options:.ifdef MESSAGE_SIZE_LIMIT
/etc/exim4/conf.d/main/02_exim4-config_options:message_size_limit = MESSAGE_SIZE_LIMIT

そこで /etc/exim4/conf.d/main/02_exim4-config_options を読むと以下の様な感じで説明されている。デフォルトは50MBで、現状はその値が使われている様子。

# grep -A 1 -i MESSAGE_SIZE_LIMIT /etc/exim4/conf.d/main/02_exim4-config_options
# Message size limit. The default (used when MESSAGE_SIZE_LIMIT
# is unset) is 50 MB
.ifdef MESSAGE_SIZE_LIMIT
message_size_limit = MESSAGE_SIZE_LIMIT
.endif

マクロの値を変えるには/etc/exim4/exim4.conf.localmacrosを使う。以下のようにする。

# echo 'MESSAGE_SIZE_LIMIT=100M' > /etc/exim4/exim4.conf.localmacros
# update-exim4.conf
# service exim4 restart
# exim -bP | grep message_size_limit
message_size_limit = 100M

リファレンス

  1. exim(8): Mail Transfer Agent - Linux man page
  2. Exim - Debian Wiki

ソーシャルブックマーク

  1. はてなブックマーク
  2. Google Bookmarks
  3. del.icio.us

ChangeLog

  1. Posted: 2008-06-04T16:20:45+09:00
  2. Modified: 2008-06-04T16:20:45+09:00
  3. Generated: 2023-08-27T23:09:13+09:00