summaryrefslogtreecommitdiff
path: root/fml/doc/ja/tutorial/customize
diff options
context:
space:
mode:
authorfukachan <fukachan>2004-12-08 10:39:24 +0000
committerfukachan <fukachan>2004-12-08 10:39:24 +0000
commit04fc23caf5c66ca2913b6c84f3e980c90b1a835b (patch)
tree8fd59e80fd1c4b679a6a2f029a9bf06ea9b5569a /fml/doc/ja/tutorial/customize
parente6396d683a2f57a480ae87b47f610ad066428bc3 (diff)
downloadfml8-04fc23caf5c66ca2913b6c84f3e980c90b1a835b.tar.gz
fml8-04fc23caf5c66ca2913b6c84f3e980c90b1a835b.tar.bz2
fml8-04fc23caf5c66ca2913b6c84f3e980c90b1a835b.zip
add recipe on how to reject messages with dangerous attachments.
Diffstat (limited to 'fml/doc/ja/tutorial/customize')
-rw-r--r--fml/doc/ja/tutorial/customize/filter.sgml3
-rw-r--r--fml/doc/ja/tutorial/customize/recipe.filter.attachments.sgml57
2 files changed, 59 insertions, 1 deletions
diff --git a/fml/doc/ja/tutorial/customize/filter.sgml b/fml/doc/ja/tutorial/customize/filter.sgml
index 99a3d77e..0dc122e8 100644
--- a/fml/doc/ja/tutorial/customize/filter.sgml
+++ b/fml/doc/ja/tutorial/customize/filter.sgml
@@ -1,5 +1,5 @@
<!--
- $FML: filter.sgml,v 1.3 2004/05/19 13:17:59 fukachan Exp $
+ $FML: filter.sgml,v 1.4 2004/10/06 09:07:34 fukachan Exp $
-->
@@ -12,6 +12,7 @@
&recipe.filter.notice;
&recipe.filter.spamassassin;
+&recipe.filter.attachments;
</qandaset>
diff --git a/fml/doc/ja/tutorial/customize/recipe.filter.attachments.sgml b/fml/doc/ja/tutorial/customize/recipe.filter.attachments.sgml
new file mode 100644
index 00000000..d9865a80
--- /dev/null
+++ b/fml/doc/ja/tutorial/customize/recipe.filter.attachments.sgml
@@ -0,0 +1,57 @@
+<!--
+ $FML: recipe.filter.spamassassin.sgml,v 1.3 2004/10/06 09:07:35 fukachan Exp $
+-->
+
+
+<qandaentry>
+
+<question>
+<para>
+危ない添付ファイルがついてきたメールは拒否する HOOK
+</para>
+</question>
+
+<answer>
+
+<para>
+HOOK でなんとかする/ごまかす例は次の通りです。fml8 は、あらかじめ入力
+されたメッセージを解析し、鎖状の Mail::Message オブジェクトの形で持っ
+ています。そこで、MIME/Multipart の各部分のヘッダを取り出して、正規表
+現で順に確認すればよいだけです。
+</para>
+
+<para>
+昔の fml8 (2004/12/08 以前)なら、こんな感じ。
+<screen>
+$distribute_verify_request_start_hook = q{
+ my $msg = $curproc->incoming_message() || undef;
+ for (my $m = $msg; $m ; $m = $m->{ next } ) {
+ my $hs = $m->message_fields() || '';
+ if ($hs =~ /filename=.*\.(com|vbs|vbe|wsh|wse|js|exe|doc|rtf)/o) {
+ $curproc->log("attachment \.$1 found");
+ $curproc->stop_this_process();
+ }
+ }
+};
+</screen>
+2004/12/08 以降なら、こんなかんじ。
+<screen>
+$distribute_verify_request_start_hook = q{
+ my $msg = $curproc->incoming_message() || undef;
+ my $list = $msg->message_chain_as_array_ref();
+ for my $m (@$list) {
+ my $hs = $m->message_fields() || '';
+ if ($hs =~ /filename=.*\.(com|vbs|vbe|wsh|wse|js|exe|doc|rtf)/o) {
+ $curproc->log("[new] attachment \.$1 found");
+ $curproc->stop_this_process();
+ }
+ }
+};
+</screen>
+</para>
+
+</answer>
+
+</qandaentry>
+
+