- 1. 概要
- 2. デフォルト
- 3. 設定
- 4. 試験
- 7. 参考サイト
1. 概要
「rspamd」のデフォルトの動作は、スパムメールと判断したら、受信拒否することになっています。
それだと、どこからどんなものが来ているかがわかりにくくなるので、「qmail」「spamassassin」「simscan」の組み合わせのときのように、件名の先頭に「*****spam*****」をつけて、スパム受信専用アドレスに転送したいのです。
2. デフォルト
「rspamd」のデフォルトのふるまいは。
/usr/local/etc/rspamd/actions.conf
に、下記のように記述されています。
# Actions settings
# Please don't modify this file as your changes might be overwritten with
# the next update.
#
# You can modify 'local.d/actions.conf' to add and merge
# parameters defined inside this section
#
# You can modify 'override.d/actions.conf' to strictly override all
# parameters defined inside this section
#
# See https://rspamd.com/doc/faq.html#what-are-the-locald-and-overrided-directories
# for details
#
# See also https://rspamd.com/doc/faq.html#what-are-rspamd-actions for actions definition
actions {
reject = 15; # Reject when reaching this score
add_header = 6; # Add header when reaching this score
greylist = 4; # Apply greylisting when reaching this score (will emit 'soft reject action')
#unknown_weight = 1.0; # Enable if need to set score for all symbols implicitly
# Each new symbol is added multiplied by gf^N, where N is the number of spammy symbols
#grow_factor = 1.1;
# Set rewrite subject to this value (%s is replaced by the original subject)
#subject = "***SPAM*** %s"
.include(try=true; priority=1; duplicate=merge) "$LOCAL_CONFDIR/local.d/actions.conf"
.include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/actions.conf"
}
3. 設定
「root」ユーザ権限で。
vi /usr/local/etc/rspamd/local.d/actions.conf
下記を記述します。
reject = null;
greylist = null;
add_header = null;
rewrite_subject = 6;
subject = "*****spam***** %s";
上記の設定は、「reject」「greylist」「add_header」のアクションにスコアを設定していません。
スコア「6」以上を「rewrite_subject」にして、件名の先頭に「*****spam*****」をつけています。
「/usr/local/etc/rspamd/local.d/actions.conf」は、「/usr/local/etc/rspamd/actions.conf」に優先します。
ちなみに、アクションには、上記「reject」等を含めて、下記のものがあります。
| アクション | 意 味 | 備考 |
reject | 受信拒否 | |
discard | メールをドロップするが、送信者には成功を返す | |
add_header | ヘッダを追加 | |
greylist | グレーリストへ追加 | |
rewrite_subject | 件名を書き換え | |
soft_reject | 一時的に受信を遅延 | |
no_action | 正常に受信 | |
7. 参考サイト
本ページは、「ChatGPT」軍曹および「Gemini」伍長を参考にさせていただきました。
|
|