# $Id: listserv.cf,v 1.3 1997/02/25 05:40:04 fitz Exp $
# Config file for ListServ
#

package config;
$name = "ListServ";
@commands =
    (
     "subscribe",
     "signoff",
     "info",
     "query",
     "stats",
     "lists",
     "help",
     "info_topics",
     "info_topic",
     "enter",
     "", # start a new table column
     "set_mail_mode",
     "set_mail_copy",
     "set_mail_ack",
     "set_conceal",
     "set_mail_disable",
     );
%description =
    (
     "subscribe", "Subscribe:",
     "signoff", "Unsubscribe",
     "info", "Describe the mailing list.",
     "query", "Get your <em>$name</em> settings.",
     "set_mail_mode", "Set normal/digest mode:",
     "set_mail_disable", "Disable/enable mail:",
     "set_mail_copy", "CC yourself on postings:",
     "set_mail_ack", "Acknowlegements on postings:",
     "set_conceal", "Conceal/reveal your presence:",
     "lists", "Show other lists on this server.",
     "stats", "Get list statistics.",
     "enter", "Enter a <em>$name</em> command.",
     "help", "Get help for <em>$name</em> commands.",
     "info_topics", "Get a list of help topics.",
     "info_topic", "Retrieve a help topic.",
     );


#######################################################################
#----------------------------------------------------------------------
# LISTSERV command forms
#----------------------------------------------------------------------
#######################################################################

use strict;

#----------------------------------------------------------------------
# subscribe command
#
$config::command{"subscribe"} = <<EOT;
<TABLE>
<TR>
<TD ALIGN=right><FONT SIZE="-1">Your full name:</FONT></TD>
<TD><FONT SIZE="-1"><INPUT NAME=subName SIZE="$main::size"></FONT></TD>
</TR>
</TABLE>
EOT

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

    &main::error("Before you can subscribe, ",
                "you must enter your full name.")
        unless $main::in{'subName'};

    "subscribe $main::in{list} $main::in{subName}";
}
#----------------------------------------------------------------------
# info_topic command
#
    $config::command{"info_topic"} = <<EOT;
<TABLE>
<TR>
<TD ALIGN=right><FONT SIZE="-1">Help topic:</TD>
<TD><FONT SIZE="-1"><INPUT NAME=infoTopic SIZE="$main::size"></FONT></TD>
</TR>
</TABLE>
EOT

sub process_info_topic
{
    &main::error("You must enter a help topic to retrieve.")
        unless $main::in{"infoTopic"};

    "info $main::in{infoTopic}";
}
#----------------------------------------------------------------------
# set_mail_mode command
#
$config::command{'set_mail_mode'} = <<EOT;
<TABLE>
<TR>
<TD ALIGN=right><FONT SIZE="-1"><input type=radio name=mailMode value=nodigests></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=mailMode value=digest></FONT></TD>
<TD><FONT SIZE="-1">Send messages in digests.</FONT></TD>
</TR>
</TABLE>
EOT

sub process_set_mail_mode
{
    &main::error("Before you can set the mail mode, ",
                "you must enter the name of the mailing list.")
        unless $main::in{"list"};

    &main::error("You must select one of the options ",
                "for setting the mail mode.")
        unless $main::in{"mailMode"};

    "set $main::in{list} $main::in{mailMode}";
}

#----------------------------------------------------------------------
# set_mail_disable command
#
$config::command{'set_mail_disable'} = <<EOT;
<TABLE>
<TR>
<TD ALIGN=right><FONT SIZE="-1"><input type=radio name=disable value=nomail></FONT></TD>
<TD><FONT SIZE="-1">Temporarily stop sending messages.</FONT></TD>
</TR>
<TR>
<TD ALIGN=right><FONT SIZE="-1"><input type=radio name=disable value=mail></FONT></TD>
<TD><FONT SIZE="-1">Resume sending messages.</FONT></TD>
</TR>
</TABLE>
EOT

