[HOME] [github] [twitter] [blog] [fml4] [fml8] [北海道] Powered by NetBSD and [nuinui.net] .

fml8 からメールで返事を送り返す

送り返すべきメールは Mail::Delivery::Queue クラスを用いて、ML固有のキューに入ります。 キューに入ったメールは、のちに FML::Process::QueueManager クラス経由で(配送)処理が行なわれます。

微妙に処理が異なりますが、記事の配送もコマンドメールも同様に Mail::Delivery::Queue ベースのキューイング処理をしています。 そのため、 配送処理の途中でエラーが起きた場合、 別の fml8 プロセスにより再送処理が行なわれます。

fml8 の中では送信処理をどのように書くのか?

あるメッセージ(テキストメッセージ)を送り返したい場合、次のように書きます。

$curproc->reply_message( "you are not a ML member." );
この場合の受信者は、投稿を拒否された人やコマンドの結果などを受けとる人、 つまり fml8 に何かの処理を要求した人です。

ファイルを送りたい場合や画像ファイルを送りたい場合は次のようにします。

$curproc->reply_message( {
        type        => "text/plain; charset=iso-2022-jp",
        path        => "/usr/local/etc/fml/main.cf",
        filename    => "main.cf",
        disposition => "main.cf example",
    });

$curproc->reply_message( {
        type        => "image/gif",
        path        => "/some/where/logo001.gif",
        filename    => "logo.gif",
        disposition => "attachment",
    });

[HOME] [github] [twitter] [blog] [fml4] [fml8] [北海道] Powered by NetBSD and [nuinui.net] .
Copyright (C) 1993-2022 Ken'ichi Fukamachi mail:< fukachan at fml.org >