8
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

DNSBLを利用し迷惑メールの受信を拒否する

Last updated at Posted at 2014-02-12
/etc/postfix/main.cf
smtpd_recipient_restrictions =
  ...
+    reject_rbl_client all.rbl.jp
+    reject_rbl_client bl.spamcop.net,
+    reject_rbl_client zen.spamhaus.org,
  ...
syntax check
/usr/sbin/postfix check
service postfix restart
rejectしたメールがあるか検索
grep "reject:" /var/log/maillog

Spamhausに登録されているかチェック

公式FAQ

11.22.33.44のサーバーをチェック
*/10 * * * * /usr/bin/dig +short 44.33.22.11.zen.spamhaus.org

応答があれば登録されている。

例: 127.0.0.4と返答が来る。

大量にチェックしたい場合

checker.sh
#!/bin/sh

reverse_ip() {
    echo $1 | awk -F . '{printf "%d.%d.%d.%d", $4,$3,$2,$1}'
}

check_spamhaus() {
  for i in `seq -w $2 $3`
  do
    RESULT=$(dig +short ${i}.${1}.zen.spamhaus.org)
    if [ ! -z "$RESULT" ];then
        echo -n "http://www.spamhaus.org/query/bl?ip="
        reverse_ip "${i}.$1"
    fi
  done
}
check_spamhaus "33.22.11" 1 254

11.22.33.1~.254までチェックしてくれる。

8
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?