sub process_set_mail_disable
{
    &main::error("Before you can disable/enable mail, ",
                "you must enter the name of the mailing list.")
        unless $main::in{"list"};

    &main::error("You must select one of the options for disable/enable.")
        unless $main::in{"disable"};

    "set $main::in{list} $main::in{disable}";
}


#----------------------------------------------------------------------
# set_mail_copy command
#
$config::command{'set_mail_copy'} = <<EOT;
<TABLE>
<TR>
<TD ALIGN=right><FONT SIZE="-1"><input type=radio name=copyback value=repro></FONT></TD>
<TD><FONT SIZE="-1">Send me copies of my posts.</FONT></TD>
</TR>
<TR>
<TD ALIGN=right><FONT SIZE="-1"><input type=radio name=copyback value=norepro></FONT></TD>
<TD><FONT SIZE="-1">Do not send me copies.</FONT></TD>
</TR>
</TABLE>
EOT

sub process_set_mail_copy
{
    &main::error("Before you can change your copy options, ",
                "you must enter the name of the mailing list.")
        unless $main::in{"list"};

    &main::error("You must select one of the options ",
                "for copying your postings.")
        unless $main::in{"copyback"};

    "set $main::in{list} $main::in{copyback}";
}

#----------------------------------------------------------------------
# set_mail_ack command
#
$config::command{'set_mail_ack'} = <<EOT;
<TABLE>
<TR>
<TD ALIGN=right><FONT SIZE="-1"><input type=radio name=ack value=ack></FONT></TD>
<TD><FONT SIZE="-1">Send acknowledgements when I post.</FONT></TD>
</TR>
<TR>
<TD ALIGN=right><FONT SIZE="-1"><input type=radio name=ack value=noack></FONT></TD>
<TD><FONT SIZE="-1">Do not send acknowledgements.</FONT></TD>
</TR>
</TABLE>
EOT

sub process_set_mail_ack
{
    &main::error("Before you can change your acknowledgements, ",
                "you must enter the name of the mailing list.")
        unless $main::in{"list"};

    &main::error("You must select one of the options ",
                "for setting acknowledgements")
        unless $main::in{"ack"};

    "set $main::in{list} $main::in{ack}";
}

#----------------------------------------------------------------------
# set_password command
#
$config::command{"set_conceal"} = <<EOT;
<TABLE>
<TR>
<TD ALIGN=right><FONT SIZE="-1"><INPUT TYPE=radio NAME=conceal VALUE=conceal></FONT></TD>
<TD><FONT SIZE="-1">Conceal your identity</FONT></TD>
</TR>
<TR>
<TD ALIGN=right><FONT SIZE="-1"><INPUT TYPE=radio NAME=conceal VALUE=noconceal></FONT></TD>
<TD><FONT SIZE="-1">Reveal your identity</FONT></TD>
</TR>
</TABLE>
EOT

sub process_set_conceal
{
    &main::error("Before you can conceal/reveal, ",
                "you must enter a list name.")
        unless $main::in{'list'};

    &main::error("You must select one of the conceal/reveal options.")
        unless $main::in{"conceal"};

    "set $main::in{list} $main::in{conceal}";
}
#----------------------------------------------------------------------
# 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"};
}
#----------------------------------------------------------------------
# help command
#
sub process_help
{
    "help";
}
#----------------------------------------------------------------------
# info command
#
sub process_info
{
    &main::error("Before you can get info for a list, ",
                "you must enter the name of the list.")
      unless $main::in{"list"};

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

    "signoff $main::in{list}";
}
#----------------------------------------------------------------------
# stats command
#
sub process_stats
{
    &main::error("Before you can get stats for a mailing list, ",
                "you must enter the name of the list.")
        unless $main::in{"list"};

    "stats $main::in{list}";
}
#----------------------------------------------------------------------
# info_topics command
#
sub process_info_topics
{
    "info";
}
#----------------------------------------------------------------------
# query command
#
sub process_query
{
    &main::error("Before you can query a mailing list, ",
                "you must enter the name of the list.")
        unless $main::in{"list"};

    "query $main::in{list}";
}

1;
