# $Id: pmdf.cf,v 1.3 1997/02/25 05:42:07 fitz Exp $
# Config file for PMDF Mailserv
#

package config;
$name = "PMDF Mailserv";
@commands =
    (
     "subscribe",
     "unsubscribe",
     "lists",
     "dir",
     "", # Split columns here
     "help",
     "enter",
     );
%description =
    (
     "subscribe", "Subscribe",
     "unsubscribe", "Unsubscribe",
     "lists", "Show other lists on this server.",
     "dir", "Show other lists that match this pattern.",
     "help", "Get help for <em>$name</em> commands.",
     "enter", "Enter a <em>$name</em> command.",
     );

#######################################################################
#----------------------------------------------------------------------
# PMDF Mailserv command forms
#----------------------------------------------------------------------
#######################################################################

use strict;

#----------------------------------------------------------------------
# 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}";
}
#----------------------------------------------------------------------
# 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";
}
#----------------------------------------------------------------------
# lists command
#
sub process_lists
{
    "LISTS";
}
#----------------------------------------------------------------------
# dir command
#
$config::command{"dir"} = <<EOT;
<TABLE>
<TR>
<TD ALIGN=right><FONT SIZE="-1">Pattern:</FONT></TD>
<TD><FONT SIZE="-1"><INPUT NAME=PMDFdir SIZE="$main::size" VALUE="*"></FONT></TD>
</TR>
</TABLE>
EOT

sub process_dir
{
    &main::error("You must enter a directory patter.")
      unless $main::in{"PMDFdir"};

    "DIRECTORY/LIST $main::in{PMDFdir}";
}
#----------------------------------------------------------------------
# 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}";
}

1;
