検索条件
全9件
(1/1ページ)
MAILTO=""の1行を追加。
# apt-get install fetchmail[2]qmailの調整
# /etc/init.d/qmail restart[3].fetchmailrcで設定。
set postmaster urara set nobouncemail defaults protocol pop3 keep no mimedecode smtphost localhost poll dd.iij4u.or.jp user urara password ******** is urara here mda "env QMAILQUEUE=/var/qmail/bin/qmail-scanner-queue.pl /var/qmail/bin/qmail-inject urara" poll mail.big.or.jp user urara password ******** is urara here mda "env QMAILQUEUE=/var/qmail/bin/qmail-scanner-queue.pl /var/qmail/bin/qmail-inject urara"パーミッションを600に変更。
# fetchmailメールがurara@dt8.jpに送信されることを確認。X-Spamヘッダが付いているかどうかなどqmail-scannerを通っていることを確認。
0-59/5 * * * * /usr/bin/fetchmailと書いたところ、ちゃんとチェックしてくれるようになった。
SpamAssassin's spamd daemon is incorrectly installed. You need to run it as: spamd -F 0 .... Please try again.qmail-scannerを./configureしたときにでたエラーメッセージ。-Fオプションを指定していなかった。
spamassassin -t < sample-spam.txtとテスト起動して、足りないモジュールをチェック。
Can't locate HTML/Parser.pm in @INC (@INC contains: lib ../lib /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . /usr/bin/lib /usr/bin/site_perl) at lib/Mail/SpamAssassin/HTML.pm line 32. BEGIN failed--compilation aborted at lib/Mail/SpamAssassin/HTML.pm line 32. Compilation failed in require at lib/Mail/SpamAssassin/Message/Node.pm line 42. BEGIN failed--compilation aborted at lib/Mail/SpamAssassin/Message/Node.pm line 42. Compilation failed in require at lib/Mail/SpamAssassin/Message.pm line 49. BEGIN failed--compilation aborted at lib/Mail/SpamAssassin/Message.pm line 49. Compilation failed in require at /usr/share/perl5/Mail/SpamAssassin/NoMailAudit.pm line 18. BEGIN failed--compilation aborted at /usr/share/perl5/Mail/SpamAssassin/NoMailAudit.pm line 18. Compilation failed in require at /usr/bin/spamassassin line 134. BEGIN failed--compilation aborted at /usr/bin/spamassassin line 134.HTML/Parserで怒られてるので、足りてないのは多分これ。
# apt-get source spamassassin(注:カレントに放り込まれます)
# spamassassin -t < sample-spam.txt error: rule 'GB2312_CHARSETContent-Type' has invalid characters (not Alphanumeric + Underscore) error: rule 'X_MACKY_ID_PRESENTexists:X-Macky-ID' has invalid characters (not Alphanumeric + Underscore) error: rule 'X_MACKYCATCODE_PRESENTexists:X-MackyCatCode' has invalid characters (not Alphanumeric + Underscore) error: rule 'X_MACKYMEDIA_PRESENTexists:X-MackyMedia' has invalid characters (not Alphanumeric + Underscore) error: rule 'X_MAILER_PRESENTexists:X-Mailer' has invalid characters (not Alphanumeric + Underscore) Net::DNS version is 0.19, but need 0.34dnsavailable-1 at lib/Mail/SpamAssassin/Dns.pm line 1230. Failed to run ROUND_THE_WORLD SpamAssassin test, skipping: (Can't locate object method "check_for_round_the_world_received" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Failed to run DIFFERENT_REPLY_TO SpamAssassin test, skipping: (Can't locate object method "check_for_spam_reply_to" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Failed to run CTYPE_JUST_HTML SpamAssassin test, skipping: (Can't locate object method "check_for_content_type_just_html" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Failed to run LOTS_OF_CC_LINES SpamAssassin test, skipping: (Can't locate object method "check_lots_of_cc_lines" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Failed to run FROM_NAME_EQ_FROM_ADDR SpamAssassin test, skipping: (Can't locate object method "check_from_name_eq_from_address" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Failed to run BAD_HELO_WARNING SpamAssassin test, skipping: (Can't locate object method "check_for_bad_helo" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Failed to run FROM_AND_TO_SAME SpamAssassin test, skipping: (Can't locate object method "check_for_from_to_equivalence" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Failed to run KNOWN_BAD_DIALUPS SpamAssassin test, skipping: (Can't locate object method "check_for_bad_dialup_ips" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Failed to run NO_MX_FOR_FROM SpamAssassin test, skipping: (Can't locate object method "check_for_from_mx" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Failed to run SUBJ_MISSING SpamAssassin test, skipping: (Can't locate object method "subject_missing" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Failed to run DATE_IN_FUTURE SpamAssassin test, skipping: (Can't locate object method "check_for_forward_date" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Failed to compile URI SpamAssassin tests, skipping: (Illegal declaration of anonymous subroutine at /etc/spamassassin/20_uri_tests.cf, rule MAILTO_TO_SPAM_ADDR, line 10. ) Failed to run LINES_OF_YELLING_3 SpamAssassin test, skipping: (Can't locate object method "check_for_num_yelling_lines" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Failed to run BALANCE_FOR_LONG SpamAssassin test, skipping: (Can't locate object method "check_for_very_long_text" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Failed to run LINES_OF_YELLING SpamAssassin test, skipping: (Can't locate object method "check_for_yelling" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Failed to run LINES_OF_YELLING_2 SpamAssassin test, skipping: (Can't locate object method "check_for_num_yelling_lines" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Failed to run BASE64_ENC_TEXT SpamAssassin test, skipping: (Can't locate object method "check_for_base64_enc_text" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Failed to run RAZOR_CHECK SpamAssassin test, skipping: (Can't locate object method "check_razor" via package "Mail::SpamAssassin::PerMsgStatus" at lib/Mail/SpamAssassin/PerMsgStatus.pm line 2312. ) Can't locate object method "handle_auto_report" via package "Mail::SpamAssassin::PerMsgStatus" at /usr/bin/spamassassin line 231.またモジュール不足かと思ってあれこれやってみたのだが、
# apt-get install libnet-dns-perl/testingとか、全く解決しない。
# dpkg --purge spamassassin # rm -r /etc/spamassassin # apt-get install spamassassin/testingあ、うごいた。
# ./configure Hit RETURN to create initial directory structure under /var/spool/qmailscan, and install qmail-scanner-queue.pl under /var/qmail/bin: perlscanner: generate new DB file from /var/spool/qmailscan/quarantine-attachments.txt perlscanner: total of 9 entries.で、行ったまま帰ってこない。暴走。
# ./configureうーん、今度はインストールは完了。テストをすると……?
# contrib/test_installation.sh -doit Sending standard test message - no viruses... done! Sending eicar test virus - should be caught by perlscanner module... qmail-inject: fatal: qq temporary problem (#4.3.0) Bad error. qmail-inject died途中で落ちてしまいます。メモリ不足??
# apt-get install razor Sorry, but the following packages have unmet dependencies: razor: Depends: libdigest-sha1-perl but it is not going to be installed Depends: libnet-dns-perl but it is not going to be installed Depends: libtime-hires-perl (> 1.20-3) Depends: libmailtools-perl but it is not going to be installed依存関係で怒られて入らない。またもやperl5.6<-->5.8問題? 怪しいところで以下をピックアップしてインストール。
# apt-get install libdigest-sha1-perl/testing
# apt-get install razor/testing今度は入った。
# razor-client # razor-admin -d -create -home=/etc/razor[2]SpamAssassinのインストール
# apt-get install spamassassin/testingモジュールが足りてないようなので、
# apt-get install libhtml-parser-perl/testing # apt-get install libnet-dns-perl/testing(2)
# /etc/init.d/spamassassin start(4)
# ./configure --lang ja_JP.EUC --admin root --scanners clamdscan,verbose_spamassassin --notify recips,admin --domain dt8.jp --installテスト。
# contrib/test_installation.sh -doitこのテストで通常メール1通と、ウィルス告知メール2通と、スパム判定されてスパム本体が添付に入っているメール1通が送られてくればインストール成功。
--spam-- unix-power tlec 1 22.9 34.5 2 26.8 35.0 3 20.8 23.2 4 13.8 23.9 5 10.6 15.8 6 13.7 19.3 7 28.1 35.4 8 22.7 28.3 9 6.4 9.8 10 9.9 17.0 11 5.6 13.9 12 19.9 28.5 13 15.4 30.3 14 12.4 19.3 15 24.3 27.8 16 7.6 11.9 17 7.8 12.1 18 20.4 25.0 19 15.8 16.0 20 0.2 10.4 --ham-- 1 6.4 10.9 2 5.5 7.6 3 0.5 5.4 4 12.9 12.9 5 5.9 7.8 6 -1.4 2.2 7 6.3 11.2 8 -2.4 2.8 9 6.3 9.2 10 -0.4 3.0 11 3.0 19.1SpamAssassinは各テストの結果をスコアとして加算し最終的にそのメールのスパム/非スパムを判定する。表の数字はスコアだ。
error: rule 'GB2312_CHARSETContent-Type' has invalid characters (not Alphanumeric + Underscore) error: rule 'CONTENT_TYPE_PRESENTexists:Content-Type' has invalid characters (not Alphanumeric + Underscore) error: rule 'X_MAILER_PRESENTexists:X-Mailer' has invalid characters (not Alphanumeric + Underscore)とエラーが出るので(単に空白が足りてない)、それも修正した。
81c81 < required_hits 8.0 --- > required_hits 15.0 128c128 < header GB2312_CHARSETContent-Type =~ /charset=['"]?GB2312['"]?/i --- > header GB2312_CHARSET Content-Type =~ /charset=['"]?GB2312['"]?/i 180c180 < score X_MAILER 7.0 --- > score X_MAILER 3.0 451,453c451,453 < header CONTENT_TYPE_PRESENTexists:Content-Type < describe CONTENT_TYPE_PRESENTexists:Content-Type < score CONTENT_TYPE_PRESENT-0.1 --- > header CONTENT_TYPE_PRESENT exists:Content-Type > describe CONTENT_TYPE_PRESENT exists:Content-Type > score CONTENT_TYPE_PRESENT -0.1 1243,1245c1243,1245 < header X_MAILER_PRESENTexists:X-Mailer < describe X_MAILER_PRESENTexists:X-Mailer < score X_MAILER_PRESENT0.1 --- > header X_MAILER_PRESENT exists:X-Mailer > describe X_MAILER_PRESENT exists:X-Mailer > score X_MAILER_PRESENT 0.1 1261c1261 < score SJISNOTXMAILER 7.0 --- > score SJISNOTXMAILER 2.0 1323c1323 < score RAZOR2_CF_RANGE_51_100 2.5 --- > score RAZOR2_CF_RANGE_51_100 7.0 2787a2788,2790 > # urara add 05/04/16 > bayes_auto_learn_threshold_nonspam 0.5 > bayes_auto_learn_threshold_spam 30.0 > > report_safe 0 > rewrite_header subject [SPAM(Score=_SCORE_)]この設定で先ほどの31通を再テスト。
--spam-- 1 42.8 2 39.8 3 29.2 4 29.8 5 24.1 6 25.2 7 40.0 8 35.9 9 17.3 10 23.1 11 24.8 12 37.0 13 37.5 14 26.8 15 35.8 16 20.6 17 20.8 18 34.0 19 16.2 20 25.0 --ham-- 1 10.9 2 7.6 3 5.4 4 10.0 5 7.8 6 2.2 7 11.2 8 2.8 9 9.2 10 3.0 11 14.1ギリギリだが全てham is ham, spam is spamになった。
# /etc/init.d/spamassassin restart注意)
$spamassassin <mail> | grep X-[1]SpamAssassin初期設定では、
error: rule 'GB2312_CHARSETContent-Type' has invalid characters (not Alphanumeric + Underscore) error: rule 'CONTENT_TYPE_PRESENTexists:Content-Type' has invalid characters (not Alphanumeric + Underscore) error: rule 'X_MAILER_PRESENTexists:X-Mailer' has invalid characters (not Alphanumeric + Underscore)
org jp 2005年度 2000 3980 <--orgは新規登録費用(\1000)がかかる 2006年度 3000 7960 2007年度 4000 11940 2008年度 5000 16920 <--収入発生?21-domainより安いレジストラもあることにはあるが、それぞれ仕入れ値が6$,\3500であることを考えると大幅に安いところはないだろう(value-domainは\990,\3690)。