# $Id: majordomo-admin.cf,v 1.5 1997/02/25 05:40:57 fitz Exp $ # Config file for Majordomo administration commands # package config; $name = "Majordomo"; # Tell MailServ that we need a password $needPassword = 1; # Minimum size (characters) for the newconfig command # This will help prevent screwups. Not yet implemented. $newconfigSize = 100; #---------------------------------------------------------------------- # Majordomo commands, and the order in which they should appear. # If you don't want to support a particular command, # just comment it out of this array. # @commands = ( "subscribe", "unsubscribe", "who", "lists", "which", "passwd", "help", "enter", "", # split the table into two columns "mkdigest", "index", "get", "info", "newinfo", "config", "newconfig", "writeconfig", ); # Corresponding desciption for command %description = ( "subscribe", "Subscribe", "unsubscribe", "Unsubscribe", "passwd", "Change the list password.", "mkdigest", "Generate a digest for the list.", "who", "Who is on the mailing list?", "lists", "Show other lists on this server.", "help", "Get help for $name commands.", "enter", "Enter Majordomo commands", "info", "Get the list info file.", "newinfo", "Replace the list info file:", "config", "Get the list config file.", "newconfig", "Replace the list config file:", "writeconfig", "Re-write the list config file.", "which", "Search all list subscriptions for:", "index", "List files in the archive.", "get", "Get a file from the archive:", ); ####################################################################### #---------------------------------------------------------------------- # Majordomo command forms #---------------------------------------------------------------------- ####################################################################### # Code for the commands that are used in both the administrative # interface and the user interface require "majordomo-share.cf"; use strict; #---------------------------------------------------------------------- # subscribe command # $config::command{"subscribe"} = < Addresses: EOT sub process_subscribe { my(@commands,$addr); &main::error("Before you can subscribe an address ", "you must enter the name of the mailing list.") unless $main::in{"list"}; &main::error("Before you can subscribe an address ", "you must enter the list admin password.") unless $main::in{"password"}; &main::error("You must enter an address to subscribe.") unless $main::in{"majordomoSubscribe"}; # approve subscribe
# Multiple files are allowed foreach $addr (split(/\n/, $main::in{"majordomoSubscribe"})) { # Skip empty lines next if $addr =~ /^\s*$/; push(@commands, ("approve " . &hidePassword($main::in{password}) . " subscribe $main::in{list} $addr")); } # Return the commands @commands; } #---------------------------------------------------------------------- # unsubscribe command # $config::command{"unsubscribe"} = < Addresses: EOT sub process_unsubscribe { my(@commands,$addr); &main::error("Before you can unsubscribe an address, ", "you must enter the name of the mailing list.") unless $main::in{"list"}; &main::error("Before you can unsubscribe an address, ", "you must enter the list admin password.") unless $main::in{"password"}; &main::error("You must enter an address to unsubscribe.") unless $main::in{"majordomoUnsubscribe"}; # approve unsubscribe
foreach $addr (split(/\n/, $main::in{"majordomoUnsubscribe"})) { # Skip empty lines next if $addr =~ /^\s*$/; push(@commands, ("approve " . &hidePassword($main::in{password}) . " unsubscribe $main::in{list} $addr")); } # Return the commands @commands; } #---------------------------------------------------------------------- # passwd command # $config::command{"passwd"} = < New: Retype: EOT sub process_passwd { &main::error("Before you can change the password ", "you must enter the name of the mailing list.") unless $main::in{"list"}; &main::error("Before you can change the password ", "you must enter the current password.") unless $main::in{"password"}; &main::error("You must enter the new password twice.") unless ($main::in{"majordomoPassNew"} && $main::in{"majordomoPassRetype"}); &main::error("The new password must match the retyped password.") unless ($main::in{"majordomoPassNew"} eq $main::in{"majordomoPassRetype"}); # passwd "passwd $main::in{list} " . &hidePassword($main::in{password}) . " " . &hidePassword($main::in{majordomoPassNew}); } #---------------------------------------------------------------------- # mkdigest command # sub process_mkdigest { &main::error("Before you can make a digest ", "you must enter the digest listname.") unless ($main::in{"list"}); &main::error("Before you can make a digest ", "you must enter the list admin password.") unless $main::in{"password"}; # mkdigest "mkdigest $main::in{list} " . &hidePassword($main::in{"password"}); } #---------------------------------------------------------------------- # newinfo command # $config::command{"newinfo"} = < New info: (paste your modified list info file into the field above) EOT sub process_newinfo { local($*) = 1; # allow multi-line matches &main::error("Before you can set the list info ", "you must enter the listname.") unless $main::in{"list"}; &main::error("Before you can update the list info ", "you must enter the list admin password.") unless $main::in{"password"}; &main::error("You must enter a new info file.") unless $main::in{"majordomoNewinfo"}; # newinfo # # ... # EOF # Add "EOF" to the end (if it is not already there) $main::in{"majordomoNewinfo"} .= "\nEOF\n" unless $main::in{"majordomoNewinfo"} =~ /\s*EOF\s*$/; "newinfo $main::in{list} " . &hidePassword($main::in{"password"}) . "\n" . $main::in{"majordomoNewinfo"}; } #---------------------------------------------------------------------- # config command # sub process_config { &main::error("Before you can get the list config ", "you must enter the listname.") unless ($main::in{"list"}); &main::error("Before you can get the list config ", "you must enter the list admin password.") unless $main::in{"password"}; # config "config $main::in{list} " . &hidePassword($main::in{"password"}); } #---------------------------------------------------------------------- # newconfig command # $config::command{"newconfig"} = < New config: (paste your modified list config file into the field above) EOT sub process_newconfig { local($*) = 1; # allow multi-line matches &main::error("Before you can update the list config ", "you must enter the listname.") unless $main::in{"list"}; &main::error("Before you can update the list config ", "you must enter the list admin password.") unless $main::in{"password"}; &main::error("You must enter a new config file.") unless $main::in{"majordomoNewconfig"}; # newconfig # # ... # EOF # Add "EOF" to the end (if it is not already there) $main::in{"majordomoNewconfig"} .= "\nEOF\n" unless $main::in{"majordomoNewconfig"} =~ /\s*EOF\s*$/; "newconfig $main::in{list} " . &hidePassword($main::in{"password"}) . "\n" . $main::in{"majordomoNewconfig"}; } #---------------------------------------------------------------------- # writeconfig command # sub process_writeconfig { &main::error("Before you can re-write the list config ", "you must enter the listname.") unless ($main::in{"list"}); &main::error("Before you can get re-write list config ", "you must enter the list admin password.") unless $main::in{"password"}; # writeconfig "writeconfig $main::in{list} " . &hidePassword($main::in{"password"}); } 1;