diff options
| author | fukachan <fukachan> | 2005-11-27 08:50:58 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2005-11-27 08:50:58 +0000 |
| commit | 6c9dc6f2274708635827d22b34cf574ce47d92eb (patch) | |
| tree | 123b7af1b11698e96701fa82b47e26975f1407be /fml/doc/ja/tutorial/customize | |
| parent | c2fa054bca87a2d31098b3fff2dc4e2bc7385ae6 (diff) | |
| download | fml8-6c9dc6f2274708635827d22b34cf574ce47d92eb.tar.gz fml8-6c9dc6f2274708635827d22b34cf574ce47d92eb.tar.bz2 fml8-6c9dc6f2274708635827d22b34cf574ce47d92eb.zip | |
aggregated to recipes.filter
Diffstat (limited to 'fml/doc/ja/tutorial/customize')
5 files changed, 0 insertions, 308 deletions
diff --git a/fml/doc/ja/tutorial/customize/recipe.filter.attachments.sgml b/fml/doc/ja/tutorial/customize/recipe.filter.attachments.sgml deleted file mode 100644 index 6ada7c70..00000000 --- a/fml/doc/ja/tutorial/customize/recipe.filter.attachments.sgml +++ /dev/null @@ -1,104 +0,0 @@ -<!-- - $FML: recipe.filter.attachments.sgml,v 1.3 2004/12/09 03:55:18 fukachan Exp $ ---> - - -<qandaentry> - -<question> -<para> -危ない添付ファイルがついてきたメールは拒否する HOOK -</para> -</question> - -<answer> - -<para> -fml8 は、あらかじめ入力されたメッセージを解析し、鎖状の Mail::Message -オブジェクトの形で持っています。そこで、MIME/Multipart の各部分のヘッ -ダを取り出して、正規表現で順に確認すればよいだけです。 -</para> - -<para> -HOOK でなんとかする/ごまかす例は次の通りです。 -どちらの例でも、マッチした場合、stop_this_process() 命令で、 -これ以上の処理を止めています。 -また、この例では何もエラーメッセージを返そうとしていないため、 -結果として、このメッセージは無視されて終りになっています。 -</para> - -<para> -返事をしてあげたいなら、 reply_message() で、何か返事を返してあげてく -ださい…が、たぶんウィルスとかなので、返事してあげなくてもいいとおもふ。 -</para> - -<para> -.exe など特定のファイル拡張子にマッチするか?を調べる例。 -に昔の 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> - -<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> - - diff --git a/fml/doc/ja/tutorial/customize/recipe.filter.notice.sgml b/fml/doc/ja/tutorial/customize/recipe.filter.notice.sgml deleted file mode 100644 index ca521a06..00000000 --- a/fml/doc/ja/tutorial/customize/recipe.filter.notice.sgml +++ /dev/null @@ -1,55 +0,0 @@ -<!-- - $FML: recipe.filter.notice.sgml,v 1.3 2004/04/07 11:07:02 fukachan Exp $ ---> - - -<qandaentry> - -<question> -<para> -フィルタで弾いた時に、エラーメールをどこへ返す -</para> -</question> - -<answer> - -<para> -デフォルトでは -<screen> -use_article_filter_reject_notice = yes -article_filter_reject_notice_recipient = maintainer sender -</screen> -となっています。 -つまり、エラーメールを返し、返す先はMLの管理者と送信者の両方です。 -</para> - - -<para> -返送する先を送信者( From: のアドレス )にするには -<screen> -article_filter_reject_notice_recipient = sender -</screen> -としてください。 -</para> - - -<para> -MLの管理者と送信者( From: のアドレス )の両方に返すには -<screen> -article_filter_reject_notice_recipient = maintainer sender -</screen> -としてください。 -</para> - - -<para> -そもそもエラーメールを返さないようにするには、 -<screen> -use_article_filter_reject_notice = no -</screen> -としてください。 -</para> - -</answer> - -</qandaentry> diff --git a/fml/doc/ja/tutorial/customize/recipe.filter.spamassassin.sgml b/fml/doc/ja/tutorial/customize/recipe.filter.spamassassin.sgml deleted file mode 100644 index 6884cb59..00000000 --- a/fml/doc/ja/tutorial/customize/recipe.filter.spamassassin.sgml +++ /dev/null @@ -1,100 +0,0 @@ -<!-- - $FML: recipe.filter.spamassassin.sgml,v 1.4 2005/06/25 15:11:29 fukachan Exp $ ---> - - -<qandaentry> - -<question> -<para> -spamassassin で SPAM メールを無視する。 -</para> -</question> - -<answer> - -<para> -<caution> -<para> -そもそも spamassassin をよびだす内蔵フィルタがあるのですが、 -それをあえて使わない例です。 -</para> - -</caution> -</para> - -<para> -1. 内蔵フィルタの方の設定です。 -<screen> -use_article_spam_filter = yes -article_spam_filter_drivers = spamassassin -</screen> -</para> - -<para> -2. HOOK でなんとかする/ごまかす例は次の通りです。 -<screen> -$distribute_verify_request_end_hook = q{ - my $spamassassin = '/usr/pkg/bin/spamc -c'; - - use FileHandle; - my $wh = new FileHandle "| $spamassassin"; - - if (defined $wh) { - $wh->autoflush(1); - my $msg = $curproc->incoming_message(); - $msg->print($wh); - $wh->close(); - if ($?) { - $curproc->log("spam: (code = $?)"); - $curproc->stop_this_process(); - } - } -}; -</screen> -</para> - -</answer> - -</qandaentry> - - -<qandaentry> -<question> -<para> -spamassassin で SPAM メールと判定したら、 -ヘッダに X-Spam-Status: Yes をつける。 -</para> -</question> - -<answer> -<para> -<screen> -$distribute_verify_request_end_hook = q{ - my $spamassassin = '/usr/pkg/bin/spamc -c'; - - use FileHandle; - my $wh = new FileHandle "| $spamassassin"; - - if (defined $wh) { - $wh->autoflush(1); - my $msg = $curproc->incoming_message(); - $msg->print($wh); - $wh->close(); - if ($?) { - $curproc->log("spam: (code = $?)"); - my $hdr = $curproc->incoming_message_header(); - $hdr->add('X-Spam-Status', 'Yes'); - } - } -}; -</screen> -</para> - -<para> -ちょっとトリッキーですが、動きます。 -</para> - -</answer> - -</qandaentry> diff --git a/fml/doc/ja/tutorial/customize/recipe.header.tag.lowercase.sgml b/fml/doc/ja/tutorial/customize/recipe.header.tag.lowercase.sgml deleted file mode 100644 index 09270e62..00000000 --- a/fml/doc/ja/tutorial/customize/recipe.header.tag.lowercase.sgml +++ /dev/null @@ -1,26 +0,0 @@ -<!-- - $FML: recipe.header.tag.lowercase.sgml,v 1.1 2002/10/29 03:32:21 fukachan Exp $ ---> - - -<qandaentry> - -<question> -<para> -記事のヘッダの Subject: のタグを小文字にしたい -</para> -</question> - -<answer> -<para> -Unix 上では、たいてい小文字を使うので、ML名前も小文字でしょう。 -だから、普通は何もしなくても小文字のはずですが、 -念のため、小文字を強制したいなら、つぎのようにしてください。 -<screen> -article_subject_tag = [\L$ml_name\E:%05d] -</screen> -(注意: この機能を使う場合には 2002/10/29 以降の snapshot を使ってください)。 -</para> -</answer> - -</qandaentry> diff --git a/fml/doc/ja/tutorial/customize/recipe.header.tag.uppercase.sgml b/fml/doc/ja/tutorial/customize/recipe.header.tag.uppercase.sgml deleted file mode 100644 index 8117d43b..00000000 --- a/fml/doc/ja/tutorial/customize/recipe.header.tag.uppercase.sgml +++ /dev/null @@ -1,23 +0,0 @@ -<!-- - $FML: recipe.header.tag.uppercase.sgml,v 1.1 2002/10/29 03:32:21 fukachan Exp $ ---> - - -<qandaentry> - -<question> -<para> -記事のヘッダの Subject: のタグを大文字にしたい -</para> -</question> - -<answer> -<para> -<screen> -article_subject_tag = [\U$ml_name\E:%05d] -</screen> -(注意: この機能を使う場合には 2002/10/29 以降の snapshot を使ってください)。 -</para> -</answer> - -</qandaentry> |
