<!-- -*- mode:text coding:euc-jp -*-
   $FML: autoreply.sgml,v 1.7 2008/08/18 02:23:59 fukachan Exp $
-->


<sect1 id="config.autoreply">
	<title>
	ケーススタディ: 自動ファイル送り返しサーバ
	</title>

<para>
配送プロセス( /usr/local/libexec/fml/distribute )を改造し、
どんなときでも /some/where/help ファイルを送り返すことを考えます。
たとえば help@fml.org ＭＬを作り、
このアドレスにメールを送ると
(うむをいわさず:-)ヘルプファイルを送り返すというものです。
</para>

<para>
この場合
config.cf (e.g. /var/spool/ml/help/config.cf)の例は、
次のようになります。
<screen>
article_post_restrictions = permit_anyone
</screen>
config.cf ファイルの =cut 行以降に hook を書きます。
<screen>
$distribute_run_start_hook = q{

        $curproc->reply_message( {
                type        => "text/plain; charset=iso-2022-jp",
                path        => "/some/where/help",
                filename    => "help",
                disposition => "help example",
        });

        $curproc->stop_this_process();

};
</screen>
最後の
<screen>
$curproc->stop_this_process();
</screen>
が &fml4; の $DO_NOTHING 変数にあたりますが、&fml8; ではメソッドです。
これで、この HOOK 以降、正常の処理が無視されるようになります。
つまり、なにも実行されなくなるというわけです。
</para>

<para>
正確には「身のある処理は何も実行されません」が、
reply_message() メソッドで、
メッセージキューに入れられたメッセージを送信する処理が行なわれます。
</para>


<sect2>
	<title>
	レシピ’s
	</title>

&sect.customize.autoreply.recipes;

</sect2>

</sect1>
