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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
#!/usr/local/bin/python
"""Create a new, unpopulated maillist.
newlist <list-name> <list-admin's-address> <admin-password> <immediate>
You can specify as many of the arguments as you want on the command line.
The optional <immediate> argument, if present, means to send out the notice
immediately. Otherwise, the script hangs pending input, to give time for
the person creating the list to customize it before sending the admin an
email notice about the existence of the new list."""
__version__ = "$Revision: 382 $"
# $Source$
ADDALIASES_CMD = '/home/mailman/mailman/bin/addaliases'
import sys, crypt, os, string
sys.path.append('/home/mailman/mailman/modules')
import maillist, mm_utils, mm_cfg
def main(argv):
if len(argv) > 1:
list_name = argv[1]
else:
list_name = string.lower(raw_input("Enter the name of the list: "))
if list_name in mm_utils.list_names():
sys.stderr.write("** List with name %s already exists\n" % `list_name`)
return 1
if len(argv) > 2:
owner_mail = argv[2]
else:
owner_mail = raw_input(
"Enter the email of the person running the list: ")
if len(argv) > 3:
list_pw = argv[3]
else:
list_pw = raw_input("Enter the initial list password:")
newlist = maillist.MailList()
pw = crypt.crypt(list_pw , mm_utils.GetRandomSeed())
newlist.Create(list_name, owner_mail, pw)
###os.system('%s %s' % (ADDALIASES_CMD, list_name))
print '''
Entry for aliases file:
#-- %(listname)s -- mailing list aliases:
%(list)s |"%(wrapper)s post %(listname)s"
%(admin)s |"%(wrapper)s mailowner %(listname)s"
%(request)s |"%(wrapper)s mailcmd %(listname)s"
%(owner1)s %(listname)s-admin
%(owner2)s %(listname)s-admin
''' % {'listname': list_name,
'list': "%-24s" % (list_name + ":"),
'wrapper': '%s/mail/wrapper' % mm_cfg.MAILMAN_DIR,
'admin': "%-24s" % ("%s-admin:" % list_name),
'request': "%-24s" % ("%s-request:" % list_name),
'owner1': "%-24s" % ("owner-%s:" % list_name),
'owner2': "%-24s" % ("%s-owner:" % list_name)}
if len(argv) < 5:
print ("Hit enter to continue with %s owner notification..."
% list_name),
sys.stdin.readline()
sendnotice(newlist, list_name, owner_mail, list_pw)
def sendnotice(newlist, list_name, owner_mail, list_pw):
newlist.SendTextToUser(subject="Your new mailing list",
recipient=owner_mail,
sender='mailman-owner@%s' % newlist.host_name,
text='''
The mailing list '%s' has just been created for you.
Here is some basic information about your mailing list:
Your mailing list password is:
%s
You need this password to configure your mailing list. You also need it to
handle administrative requests, such as approving mail if you choose to run
a moderated list.
You can configure your mailing list at the following web page:
%s
The web page for users of your mailing list is:
%s
You can even customize these web pages from the list configuration page.
However, you do need to know html to be able to do this.
There is also an email-based interface for users (not admin) of your list -
you can get info about using it by sending a message with just the word
help as subject or in the body, to:
%s
To unsubscribe a user: from the mailing list 'listinfo' web page, click on
or enter the user's email address as if you were that user. Where that
user would put in their password to unsubscribe, put in your admin
password. You can also use your password to change member's options,
including digestification, delivery disabling, etc.
Please address all questions to mailman-owner@%s.
''' % (list_name, list_pw,
newlist.GetScriptURL('admin'), newlist.GetScriptURL('listinfo'),
"%s-request@%s" % (list_name, newlist.host_name),
newlist.host_name))
if __name__ == "__main__":
raise SystemExit(main(sys.argv))
|