File: fixlist.pl.dist

package info (click to toggle)
listar 0.129a-2.potato2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,692 kB
  • ctags: 2,002
  • sloc: ansic: 27,106; makefile: 906; perl: 105; sh: 61
file content (53 lines) | stat: -rwxr-xr-x 1,571 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/perl
#
# This is a quicky script for rebuilding aliases you lost for Listar
# mailing lists.  Useful if you accidentally blow away your
# listar.aliases, as I have been known to do.

# Alter these two.
chomp ($myhost = `cat /etc/mailname`);
$mydir = "/usr/lib/listar";

$mylog = "/var/log/listar.log";


# Main body

chdir($mydir);

print (STDERR "Listar list creation shortcut.\n");
print (STDERR "-------\n");
print (STDERR "Please note that all addresses should be full ones, e.g.\n");
print (STDERR "'listar\@listar.org' instead of just 'listar'.\n");
print (STDERR "\n");
print (STDERR "The 'admin' address should be an address from which mail can be\n");
print (STDERR "SENT, not just received.\n");
print (STDERR "-------\n");
print (STDERR "New list name: ");

$listname = <>;
if ($listname =~ /(.*)/) 
{
   $listname = $1;
}

print (STDERR "List admin address: ");

$listowner = <>;
if ($listowner =~ /(.*)/) 
{
   $listowner = $1;
}

print (STDERR "Creating $listname with owner $listowner.\n");
print (STDERR "Spitting information to add to aliases on stdout.\n");

print ("\n# Aliases for list '$listname'\n");
print ("$listname: \"|$mydir/listar -s $listname\"\n");
print ("$listname-request: \"|$mydir/listar -r $listname\"\n");
print ("$listname-repost: \"|$mydir/listar -a $listname\"\n");
print ("$listname-admins: \"|$mydir/listar -admins $listname\"\n");
print ("$listname-moderators: \"|$mydir/listar -moderators $listname\"\n");
print ("$listname-bounce: \"|$mydir/listar -bounce $listname\"\n");
print ("$listname-owner: $listowner\n");