# $Id: smartlist.cf,v 1.4 1997/02/25 05:42:17 fitz Exp $
# Config file for SmartList
#

package config;
$name = "SmartList";

# This server does not require a mailing list name
$noList = 1;

# Allow only one command per message
$max = 1;

@commands =
    (
     "subscribe",
     "unsubscribe",
     "help",
     "archive_help",
     "",
     "archive_list",
     "archive_get",
     );
%description =
    (
     "subscribe", "Subscribe",
     "unsubscribe", "Unsubscribe",
     "help", "Get help for <em>$name</em> commands.",
     "archive_list", "List files in the archive.",
     "archive_get", "Get a file from the archive.",
     "archive_help", "Get help for <em>$name</em> archive commands.",
     );

#######################################################################
#----------------------------------------------------------------------
# SmartList command forms
#----------------------------------------------------------------------
#######################################################################

use strict;

#----------------------------------------------------------------------
# help command
#
sub process_help
{
    $config::subject = "help";
}
#----------------------------------------------------------------------
# archive help command
#
sub process_archive_help
{
    $config::subject = "archive help";
}
#----------------------------------------------------------------------
# subscribe command
#
sub process_subscribe
{
    $config::subject = "subscribe";
}
#----------------------------------------------------------------------
# unsubscribe command
#
sub process_unsubscribe
{
    $config::subject = "unsubscribe";
}
#----------------------------------------------------------------------
# archive_list command
$config::command{"archive_list"} = <<EOT;
<TABLE>
<TR><TD></TD><TD><FONT SIZE="-1">(<EM>optional</EM>)</FONT></TD></TR>
<TR>
<TD ALIGN=right><FONT SIZE="-1">Directory:</FONT></TD>
<TD><FONT SIZE="-1"><INPUT NAME=archive_dirs SIZE="$main::size"></FONT></TD>
</TR>
</TABLE>
EOT

sub process_archive_list
{
    $config::subject = "archive";
    "ls $main::in{archive_dirs}";
}
#----------------------------------------------------------------------
# archive_get command
$config::command{"archive_get"} = <<EOT;
<TABLE>
<TR>
<TD ALIGN=right><FONT SIZE="-1">Filename:</FONT></TD>
<TD><FONT SIZE="-1"><INPUT NAME=archive_file SIZE="$main::size"></FONT></TD>
</TR>
</TABLE>
EOT

sub process_archive_get
{
    &main::error("You must enter a filename to retrieve.")
      unless $main::in{"archive_file"};

    $config::subject = "archive";

    "get $main::in{archive_file}";
}

1;
