From 81e4f2d7bfaa529fe5ca4a3149c69bae5173783e Mon Sep 17 00:00:00 2001 From: fukachan Date: Thu, 9 Dec 2004 03:55:18 +0000 Subject: --- .../customize/recipe.filter.attachments.sgml | 39 ++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'fml/doc/ja/tutorial/customize') diff --git a/fml/doc/ja/tutorial/customize/recipe.filter.attachments.sgml b/fml/doc/ja/tutorial/customize/recipe.filter.attachments.sgml index f2a5705d..e2a35b2a 100644 --- a/fml/doc/ja/tutorial/customize/recipe.filter.attachments.sgml +++ b/fml/doc/ja/tutorial/customize/recipe.filter.attachments.sgml @@ -1,5 +1,5 @@ @@ -33,7 +33,8 @@ HOOK -昔の fml8 (2004/12/08 以前)なら、こんな感じ。 +.exe など特定のファイル拡張子にマッチするか?を調べる例。 +に昔の fml8 (2004/12/08 以前)なら、こんな感じ。 $distribute_verify_request_start_hook = q{ my $msg = $curproc->incoming_message() || undef; @@ -62,6 +63,40 @@ $distribute_verify_request_start_hook = q{ + +別の解としては、 + +Content-Disposition: attachment; + +という表示なることを前提に、これを引っかけるという案もある。 + +$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 =~ /Content-Disposition:.*attachment;/o) { + $curproc->log("attachment \.$1 found"); + $curproc->stop_this_process(); + } + } +}; + +2004/12/08 以降なら、こんなかんじ。 + +$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 =~ /Content-Disposition:.*attachment;/o) { + $curproc->log("[new] attachment \.$1 found"); + $curproc->stop_this_process(); + } + } +}; + + + -- cgit v1.2.1