• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • Postfix + SpamAssassin 安裝手冊

    發表于:2007-07-02來源:作者:點擊數: 標簽:
    Author License The author of this document is: rafan@infor.org (initial version) gslin@ccca.nctu.edu.tw (patch) The license of this document is: GNU Free Documentation License Version 1.2, November 2002 參考文獻 官方網站 說明 SpamAssassin
    Author & License
    The author of this document is:

    rafan@infor.org (initial version)
    gslin@clearcase/" target="_blank" >ccca.nctu.edu.tw (patch)
    The license of this document is:

    GNU Free Documentation License
    Version 1.2, November 2002

    參考文獻
    官方網站


    說明
    SpamAssassin 是一套用來協助過濾 spam 的程式,用 perl 寫成,會針對信件中特定的 pattern 給予不同的分數,當分數超過指定的值後,就會被當作 spam,根據設定不同,會在信件 header 或 subject 的地方增加些東西。

    這篇手冊將會教您如何讓 SpamAssassin 與 Postfix 配合,並自動在 Postfix 端把 spam 給過濾掉。

    安裝
    請先安裝 Postfix,請參考 PostfixInstall 的安裝說明,然後用 FreeBSD ports 將 SpamAssassin 安裝起來:

    cd /usr/ports/mail/p5-Mail-SpamAssassin
    make clean install clean
    設定 Postfix 的部分
    於 /usr/local/etc/postfix/master.cf 內修改 smtp 的設定:

    smtp inet n - n - - smtpd -o content_filter=postfixfilter:
    並於同一個檔案的最後面加上:

    postfixfilter unix - n n - - pipe flags=Rq user=nobody
    argv=/usr/local/sbin/filter.sh -f ${sender} -- ${recipient}
    然後新增 /usr/local/sbin/filter.sh 這個檔案:

    #!/bin/sh
    exec /usr/local/bin/spamc -d 127.0.0.1 -f -p 783 -t 30 -e /usr/local/sbin/sendmail -i "$@"
    接著請讓 /usr/local/sbin/filter.sh 變成可以執行:

    chmod 755 /usr/local/sbin/filter.sh
    設定 Postfix 過濾掉 Spam
    在 /usr/local/etc/postfix/main.cf 內設定:

    header_checks = pcre:/usr/local/etc/postfix/header-checks
    然後新增 /usr/local/etc/postfix/header-checks 這個檔案:(如果已經有了,把這行加到最後面)

    /^X-Spam-Status: Yes/ DISCARD Byebye Spam, we don@#t like you.
    設定 SpamAssassin
    各個詳細的設定請參考 Mail::SpamAssassin(3), Mail::SpamAssassin::Conf(3), spamd(1), spamc(1)。

    將 /usr/local/etc/rc.d/spamd.sh-dist 複製一份到 /usr/local/etc/rc.d/spamd.sh:

    cp /usr/local/etc/rc.d/spamd.sh-dist /usr/local/etc/rc.d/spamd.sh
    再修改這個檔案裡面 spamd 的參數:

    ${PREFIX}/bin/spamd -a -d -L -m 32 -u nobody -V /usr/local/etc/spamassassin -x
    然後新增 /usr/local/etc/spamassassin/default.prefs 這個檔案:(底下是很簡單的範例,請斟酌使用,超過 5.0 分會被當 spam,並在信件 subject 加上 *****SPAM***** 字樣)

    # 超過多少分會被當 spam
    required_hits 5.0

    # CJK, from SpamAssassin@#s README
    score HEADER_8BITS 0
    score HTML_COMMENT_8BITS 0
    score SUBJ_FULL_OF_8BITS 0
    score UPPERCASE_25_50 0
    score UPPERCASE_50_75 0
    score UPPERCASE_75_100 0
    ok_languages all
    ok_locales all

    # 一些自訂的 rule
    header FOXMAIL X-Mailer =~ /FoxMail /
    describe FOXMAIL Foxmail
    score FOXMAIL 3.5

    body UNSUBSCRIBE_ZH /取消.*訂閱\/
    describe UNSUBSCRIBE_ZH Body contain unsubscribe msg in chinese
    score UNSUBSCRIBE_ZH 0.5

    body WINDOWOPEN /window\.open\(/i
    describe WINDOWOPEN JavaScript: Windows.Open
    score WINDOWOPEN 3.5
    重新啟動
    您需要讓 spamd 跑起來後,重新啟動 Postfix:

    /usr/local/etc/rc.d/spamd.sh start
    postfix reload
    ,

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>