HAYAGUI

FreeBSD 4.5 + sendmail で UBE(SPAM)受信拒否

はじめに

SPAMメールなどの UBE(Unsolicited Bulk Email)を、sendmail の設定で受信拒否する方法を記します。

sendmail のバージョンは、FreeBSD 4.5 付属の 8.11.6 です。

> telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.hayagui.com.
Escape character is '^]'.
220 eden.hayagui.com ESMTP Sendmail 8.11.6/8.11.6; Thu, 8 Aug 2002 00:00:02 +090
0 (JST)
quit
221 2.0.0 eden.hayagui.com closing connection
Connection closed by foreign host.
>

/etc/mail/access を作成

mailの設定ファイルは、/etc/mail にあります。
eden# cd /etc
eden# cd mail
eden# ls
Makefile                aliases.db              mailer.conf
README                  freebsd.cf              mailertable.sample
access.sample           freebsd.mc              sendmail.cf
aliases                 helpfile                virtusertable.sample
freebsd.mc に、以下のように設定されているので、
FEATURE(access_db, `hash -o /etc/mail/access')
ここに、access というファイルを作成しますが、サンプルを見てみましょう。

eden# cat access.sample
# $FreeBSD: src/etc/mail/access.sample,v 1.1.2.2 2000/11/03 07:23:50 dirk Exp $
#
# Mail relay access control list.  Default is to reject mail unless the
# destination is local, or listed in /etc/mail/local-host-names
#
cyberspammer.com                550 We don't accept mail from spammers
FREE.STEALTH.MAILER@            550 We don't accept mail from spammers
another.source.of.spam          REJECT
okay.cyberspammer.com           OK
128.32                          RELAY
eden#
で、こんな感じに /etc/mail/access ファイルを作成して、 以下のように設定してみます。
hoge@eden.hayagui.com   REJECT
保存したら、データベースを作成します。
eden# makemap hash /etc/mail/access < /etc/mail/access

動作確認

メーラーのWinbiffを使って、hoge@eden.hayagui.com にメールを出すと、以下のようなメッセージボックスが表示されました。 このメールアドレスは、架空です。

なるほど。


戻る



(C)1999 - 2002 Kenji Ito All rights reserved.