以下のプログラムをインストール
spamassassin → デーモン spmad
spamc → spamdとやりとりするためのインターフェイス
maildrop → 配送プログラム
で、こんな感じで$HOMEにおいておけばいいみたい
~/.forward
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"|/usr/bin/maildrop" |
~/.mailfilter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEFAULT="$HOME/Maildir" | |
logfile "$HOME/maildrop.log" | |
import SENDER | |
xfilter "/usr/bin/spamc -f ${SENDER}" | |
if( /^X-Spam-Flag: YES/:h ) | |
{ | |
to "$DEFAULT/.Junk/" | |
} |
あとはspam学習するためのcron設定
/etc/cron.daily/sa-learn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo -u hogeuser bash -l -c "/usr/bin/sa-learn --ham '/home/hogeuser/Maildir/.Archives.2013/cur'" | |
sudo -u hogeuser bash -l -c "/usr/bin/sa-learn --spam '/home/hogeuser/Maildir/.Junk/cur'" |
以下のコマンドでシンタックスチェックもできるらしい
maildrop -V 9 < /dev/null
参考リンク
Spamassassin setup
maildrop 利用のメモというかtips
maildropのインストール
0 件のコメント:
コメントを投稿