過去2回ほどの記事では昨年暮れに起ったHDDトラブルについて紹介しました。先に触れたように、
普段使っている作業環境はテストを兼ねて新バージョンのPlamo Linuxを常にインストールしているものの、
たいていのソフトウェアはPlamo Linuxのパッケージが用意されているので、
Apache SpamAssasinのインストール
"Apache SpamAssasin"
最近では、
しかしながら、
もっとも、
SAはPerlで書かれたスクリプトで、
$ perl -MCPAN -e shell ... cpan shell -- CPAN exploration and modules installation (v2.22) Enter 'h' for help. cpan[1]> install Mail::SpamAssassin Reading '/home/kojima/.cpan/Metadata' Database was generated on Thu, 21 Apr 2022 02:41:03 GMT Running install for module 'Mail::SpamAssassin' ... *************************************************************************** ERROR: the required HTML::Parser module is not installed, minimum required version is 3.43. HTML is used for an ever-increasing amount of email so this dependency is unavoidable. Run "perldoc -q html" for additional information. .... ERROR: the required Net::DNS module is not installed, minimum required version is 0.34. Used for all DNS-based tests (SBL, XBL, SpamCop, DSBL, etc.), perform MX checks, and is also used when manually reporting spam to SpamCop. .... dependency check complete... REQUIRED module missing: HTML::Parser REQUIRED module missing: Net::DNS REQUIRED module missing: NetAddr::IP optional module missing: Digest::SHA1 optional module missing: Mail::SPF ... No 'Makefile' created SIDNEY/Mail-SpamAssassin-3.4.6.tar.gz /usr/bin/perl Makefile.PL -- NOT OK
上記リスト中、
行きつ戻りつしながら必要なモジュール類を作ってみたところ、
$ ls *tzst geoip_api_c-1.6.12-x86_64-B1.tzst perl_IP_Country_DB_File-3.03-x86_64-B1.tzst perl_Archive_Tar-2.40-x86_64-B1.tzst perl_LWP_MediaTypes-6.04-x86_64-B1.tzst perl_Archive_Zip-1.68-x86_64-B1.tzst perl_MailTools-2.21-x86_64-B1.tzst perl_BSD_Resource-1.2911-x86_64-B1.tzst perl_Mail_AuthenticationResults-2.20210915-x86_64-B1.tzst perl_B_COW-0.004-x86_64-B1.tzst perl_Mail_DKIM-1.20200907-x86_64-B1.tzst .... perl_IO_String-1.08-x86_64-B1.tzst re2c-2.2-x86_64-B1.tzst perl_IO_Zlib-1.11-x86_64-B1.tzst $ ls *tzst | wc -l 67
これらのパッケージをインストールすればSAは使えるようになるものの、
さてどうするか、
fetchmaiの設定ファイル
SpamAssasinの働き
SpamAssasin
SAが評価した
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pl74_1031.linet.jp X-Spam-Flag: YES X-Spam-Level: ************** X-Spam-Status: Yes, score=14.8 required=5.0 tests=FROM_SUSPICIOUS_NTLD, FROM_SUSPICIOUS_NTLD_FP,HTML_FONT_LOW_CONTRAST,HTML_MESSAGE, MIME_HTML_MOSTLY,MPART_ALT_DIFF,PDS_OTHER_BAD_TLD,RCVD_IN_SBL_CSS, RCVD_IN_VALIDITY_RPBL,SPF_HELO_NONE,SPF_NONE,T_KAM_HTML_FONT_INVALID, T_SCC_BODY_TEXT_LINE,URIBL_ABUSE_SURBL,URIBL_BLACK,XM_RECPTID autolearn=spam autolearn_force=no version=3.4.6
X-Spam-Status行に記録されているのが、
スパムと判定されたメールには、
Content analysis details: (14.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [5.196.119.97 listed in zen.spamhaus.org] 1.9 URIBL_ABUSE_SURBL Contains an URL listed in the ABUSE SURBL blocklist [URIs: awesomewebsites.click] 1.7 URIBL_BLACK Contains an URL listed in the URIBL blacklist [URIs: awesomewebsites.click] 1.3 RCVD_IN_VALIDITY_RPBL RBL: Relay in Validity RPBL, https://senderscore.org/blocklistlookup/ [5.196.119.97 listed in bl.score.senderscore.com] ... 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: awesomewebsites.click (click)] ... 3.0 XM_RECPTID Has spammy message header
この表では、
ざっと見、
1.
少し飛ばして、
最後の3.
SAでは、
$ ls /var/lib/spamassassin/3.004006/updates_spamassassin_org 10_default_prefs.cf 20_uri_tests.cf 60_awl.cf 10_hasbase.cf 20_vbounce.cf 60_bayes_stopwords.cf ... 20_porn.cf 50_scores.cf user_prefs.template 20_ratware.cf 60_adsp_override_dkim.cf
先に見たRCVD_
$ cat -n 20_dnsbl_test.cf ... 129 # CSS is the Spamhaus CSS Component of the SBL List: https://www.spamhaus.org/css/ 130 header RCVD_IN_SBL_CSS eval:check_rbl_sub('zen', '127.0.0.3') 131 describe RCVD_IN_SBL_CSS Received via a relay in Spamhaus SBL-CSS 132 tflags RCVD_IN_SBL_CSS net 133 reuse RCVD_IN_SBL_CSS ...
このルールでは、
SAの興味深い点は、
話は変わりますが、
Apr 19 09:49:44 localhost postfix/smtp[4079]: E806A1E7804D: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[64.233.188.27]:25, delay=1.4, delays=0.17/0.01/0.49/0.74, dsn=5.7.26, status=bounced (host gmail-smtp-in.l.google.com[64.233.188.27] said: 550-5.7.26 This message does not have authentication information or fails to 550-5.7.26 pass authentication checks. To best protect our users from spam, the 550-5.7.26 message has been blocked. Please visit 550-5.7.26 https://support.google.com/mail/answer/81126#authentication for more 550 5.7.26 information. e15-20020a17090a7c4f00b001cd51f48295si674368pjl.174 - gsmtp (in reply to end of DATA command))
同様の現象は筆者以外にも起きているようで、
なりすましメールを防ぐためのSPF
ロシアのウクライナ侵攻に便乗したサイバー攻撃が急増した結果、
SpamAssasinが、