diff options
Diffstat (limited to 'sample')
-rw-r--r-- | sample/FILTERMAIL.pm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sample/FILTERMAIL.pm b/sample/FILTERMAIL.pm new file mode 100644 index 00000000..2b71a917 --- /dev/null +++ b/sample/FILTERMAIL.pm @@ -0,0 +1,23 @@ +#!/usr/bin/perl +# $Id$ +# 本範例僅供參考, 配合 util/filtermail.pl 使用. +# 請依自行需要改寫後放置於 /home/bbs/bin 下. +# checkheader() 或 checkbody() 傳回為假時表示直接丟掉該封信. +package FILTERMAIL; + +sub checkheader +{ + return 0 + if( $_[0] =~ /^Subject: .*行銷光碟/im || + $_[0] =~ /^From: .*SpamCompany\.com/im ); + 1; +} + +sub checkbody +{ + return 0 + if( $_[0] =~ /<script language=\"JavaScript\"/im ); + 1; +} + +1; |