NONE TITLE 3.html
Keywords: NONE TITLE,fml, flexible mailing list manager, not listserv style but fmlserv emulates listserv or majordomo style

[PREVIOUS CHAPTER] [______TOC_______]

3 Examples

    3.1	convert articles to SJIS+CRLF

    fml-support: 08941

    If you article by mailbox format in SJIS+CRLF, try this hook.

    $DISTRIBUTE_CLOSE_HOOK = q#
        my ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0..6];
        my $dir = "$DIR/mailbox";
        my $mailbox =
           $dir .'/'.sprintf("%04d%02d%02d", 1900 + $year, $mon + 1, $mday);

        &Mkdir($dir);

        if ( open($mailbox, ">> $mailbox") ) {
            my $body = "\n". $Envelope{'Body'};
            $body =~ s/\nFrom /\n>From /g;
            $body = &JSTR($body, 'sjis');

            print $mailbox "From $From_address \n";
            print $mailbox $Envelope{'Hdr'};
            print $mailbox $body ;
            print $mailbox "\n";
            close($mailbox);
        }
        else {
            &Log("ERROR: cannot open $mailbox");
        }
    #;