# $Id: maiser.cf,v 1.3 1997/02/25 05:40:46 fitz Exp $
# Config file for Maiser
#

package config;
$name = "Maiser";
@commands =
    (
     "subscribe",
     "unsubscribe",
     "recipients",
     "lists",
     "help",
     "", # split column
     "set_mail",
     "enter",
     );
%description =
    (
     "subscribe", "Subscribe",
     "unsubscribe", "Unsubscribe",
     "recipients", "Who is on the mailing list?",
     "set_mail", "Change the way you receive messages:",
     "lists", "Show other lists on this server.",
     "enter", "Enter a <em>$name</em> command:",
     "help", "Get help for <em>$name</em> commands.",
     );

#######################################################################
#----------------------------------------------------------------------
# Maiser command forms
#----------------------------------------------------------------------
#######################################################################

use strict;

#----------------------------------------------------------------------
# help command
#
sub process_help
{
    "help";
}
#----------------------------------------------------------------------
# set_mail command
#
$config::command{"set_mail"} = <<EOT;
<TABLE>
<TR>
<TD ALIGN=right><FONT SIZE="-1"><INPUT TYPE=radio NAME=setMail VALUE=mail></FONT></TD>
<TD><FONT SIZE="-1">Send messages one at a time</FONT></TD>
</TR>
<TR>
<TD ALIGN=right><FONT SIZE="-1"><INPUT TYPE=radio NAME=setMail VALUE=digest></FONT></TD>
<TD><FONT SIZE="-1">Send messages in digests</FONT></TD>
</TR>
</TABLE>
EOT

sub process_set_mail
{
    &main::error("Before you can set your mail options ",
                "you must enter a list name.")
        unless $main::in{'list'};

    &main::error("You must select a mail option.")
        unless $main::in{'setMail'};

    "set $main::in{list} $main::in{setMail}";
}
#----------------------------------------------------------------------
# lists command
#
sub process_lists
{
    "list";
}
#----------------------------------------------------------------------
# subscribe command
#
sub process_subscribe
{
    &main::error("Before you can subscribe ",
                "you must enter the name of the mailing list.")
        unless $main::in{"list"};

    "subscribe $main::in{list}";
}
#----------------------------------------------------------------------
# unsubscribe command
#
sub process_unsubscribe
{
    &main::error("Before you can unsubscribe ",
                "you must enter the name of the mailing list.")
        unless $main::in{"list"};

    "unsubscribe $main::in{list}";
}
#----------------------------------------------------------------------
# recipients command
#
sub process_recipients
{
    &main::error("Before you can list the recipients ",
                "you must enter the name of the mailing list.")
        unless $main::in{"list"};

    "enumerate $main::in{list}";
}
#----------------------------------------------------------------------
# enter command
#
$config::command{"enter"} = <<EOT;
<TABLE>
<TR>
<TD ALIGN=right><FONT SIZE="-1">Command:</FONT></TD>
<TD><FONT SIZE="-1"><INPUT NAME=enter SIZE="$main::size"></FONT></TD>
</TR>
</TABLE>
EOT

sub process_enter
{
    &main::error("You must enter a <em>$config::name</em> command.")
      unless $main::in{"enter"};

    $main::in{"enter"};
}

1;
