Skip to Content.
Sympa Menu

devel - [sympa-dev] some contribution... to add easily a list

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: "Xavier RENAUT" <address@concealed>
  • To: address@concealed
  • Subject: [sympa-dev] some contribution... to add easily a list
  • Date: Sun, 16 Jan 2000 19:41:34 +0100 (MET)

you have to look at the headers (variables)

you have to be root (to update aliases)

well, what to say else....
it not beautiful code. I'm looking for good documentation available
on the web.

I'm working on structures
(the config file, even if it works, is ugly)

I'll add a ncurses interface, and probably a tkinterface.
(with pert tk and perl curses, of course)

I would like to have your point of view on my script.
(and some hacks, if you want.......)

bye

Xavier

______________
address@concealed
#!/usr/bin/perl -w
#
# newlist.pl
# Copyright (c) 2000 xavier renaut
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA

#$SYMPA="/usr/local/sympa/sympa";
$SYMPA=".";
#$ALIASES="/etc/aliases";
$ALIASES="aliases";
$LISTMASTER="xrenaut\@risc.fr";

sub getconf {
print "nomliste : ";
$nomliste=<>;


%list=("subject","","visibility","","custom_subject","","send","","reply_to","","subscribe","","unsubscribe","","review","","email","");
foreach (keys %list)
{
print "$_ : ";
$list{$_}=<>;

}
}



sub printaliases
{

chomp $nomliste;
open(ALI,">> $ALIASES");
$DATES=`date`;
chomp $DATES;
print ALI<<EOF;
#
# added by newlist.sh at $DATES ajout for list "$nomliste" ------------
#


$nomliste: "|$SYMPA/bin/queue $nomliste"
$nomliste-request: "|$SYMPA/bin/queue $nomliste-request"
$nomliste-unsubscribe: "|$SYMPA/bin/queue $nomliste-unsubscribe"
$nomliste-owner: listmaster


#

EOF

close ALI;

}

sub printconf
{

print "writing aliases\n";
&printaliases;
print "updating aliases";
system 'newaliases'; # || die "yo ! can't update aliases $!" ;
print ".\n";

chomp $nomliste;
mkdir "$SYMPA/expl/$nomliste",0700 || die "yo ! can't create
$SYMPA/expl/$nomliste/ $!";
open (CONF,">> $SYMPA/expl/$nomliste/config") || die "yo ! can't open
$SYMPA/expl/$nomliste/config $!";
`chown sympa.sympa $SYMPA/expl/$nomliste`;
`chown sympa.sympa $SYMPA/expl/$nomliste/config`;
open (STATS,">> $SYMPA/expl/$nomliste/stats");
`chown sympa.sympa $SYMPA/expl/$nomliste/stats`;
close STATS;
print "Configuration:\n";
foreach (keys %list)
{
if ($_ =~/email/)
{
print "owner\n";
print CONF "owner\n";
}
print "$_ $list{$_}";
print CONF "$_ $list{$_}\n\n";



}
print CONF<<EOT;
archive
period week
access owner

web_archive
access owner

user_data_source database
EOT


print CONF "\nowner\nemail $LISTMASTER\n";

close CONF;


}

sub printalias
{
open (ALIAS,">> $ALIASES");
close ALIAS;
}

sub main {
&getconf;
&printalias;
&printconf;
}


&main;


  • [sympa-dev] some contribution... to add easily a list, Xavier RENAUT, 01/16/2000

Archive powered by MHonArc 2.6.19+.

Top of Page