Spam-その19

週末の結果:初めて6割突破!!

好調になってきた。打率の行方は上昇しかない!!
spamtrainer のログを見ると
# cat spamtrainer.log
Apr 14 01:01:55 – spamtrainer Version 1.6.1
0.000 0 191 0 non-token data: ham
0.000 0 929 0 non-token data: spam
Apr 15 01:00:13 – spamtrainer Version 1.6.1
0.000 0 203 0 non-token data: ham
0.000 0 929 0 non-token data: spam
Apr 16 01:00:57 – spamtrainer Version 1.6.1
0.000 0 213 0 non-token data: ham
0.000 0 937 0 non-token data: spam
#
とある。読み方がわからん。ま、午前1時になにかやっていることは確実だ。
SpamAssassin Training Error
によると、
Apparently everyone agrees that Apple’s SA implementation is either messed up or deliberately hobbled.
I ended up creating the symbolic link as described in several places:
sudo -s
cd /var/amavis
mv .spamassassin .spamassassin.old
su clamav
ln -s /var/clamav/.spamassassin /var/amavis/.spamassassin
…then fixing the /etc/mail/spamassassin/local.cf file:
change ‘auto_learn’ to ‘bayes_auto_learn’
change ‘safe_reporting’ to ‘report_safe’
comment out ‘use_terse_report 0’
comment out ‘subject_tag’ and ‘rewrite_subject’
(note that it is “report_safe” and not “safe_report” as indicated in some places)
…then setting up the junkmail and notjunkmail accounts as Apple recommends
…then using spamtrainer for the actual scanning instead of either of Apple’s scripts (strangely, hardly anyone even talks about sa-learn).
Now, after scanning 200+ spams and 200+ non-spams (which takes quite a long time with spamtrainer), Bayesian scanning appears to be working. I can tell because the X-Spam-Status tag in my mail headers now contains a BAYES tag:
X-Spam-Status: Yes, hits=5.33 tagged_above=-999 required=5 tests=BAYES_50, HELO_DYNAMIC_IPADDR2, HTML_40_50, HTML_MESSAGE, MIME_HTML_ONLY
That was NOT trivial (considering that this is supposed to already be a feature of Tiger). The discussion in the afp548 thread starts on 10.4.2. This misconfiguration (deliberate hobbling?) persists in 10.4.6. wtf?
だそうで、結局、いままで学習されていないかったのではないかと思う今日この頃、皆さん、いかがお過ごしですか?(きっこ風)

spamassassin training

OSXのspamメール対策にはspamassassin があって、マニュアルによれば自動的に学習するが、学習したメールを廃棄しない となっている。やってられないので Spamtrainer を導入した。
解凍して、素直にインストールした。
spammail notspammail のアカウントははマニュアル通りに作ってあったから、
まず、Spamtrainer のマニュアルにしたがって、root 権限で、spamtrainer -fを実行。
root# /usr/sbin/spamtrainer -f
If necessary, this will create the missing symbolic link in OS X 10.4.x.
It will also fix other configuration issues in the default installation,
which prevent spamassassin from properly working with additional domains.
All files modified by this routine will be first backed up in their
respective directories
Read the ‘Caveats’ chapter in the included documentation for more information.
Would you like to proceed? (yes/no)
yes
Stopping amavisd…
If you use 10.4.7 or 10.4.8, this may produce:
‘Workaround Bonjour: Unknown error: 0’.
It is safe to ignore it.
The symbolic link from
/var/amavisd/.spamassassin to /var/clamav/.spamassassin
has been created
The existing directory /var/amavisd/.spamassassin has been
backed up to /var/amavis/.spamassassin_04132007-130258
The existing file /etc/amavisd.conf has been
backed up to /etc/amavisd.conf_back_04132007-130258
@local_domains_maps = ( 1 ); was added to amavisd.conf
This ensures that additional domains will get processed
by the content filter as well.
The existing file /etc/local.cf has been
backed up to /private/etc/mail/spamassassin/local.cf_back_04132007-130300
local.cf was fixed
This ensures the settings are correct for your system.
Starting amavisd…
If you use 10.4.7 or 10.4.8, this may produce:
‘Workaround Bonjour: Unknown error: 0’.
It is safe to ignore it.
root#Workaround Bonjour: Unknown error: 0
次に、読み込むメールと実施する時間を設定するため
/usr/sbin/spamtrainer -i を実行
root# /usr/sbin/spamtrainer -i
Checking if there is a startup item for ‘learn_junk_mail’ or ‘spamtrainer’
There IS NO plist for learn_junk_mail
There IS a cron job for learn_junk_mail
If you want to use ‘spamtrainer’ it IS RECOMMENDED that this cron be disabled
Would you like me to disable it for you (yes/no)
yes
‘learn_junk_mail’ cron job has been disabled’
There IS NO plist for spamtrainer
There IS NO cron job for spamtrainer
if you want to use ‘spamtrainer’ it is recommended that this be added
Would you like me to enable it for you (yes/no)
yes
What time would you like the job to run (24-hour format)?
Please enter the hour (1)
1
Please enter the minutes (0)
0
Would you like SPAM/HAM messages to be deleted after the learn process? (n)
y
Would you like to log bayes stats into /var/log/spamtrainer.log? (n)
y
Enter name of mail store with SPAM/HAM mailboxes? Enter for default (default)
default
Enter name of mailbox with SPAM? Enter for default (junkmail)
junkmail
Enter name of mailbox with HAM? Enter for default (notjunkmail)
notjunkmail
The following cron job for ‘spamtrainer’ has been prepared
0 1 * * * /usr/sbin/spamtrainer -p default -j junkmail -n notjunkmail -d -l
Would you like to add it? (yes/no)
yes
The following cron job for ‘spamtrainer’ has been enabled’
0 1 * * * /usr/sbin/spamtrainer -p default -j junkmail -n notjunkmail -d -l
root#
これで junkmail, notjunkmail を毎日午前1時に読み込み、消去するはず...

spam mail-その17

4月10日の結果
総メール数50通
迷惑メール数32通
mikeがjunk と判定した迷惑メール8通
positeve failuar0
打率 .250
通算打率 .400
通算三振数 2
11日の結果
総メール数31通
迷惑メール数32通
mikeがjunk と判定した迷惑メール3通
positeve failuar 0
打率 .094
通算打率 .366
通算三振数 2
学習したメール(通算)
spam 1263通
ham 190通
絶不調、立ち直れるか?

spam mail-その12

本日朝7時の時点で
40通のメールがあってspam mail が19通うちmikeが判定したのが8通
打率.421
三振なし
通算打率.463
通算三振1
打率がだんだん下がってくる。なんでじゃ!!
夜8時での学習
spam 通算1061通
ham 通算174通

It's alright, I say It's OK. Listen to what I say.