[PREVIOUS CHAPTER] [______TOC_______]

2 Customize error messages

    	/var/spool/ml/elena/messages.Japanese.conf
    	/var/spool/ml/elena/messages.conf

    2.1	Search order for keywords for fml messages

    A lot of keywords for error messages are built-in.  The keyword format
    is "filename.key.word". For example, fml searchs "auth.ok" in the
    following order.

    	/var/spool/ml/elena/messages.Japanese.conf
    	/var/spool/ml/elena/messages.conf
    	/var/spool/ml/elena/messages/Japanese/auth
    	/var/spool/ml/etc/fml/messages/Japanese/auth
    	/usr/local/fml/messages/Japanese/auth

    If fml searches the keyword without . (e.g. no_such_file), the order
    follows:

    	/var/spool/ml/elena/messages.Japanese.conf
    	/var/spool/ml/elena/messages.conf
    	/var/spool/ml/elena/messages/Japanese/kern
    	/var/spool/ml/etc/fml/messages/Japanese/kern
    	/usr/local/fml/messages/Japanese/kern

    2.2	Example: messages.conf

    cut and paste the keyword from

    	/usr/local/fml/messages/Japanese/

    unlink:
    	remove _ARG0_

    auth.ok:
    	authenticated

    auth.fail:
    	failed to authenticate

    2.3	Example: Search

    You add "auth.ok" to /var/spool/ml/elena/messages.conf.  The search
    order of keywors is the following way: If you search "auth.ok",
    messages.conf is used.  If you search "auth.fail",
    /usr/local/fml/messages/English/auth is used.

    2.4	modify error message for oversize error

    copy /usr/local/fml/messages/Japanese/resource somewhere, edit the
    paragraph of  resource.too_big:.

    resource.too_big:

    3	Samples

    3.1	remove help messages

    sub DUMMY {};
    $PROC_GEN_INFO = 'DUMMY';

    $PROC_GEN_INFO = 'DUMMY';

    disables the following help messages.

    --elena@fml.org, Be Seeing You!

    ************************************************************

           Help: <mailto:elena-ctl@fml.org?body=help>
    Unsubscribe: <mailto:elena-ctl@fml.org?body=unsubscribe>

    If you have any questions or problems,
       please contact elena-admin@fml.org
           or
       send e-mail with the body "help"(without quotes) to
          elena-ctl@fml.org
          (here is the automatic reply, so more preferable)

    e.g. on a Unix Machine
    (shell prompt)% echo "help" |Mail elena-ctl@fml.org

    ************************************************************

    3.2	Example: hack confirmation messages

    fml-support: 07974, 07975

    The message templates fml uses exists in /usr/local/fml/messages/
    directory. Copy the apporopriate file to ML HOME directory, and edit
    it.

    	% cp -pr /usr/local/fml/messages /var/spool/ml/elena

    For example, messages on confirmation are in this file.
    Copy this and hack it.

    	/var/spool/ml/elena/messages/Japanese/confirm

    confirm.auto_regist.preamble:
    	...

    3.3	hack welcome message in subscribed

    * Firstly hack $DIR/welcome (e.g. /var/spool/ml/elena/welcome)

    * Secondarly edit /usr/local/fml/messages/Japanese/amctl to change
      the first paragraph.

    amctl.added.caution:

    [KNOWN_BUGS]

    3.4	nuke the fist paragraph in welcome message

    see the previous recipe.

    amctl.added.caution:

    Q: customize welcome message in registration

    A: sorry it is hard coded but you can customize only in Japanese mode.
    In the near future, we should expand it by using &MesgLE(). It is just
    a problem to define templates.

    3.5	Mail Preamble And Trailer

    To append additional information, you can use $PREAMBLE_MAILBODY and
    $TRAILER_MAILBODY. The command mail reply body becomes

    	$PREAMBLE_MAILBODY
    	command mail reply
    	$TRAILER_MAILBODY

    FML DOES NOT IMPLEMENT THE VARIABLE TO REWRITE MAIL BODY IN TO
    PRESERVE MORAL. It is against morals to rewrite mail body even if it
    is an electric mail. We should treat it as the same as a postal mail.
    The rewriting is to cut out a postal mail and rewrite it is mail
    forgery.
    If you rewrite the distribution mail, please use a hook BY YOUR OWN
    RESPONSIBILITY AND RISK.

    Example: In this hook %e == %Envelope. Append "Mail Count:
    sequence-number" in the begging of distributed articles.

       $SMTP_OPEN_HOOK = q# $e{'Body'} .= "Mail Count: $ID\n\n".$e{'Body'}; #;

    Example: Append "how to get help" to the last of a distributed article.

       $SMTP_OPEN_HOOK = q%

    	$e{'Body'} .=
           "\nTo need help, please send 'help' to elena-ctl\@fml.org.";

       %;

&DEFINE_MODE('disablenotify'); amctl.added.caution: Q: customize welcome message in registration A: sorry it is hard coded but you can customize only in Japanese mode. In the near future, we should expand it by using &MesgLE(). It is just a problem to define templates. $START_HOOK = q# my ($s) = &GET_BUFFER_FROM_FILE("$DIR/info"); &ENVELOPE_APPEND('Body', &STR2JIS($s)); #; 1. degital signature 2. MIME If you rewrite the distribution mail, please use a hook BY YOUR OWN RESPONSIBILITY AND RISK. $SMTP_OPEN_HOOK = q% my($help_message) = "\n---\nHELP: please send 'help' to $CONTROL_ADDRESS"; $e{'Body'} .= $help_message; %;