2005年4月20日

SpamAssassin

メール来ないけどスパム対策
学習型フィルター搭載らしい
Sendmail → milter → SpamAssassin
milter は仲介役みたいな感じ

apt-get install spamass-milter

新しいバージョンを欲しがるので
Depends: libgcc1 (>= 1:3.4.1-3) but 1:3.0.4-7 is to be installed
Depends: libstdc++5 (>= 1:3.3.4-1) but it is not going to be installed

apt-get install libgcc1/unstable libstdc++5/unstable
apt-get install spamass-milter/unstable

本体が一緒に入らない
こっちも unstable 入れないと変な動きする
apt-get install spamassassin/unstable
→ apt-get install debconf/unstable
→ apt-get install perl-base/unstable perl-modules/unstable perl/unstable
→ apt-get install libhtml-parser-perl/unstable libdigest-sha1-perl/unstable

※ unstable は自己責任で


デーモンモードにする
/etc/default/spamassassin

ENABLED=1

milter設定
/etc/mail/sendmail.mc

INPUT_MAIL_FILTER(`spamassassin', `S=local:/var/run/sendmail/spamass.sock, F=,T=S:4m;R:4m;E:10m')dnl

sendmail -d0.1 で MILTER が
出なければ使えるようにしないとダメ


既存のルールを取って来る
~/.spamassasin/user_prefs
wget この辺

スパム(spam)と、普通(ham)を覚えさせる
gzip -d sample-nonspam.txt.gz
wget この辺
tar jxf yoh_spam_050102.tar.bz2

sa-learn --ham ./sample-nonspam.txt
sa-learn --spam ./sample-spam.txt
sa-learn --spam ./spam/*

あとは、ほっとけばいいのかな?


起動順でエラーが出るので変更
update-rc.d -f sendmail remove
update-rc.d sendmail defaults 25

S19spamassassin → S20sendmail → S20spamass-milter
S19spamassassin → S20spamass-milter → S25sendmail


※ ご注意
unstable 入れまくったら
以前入れた oinkmaster が気づけば消え
Perlのバージョンが微妙にズレてて入らず
ずいぶんとシステムがおかしくなりました

やけになったら入れ直せたけど、悲しい
stable な環境を壊したくない人は気をつけましょう

やけな結果
apt-show-versions | grep unstable

libstdc++5/unstable uptodate 1:3.3.5-12
libgcrypt11/unstable uptodate 1.2.0-11
cf/unstable uptodate 3.7Wpl2-2
libgnutls11/unstable uptodate 1.0.16-13
debconf-english/unstable uptodate 1.4.48
gcc-3.3-base/unstable uptodate 1:3.3.5-12
zlib1g/unstable uptodate 1:1.2.2-4
spamass-milter/unstable uptodate 0.3.0-1
libtasn1-2/unstable uptodate 0.2.10-4

apt-show-versions | grep testing

libdb3/testing uptodate 3.2.9-22
grub/testing uptodate 0.95+cvs20040624-16
libpcap0.8/testing uptodate 0.8.3-5
spamassassin/testing uptodate 3.0.2-1
libpcre3/testing uptodate 4.5-1.1
libdigest-sha1-perl/testing uptodate 2.10-1
perl-modules/testing uptodate 5.8.4-8
libwww-perl/testing uptodate 5.803-4
snort-rules-default/testing uptodate 2.3.2-2
libc6/testing uptodate 2.3.2.ds1-20
snort/testing uptodate 2.3.2-2
libhtml-parser-perl/testing uptodate 3.45-2
spamc/testing uptodate 3.0.2-1
oinkmaster/testing uptodate 1.1-1
snort-common/testing uptodate 2.3.2-2
libncurses5/testing uptodate 5.4-4
libgdbm3/testing uptodate 1.8.3-2
perl/testing uptodate 5.8.4-8
mb2md/testing uptodate 3.20-1
libssl0.9.7/testing uptodate 0.9.7e-3
libgpg-error0/testing uptodate 1.0-1
perl-base/testing uptodate 5.8.4-8
libdb1-compat/testing uptodate 2.1.3-7
libcompress-zlib-perl/testing uptodate 1.34-1
libdb4.2/testing uptodate 4.2.52-18
libio-zlib-perl/testing uptodate 1.04-1
debconf/testing uptodate 1.4.30.13
libmilter0/testing uptodate 8.13.4-1
libgcc1/testing uptodate 1:3.4.3-12
libopencdk8/testing uptodate 0.5.5-10

woody 使ってる意味無いような( ゚-゚)

トラックバックURL

このエントリーのトラックバックURL:
http://blog.deepsnow.biz/mt-tb.cgi/239

コメントする