diff options
| author | fukachan <fukachan> | 2004-12-09 03:55:18 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2004-12-09 03:55:18 +0000 |
| commit | 81e4f2d7bfaa529fe5ca4a3149c69bae5173783e (patch) | |
| tree | 5e6f4e5878e0be130a992ed6be635ca994f6899a /fml/doc/ja/tutorial/customize | |
| parent | 7f3df6b252c67612b2bcebdaceb254324c22e5f3 (diff) | |
| download | fml8-81e4f2d7bfaa529fe5ca4a3149c69bae5173783e.tar.gz fml8-81e4f2d7bfaa529fe5ca4a3149c69bae5173783e.tar.bz2 fml8-81e4f2d7bfaa529fe5ca4a3149c69bae5173783e.zip | |
Diffstat (limited to 'fml/doc/ja/tutorial/customize')
| -rw-r--r-- | fml/doc/ja/tutorial/customize/recipe.filter.attachments.sgml | 39 |
1 files changed, 37 insertions, 2 deletions
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 @@ <!-- - $FML: recipe.filter.attachments.sgml,v 1.1 2004/12/08 10:39:24 fukachan Exp $ + $FML: recipe.filter.attachments.sgml,v 1.2 2004/12/08 11:27:45 fukachan Exp $ --> @@ -33,7 +33,8 @@ HOOK でなんとかする/ごまかす例は次の通りです。 </para> <para> -昔の fml8 (2004/12/08 以前)なら、こんな感じ。 +.exe など特定のファイル拡張子にマッチするか?を調べる例。 +に昔の fml8 (2004/12/08 以前)なら、こんな感じ。 <screen> $distribute_verify_request_start_hook = q{ my $msg = $curproc->incoming_message() || undef; @@ -62,6 +63,40 @@ $distribute_verify_request_start_hook = q{ </screen> </para> +<para> +別の解としては、 +<screen> +Content-Disposition: attachment; +</screen> +という表示なることを前提に、これを引っかけるという案もある。 +<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 =~ /Content-Disposition:.*attachment;/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 =~ /Content-Disposition:.*attachment;/o) { + $curproc->log("[new] attachment \.$1 found"); + $curproc->stop_this_process(); + } + } +}; +</screen> +</para> + </answer> </qandaentry> |
