SpamAssassin・spamass-milterインストール
[root@falcon21 ~]# yum -y install spamassassin spamass-milter-postfix
New leaves:
spamass-milter-postfix.noarch



SpamAssassin起動
[root@falcon21 ~]# systemctl start spamassassin

[root@falcon21 ~]# systemctl enable spamassassin
Created symlink from /etc/systemd/system/multi-user.target.wants/spamassassin.service to /usr/lib/systemd/system/spamassassin.service.

[root@falcon21 ~]# systemctl status spamassassin -l
spamassassin.service - Spamassassin daemon
Loaded: loaded (/usr/lib/systemd/system/spamassassin.service; enabled; vendor preset: disabled)
Active: active (running) since 木 2019-11-14 10:09:54 JST; 41s ago
Main PID: 28057 (/usr/bin/spamd )
CGroup: /system.slice/spamassassin.service
├─28057 /usr/bin/spamd --pidfile /var/run/spamd.pid -d -c -m5 -
├─28100 spamd chil
└─28101 spamd chil

11月 14 10:09:44 falcon21.space systemd[1]: Starting Spamassassin daemon...
11月 14 10:09:46 falcon21.space spamd[28048]: logger: removing stderr method
11月 14 10:09:54 falcon21.space spamd[28057]: spamd: server started on IO::Socket::IP [127.0.0.1]:783 (running version 3.4.0)
11月 14 10:09:54 falcon21.space spamd[28057]: spamd: server pid: 28057
11月 14 10:09:54 falcon21.space systemd[1]: Started Spamassassin daemon.
11月 14 10:09:54 falcon21.space spamd[28057]: spamd: server successfully spawned child process, pid 28100
11月 14 10:09:54 falcon21.space spamd[28057]: spamd: server successfully spawned child process, pid 28101
11月 14 10:09:54 falcon21.space spamd[28057]: prefork: child states: IS
11月 14 10:09:54 falcon21.space spamd[28057]: prefork: child states: II



SpamAssassin設定
[root@falcon21 ~]# vi /etc/mail/spamassassin/v310.pre
53 loadplugin Mail::SpamAssassin::Plugin::TextCat


[root@falcon21 ~]# vi /etc/cron.daily/spamassassin-update
#!/bin/bash

# SpamAssassin設定ファイル最新版ダウンロード
cd /etc/mail/spamassassin
wget -qN http://www.flcl.org/~yoh/user_prefs

# 設定ファイル更新時のみSpamAssassin再起動
diff user_prefs user_prefs.org > /dev/null 2>&1
if [ $? -ne 0 ]; then
cp user_prefs local.cf

# スパム判断したメールを添付形式にしないように設定
echo "report_safe 0" >> local.cf

# スパム判断したメールの件名に「***SPAM***」を付加するように設定※受信メールサーバーがPOPの場合のみ
echo "rewrite_header Subject ***SPAM***" >> local.cf

# SpamAssassin再起動
if [ -f /etc/rc.d/init.d/spamassassin ]; then
/etc/rc.d/init.d/spamassassin restart > /dev/null
else
systemctl restart spamassassin > /dev/null
fi
fi
cp user_prefs user_prefs.org



[root@falcon21 ~]# chmod +x /etc/cron.daily/spamassassin-update


[root@falcon21 ~]# /etc/cron.daily/spamassassin-update
cp: `user_prefs' を stat できません: そのようなファイルやディレクトリはありません
cp: `user_prefs' を stat できません: そのようなファイルやディレクトリはありません



[root@falcon21 ~]# vi /usr/lib/perl5/vendor_perl/5.8.8/Archive/Tar.pm



[root@falcon21 ~]# systemctl start spamass-milter

[root@falcon21 ~]# systemctl enable spamass-milter
Created symlink from /etc/systemd/system/multi-user.target.wants/spamass-milter.service to /usr/lib/systemd/system/spamass-milter.service.

[root@falcon21 ~]# systemctl status spamass-milter -l
spamass-milter.service - Mail filter for SpamAssassin
Loaded: loaded (/usr/lib/systemd/system/spamass-milter.service; enabled; vendor preset: disabled)
Active: active (running) since 木 2019-11-14 11:03:42 JST; 1min 15s ago
Main PID: 2946 (spamass-milter)
CGroup: /system.slice/spamass-milter.service
└─2946 /usr/sbin/spamass-milter -g postfix -p /run/spamass-milter/postfix/sock

11月 14 11:03:42 falcon21.space systemd[1]: Started Mail filter for SpamAssassin.
11月 14 11:03:42 falcon21.space spamass-milter[2946]: spamass-milter 0.4.0 starting



milter-manager設定
[root@falcon21 ~]# vi /etc/milter-manager/defaults/redhat.conf
29 #"Remote Network",

[root@falcon21 ~]# systemctl restart milter-manager



milter-manager・spamass-milter連携設定
[root@falcon21 ~]# usermod -G postfix -a milter-manager

[root@falcon21 ~]# systemctl restart milter-manager
 

投票数:0 平均点:0.00

 
Back to Top