Browse code

mailman with recaptcha patch

Hanno authored on 07/09/2018 13:00:34
Showing 10 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,10 @@
1
+AUX 50_mailman.conf-r2 482 BLAKE2B 670ff96cdfed658558a1062259bb95441bb5ca2f54f710532f2ec075efbfb0c216fad255fcac158cb6ef2d987bedccc0feaa518fd2190692922b9ddb2e0d4840 SHA512 c279f8709ea7932469c0d8ff0b645df228562678081df5fc3d946d62f7bbbc33f4723e71fd4560eebfc751052a6a271d4aadf6affadefeca107f41d3193563d3
2
+AUX README.gentoo-r3 6691 BLAKE2B aa740e1936f756f8eeecfb88629adc36c33d43ab283a298752865913efc1d068ceb45884d9c33fa45fc4e34e6016b6981f42769172fb7f2bac8dd842faa8e26c SHA512 12490bb17b4da308f0855fa9f5e36c2c01c806822021d3ac92dc15cc7901a417dbeb1e1f78c9df2603128076bd11d9ded0a946f4cedd3b056a1694afbdab28d3
3
+AUX mailman-2.1.14_rc1-directory-check.patch 786 BLAKE2B 24cde989fac774ecaea27075ee58c583bf7812cb0b9b4b12a84bba99e144dd060df2f557d952827a5243c1daccd80fdac7353f931e3fc36d903e26aec595e5fe SHA512 510a67915163732ae05ed9f8920f93eb99538a706d85e4fb2c071e01a6d88be8cd32aa5ea0127d36a1dc4f7a735c179bb1169e7358025ee7d3c85b0c8cda44d7
4
+AUX mailman-2.1.26-add-recaptcha.diff 1828 BLAKE2B efdd502ca8dc24b3553169bb9802c01ddf475cfa6e5b1ddedbf026e2a7c990233c5e1f6d82a2358204e452a904b2e989d8abb44c9db9ea2d95ec82c8cd3dbd2f SHA512 d2e1ab22fceb1fec9275f7e6a11a15a26df0fc4d0e5d25dd3b3d2f4b4ac72853f3eaac871ee4209f33c636fb05619fa0ff7a6ad674638c38fa384adbe3fee8e6
5
+AUX mailman-2.1.9-icons.patch 555 BLAKE2B c000931d44321f0eb9fabdf1a49cfcd05b2c68a3809f302f9275eade918135bc231860cf9c2ab798827b9f1e5baf59a74cbaabc3787e95f3001426425ebf6de2 SHA512 caec3eb1abdb29e92ebd6a589f93870ffc91bbcc7bd2e0115e38f48ae0a31e564037a4a828395229ee238d215e72e19a31d53c8bca6c39a48b5c08a327e663a6
6
+AUX mailman.rc 488 BLAKE2B 76f35e4e1a5257b6aa058b0cea29cf53640322d436a195140cd71b7bc749d4205fc4555b611b1713663604c08ca929b3aa57d60355d8e9e5e9b7056b9dc1c5f1 SHA512 bb97f6fec48cf474be66c1aa73adc874ceaeee894acc3fad76f4b3f5e6f82dcd4238a6915de941fe87f815668dfb6c5ffe90926c5aaaddedf7dc06dfa4c1a126
7
+AUX mailman.service 288 BLAKE2B 64dad97b16458f9d9b64f249f9096e4217ce78e9a33e9d3ea55ef27d11daea102a1ecae30ddda095c1bbf1b175def17b9ad2db5a3e0b8e694ab02ed94a557e87 SHA512 c4a5532666afbebc5aa69463ec9b9eaa2dcb03fdd8fd62307920a4572d0c795c1d93478236240746018be617c0eec0fcfcc1c711e8810140fb8ffbc0a9b71009
8
+DIST mailman-2.1.29.tgz 9376258 BLAKE2B 63ae740abed79d2887eef35ddfd8b51f22ee984a0eaacddeb34afb8147c0d239e5eaf93579face987b3c604653fed4c13233de78298914b4eacf5a33f769a997 SHA512 ed25179a4580092629890664c5502908b20e326c2ed06ad4e597fb4e8de84076c369ecd7a272be5ed8a1cb4479413d0e004d87804de763ee850e4d04d9a83376
9
+EBUILD mailman-2.1.29.ebuild 6131 BLAKE2B c37906d43cf3c77804479ad14557b8f4aeb4f24ed7223b56394cf3bfd8d2d4bba47202c7930d1304cdbfef921eced937e3eab6997397667be4b7858dc12eab44 SHA512 335d412bdd89f23ad19d1e686e7af01678837c2e7fae13cee6496e9616ed18b4af69b4d87adcf83feb6f8c12b0c37ceb8e478a808d0aadf2446b6e5989dcecf6
10
+MISC metadata.xml 398 BLAKE2B 47faf896df7388b5df4d4066764385d64413e8a48d57fee0ca63c98b574a2b219bae96d099f3e0f2f18988ae0aaf6e7c400b07c59bb02f4dbb77b740e1b76adc SHA512 e12fcde6e9360aaab80a5cece049ca20ba8deca00c7051987d0903d1dd9992545d62c10186f05dca6fed28682050efe704cc3ffd92bbcb0ceb9ce5ce972cf62f
0 11
new file mode 100644
... ...
@@ -0,0 +1,18 @@
1
+<IfDefine MAILMAN>
2
+	ScriptAlias /mailman/ "/usr/local/mailman/cgi-bin/"
3
+	<Directory "/usr/local/mailman/cgi-bin/">
4
+		AllowOverride None
5
+		Options None
6
+	</Directory>
7
+
8
+	Alias /pipermail/ "/usr/local/mailman/archives/public/"
9
+	<Directory "/usr/local/mailman/archives/public/">
10
+		AllowOverride None
11
+		Options ExecCGI FollowSymLinks
12
+	</Directory>
13
+
14
+	Alias /mailman-icons/ "/usr/local/mailman/icons/"
15
+	<Directory "/usr/local/mailman/icons/">
16
+		AllowOverride None
17
+	</Directory>
18
+</IfDefine>
0 19
new file mode 100644
... ...
@@ -0,0 +1,181 @@
1
+# Copyright 1999-2004 Gentoo Foundation
2
+# Distributed under the terms of the GNU General Public License v2
3
+
4
+Follow these instructions to finish setting up mailman. This file and the
5
+original ebuild were tweaked by me <lamer@gentoo.org> but were graciously
6
+submitted by Joby Walker (YOU RULE!) 
7
+2003 Jul 09: updated by Jesus Perez and re-tweaked by me <raker@gentoo.org>
8
+for 2.1.x.
9
+
10
+Please view the documentation on Mailman at: http://www.list.org/
11
+
12
+This documentation assumes you're using the default gentoo path
13
+(/usr/lib/mailman/), if you've changed it with MAILMAN_PREFIX, adjust them
14
+accordingly.
15
+
16
+1) If this is your first time installing mailman, after your "emerge mailman",
17
+you need to add -D MAILMAN to /etc/conf.d/apache or /etc/conf.d/apache2 and restart
18
+apache.
19
+
20
+2) In your /etc/conf.d/apache (for apache 1.x)
21
+	or /etc/conf.d/apache2 (for apache 2.x) 
22
+	file add the additional option to the
23
+	APACHE_OPTS or APACHE2_OPTS variable:
24
+
25
+	-D MAILMAN
26
+
27
+3) Make sure mailman is a part of the cron group
28
+
29
+4) This must be done as user mailman:
30
+
31
+	su - mailman
32
+
33
+Add the cron jobs:
34
+
35
+	cd cron
36
+	crontab crontab.in
37
+	cd ..
38
+
39
+Create the site password:
40
+
41
+	bin/mmsitepass
42
+
43
+and main list:
44
+
45
+	bin/newlist mailman
46
+
47
+
48
+5) Change back to root:
49
+
50
+	exit
51
+
52
+(Postfix users: read the notes at the end of this file before you continue)
53
+Add this to /etc/mail/aliases (and see point 9 for notes):
54
+     mailman:              "|/usr/lib/mailman/mail/mailman post mailman"
55
+     mailman-admin:        "|/usr/lib/mailman/mail/mailman admin mailman"
56
+     mailman-bounces:      "|/usr/lib/mailman/mail/mailman bounces mailman"
57
+     mailman-confirm:      "|/usr/lib/mailman/mail/mailman confirm mailman"
58
+     mailman-join:         "|/usr/lib/mailman/mail/mailman join mailman"
59
+     mailman-leave:        "|/usr/lib/mailman/mail/mailman leave mailman"
60
+     mailman-owner:        "|/usr/lib/mailman/mail/mailman owner mailman"
61
+     mailman-request:      "|/usr/lib/mailman/mail/mailman request mailman"
62
+     mailman-subscribe:    "|/usr/lib/mailman/mail/mailman subscribe mailman"
63
+     mailman-unsubscribe:  "|/usr/lib/mailman/mail/mailman unsubscribe mailman"
64
+
65
+For courier, the aliases have to go to /etc/courier/aliases and you have to skip
66
+the quotes.
67
+
68
+Run newaliases (only if you use sendmail).
69
+
70
+	newaliases
71
+    
72
+6) Start the mailman daemon:
73
+
74
+	/etc/init.d/mailman start
75
+
76
+and add it to default runlevel (optional but recommended):
77
+
78
+	rc-update add mailman default
79
+
80
+7) For each list created (either with web interface or with bin/newlist) 
81
+this must be added to /etc/mail/aliases (see smrsh notes below)
82
+replace <list-name> with the name of the list:
83
+
84
+	<list-name>: "|/usr/lib/mailman/mail/mailman post <list-name>"
85
+	<list-name>-admin: "|/usr/lib/mailman/mail/mailman admin <list-name>"
86
+	<list-name>-bounces: "|/usr/lib/mailman/mail/mailman bounces <list-name>"
87
+     	<list-name>-confirm: "|/usr/lib/mailman/mail/mailman confirm <list-name>"
88
+     	<list-name>-join: "|/usr/lib/mailman/mail/mailman join <list-name>"
89
+	<list-name>-leave: "|/usr/lib/mailman/mail/mailman leave <list-name>"
90
+	<list-name>-owner: "|/usr/lib/mailman/mail/mailman owner <list-name>"
91
+	<list-name>-request: "|/usr/lib/mailman/mail/mailman request <list-name>"
92
+     	<list-name>-subscribe: "|/usr/lib/mailman/mail/mailman subscribe <list-name>"
93
+	<list-name>-unsubscribe: "|/usr/lib/mailman/mail/mailman unsubscribe <list-name>"
94
+
95
+For courier, the aliases have to go to /etc/courier/aliases and you have to skip
96
+the quotes.
97
+
98
+Run newaliases:
99
+
100
+	newaliases
101
+
102
+smrsh notes
103
+-----------
104
+(if you use sendmail, you are surely using srmsh) you must note that 
105
+sendmail won't run any program outside of EBINDIR. I tried to change 
106
+EBINDIR using,define(`confEBINDIR', `/usr/lib/mailman/mail')dnl in 
107
+sendmail.mc but it didn't work, so mailman must be placed in EBINDIR, 
108
+which in Gentoo is /usr/adm/sm.bin, so you must run as root:
109
+
110
+     ln -s /usr/lib/mailman/mail/mailman /usr/adm/sm.bin/mailman
111
+
112
+And the lines in /etc/mail/aliases which refer to 
113
+/usr/lib/mailman/mail/mailman must be changed to mailman:
114
+
115
+     <list-name>:              "|mailman post <list-name>"
116
+     <list-name>-admin:        "|mailman admin <list-name>"
117
+     <list-name>-bounces:      "|mailman bounces <list-name>"
118
+     <list-name>-confirm:      "|mailman confirm <list-name>"
119
+     <list-name>-join:         "|mailman join <list-name>"
120
+     <list-name>-leave:        "|mailman leave <list-name>"
121
+     <list-name>-owner:        "|mailman owner <list-name>"
122
+     <list-name>-request:      "|mailman request <list-name>"
123
+     <list-name>-subscribe:    "|mailman subscribe <list-name>"
124
+     <list-name>-unsubscribe:  "|mailman unsubscribe <list-name>"
125
+
126
+exim notes
127
+----------
128
+You can write an exim stanza for the router and transport that looks something
129
+like (Derived from, and in part taken from cpanel):
130
+
131
+mailman_virtual_router:
132
+	driver = accept
133
+	require_files = /var/lib/mailman/lists/${lc::$local_part}/config.pck
134
+	local_part_suffix_optional
135
+	local_part_suffix = -admin     : \
136
+						-bounces   : -bounces+* : \
137
+						-confirm   : -confirm+* : \
138
+						-join      : -leave     : \
139
+						-owner     : -request   : \
140
+						-subscribe : -unsubscribe
141
+	transport = mailman_virtual_transport
142
+
143
+mailman_virtual_transport:
144
+    driver = pipe
145
+    command = /usr/lib/mailman/mail/mailman \
146
+              '${if def:local_part_suffix \
147
+                    {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}} \
148
+                    {post}}' \
149
+              ${lc:$local_part}
150
+    current_directory = /usr/lib/mailman
151
+    home_directory = /usr/lib/mailman
152
+    user = mailman
153
+    group = mailman
154
+
155
+Note the double colon in the require files.  See
156
+http://wiki.exim.org/FAQ/General_Debugging/Q0060 for more information.
157
+
158
+This should be modified if you're using the vhosts USE flag, specifically you
159
+need to modify the location of the config.pck file, to be
160
+${lc::$local_part}-${lc::$domain} instead of simply ${lc::$local_part}, and for the
161
+transport you need to change the last part of the command in the same fashion.
162
+
163
+Other Helpful things to know...
164
+-------------------------------
165
+run "bin/check_perms -f" from the root mailman directory
166
+(/usr/lib/mailman) to check and fix permission problems.
167
+
168
+The INSTALL file is located in /usr/share/doc/mailman-$VERSION/ 
169
+
170
+Postfix notes
171
+-------------
172
+If you're using Postfix, don't manually change your /etc/mail/aliases
173
+file, as described above. Instead, follow these instructions:
174
+
175
+http://list.org/mailman-install/node13.html
176
+
177
+This will set up Mailman and Postfix to automatically generate the new
178
+aliases when you create new lists. It will also make sure that Postfix
179
+uses the correct group ID when it's talking to Mailman, otherwise you
180
+will get security errors from Mailman.
181
+
0 182
new file mode 100644
... ...
@@ -0,0 +1,19 @@
1
+--- mailman-2.1.14rc1/bin/update	2010-09-09 18:51:09.000000000 +0200
2
+@@ -35,6 +35,7 @@
3
+ """
4
+ 
5
+ import os
6
++import stat
7
+ import sys
8
+ import time
9
+ import errno
10
+@@ -428,7 +429,7 @@
11
+     # Now update for the Mailman 2.1.5 qfile format.  For every filebase in
12
+     # the qfiles/* directories that has both a .pck and a .db file, pull the
13
+     # data out and re-queue them.
14
+-    for dirname in os.listdir(mm_cfg.QUEUE_DIR):
15
++    for dirname in [x for x in os.listdir(mm_cfg.QUEUE_DIR) if stat.S_ISDIR(os.stat(os.path.join(mm_cfg.QUEUE_DIR,x)).st_mode)]:
16
+         dirpath = os.path.join(mm_cfg.QUEUE_DIR, dirname)
17
+         if dirpath == mm_cfg.BADQUEUE_DIR:
18
+             # The files in qfiles/bad can't possibly be pickles
0 19
new file mode 100644
... ...
@@ -0,0 +1,49 @@
1
+--- listinfo.py	2018-02-26 14:56:48.000000000 +0000
2
+@@ -31,6 +31,7 @@
3
+ from Mailman import i18n
4
+ from Mailman.htmlformat import *
5
+ from Mailman.Logging.Syslog import syslog
6
++from recaptcha.client import captcha
7
+ 
8
+ # Set up i18n
9
+ _ = i18n._
10
+@@ -244,6 +245,10 @@
11
+     replacements[''] = mlist.FormatFormStart('listinfo')
12
+     replacements[''] = mlist.FormatBox('fullname', size=30)
13
+ 
14
++    # Captcha
15
++    replacements['<mm-recaptcha-javascript>'] = captcha.displayhtml(mm_cfg.RECAPTCHA_PUBLIC_KEY, use_ssl=True, version=2)
16
++    replacements['<mm-recaptcha-script>'] = captcha.load_script(version=2)
17
++
18
+     # Do the expansion.
19
+     doc.AddItem(mlist.ParseTags('listinfo.html', replacements, lang))
20
+     print doc.Format()
21
+--- subscribe.py	2018-02-26 14:56:38.000000000 +0000
22
+@@ -32,6 +32,7 @@
23
+ from Mailman.UserDesc import UserDesc
24
+ from Mailman.htmlformat import *
25
+ from Mailman.Logging.Syslog import syslog
26
++from recaptcha.client import captcha
27
+ 
28
+ SLASH = '/'
29
+ ERRORSEP = '\n\n<p>'
30
+@@ -165,6 +166,17 @@
31
+             results.append(
32
+     _('There was no hidden token in your submission or it was corrupted.'))
33
+             results.append(_('You must GET the form before submitting it.'))
34
++
35
++    # recaptcha
36
++    captcha_response = captcha.v2submit(
37
++        cgidata.getvalue('g-recaptcha-response', ""),
38
++        mm_cfg.RECAPTCHA_PRIVATE_KEY,
39
++        remote,
40
++    )
41
++
42
++    if not captcha_response.is_valid:
43
++        results.append(_('Invalid captcha: %s' % captcha_response.error_code))
44
++
45
+     # Was an attempt made to subscribe the list to itself?
46
+     if email == mlist.GetListEmail():
47
+         syslog('mischief', 'Attempt to self subscribe %s: %s', email, remote)
0 48
new file mode 100644
... ...
@@ -0,0 +1,12 @@
1
+diff -rau mailman-2.1.9-orig/Mailman/Defaults.py.in mailman-2.1.9-mailman-icons/Mailman/Defaults.py.in
2
+--- mailman-2.1.9-orig/Mailman/Defaults.py.in	2006-08-04 14:20:33.000000000 +0200
3
+@@ -54,7 +54,7 @@
4
+ # disable Mailman's logo footer altogther, hack
5
+ # Mailman/htmlformat.py:MailmanLogo(), which also contains the hardcoded links
6
+ # and image names.
7
+-IMAGE_LOGOS = '/icons/'
8
++IMAGE_LOGOS = '/mailman-icons/'
9
+ 
10
+ # The name of the Mailman favicon
11
+ SHORTCUT_ICON = 'mm-icon.png'
0 12
new file mode 100644
... ...
@@ -0,0 +1,26 @@
1
+#!/sbin/openrc-run
2
+# Copyright 1999-2004 Gentoo Foundation
3
+# Distributed under the terms of the GNU General Public License v2
4
+
5
+depend() {
6
+	need net
7
+	use logger
8
+}
9
+
10
+start() {
11
+	ebegin "Starting mailman"
12
+	su - mailman -c 'bin/mailmanctl -s start' >/dev/null 2>&1
13
+	eend $?
14
+}
15
+
16
+stop() {
17
+	ebegin "Stopping mailman"
18
+	su - mailman -c 'bin/mailmanctl stop' >/dev/null 2>&1
19
+	eend $?
20
+}
21
+
22
+svc_restart() {
23
+	ebegin "Restarting mailman"
24
+	su - mailman -c 'bin/mailmanctl restart' >/dev/null 2>&1
25
+	eend $?
26
+}
0 27
new file mode 100644
... ...
@@ -0,0 +1,13 @@
1
+[Unit]
2
+Description=GNU Mailing List Manager
3
+After=network.target
4
+
5
+[Service]
6
+User=mailman
7
+ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
8
+ExecReload=/usr/lib/mailman/bin/mailmanctl restart
9
+ExecStop=/usr/lib/mailman/bin/mailmanctl stop
10
+Type=forking
11
+
12
+[Install]
13
+WantedBy=multi-user.target
0 14
new file mode 100644
... ...
@@ -0,0 +1,173 @@
1
+# Copyright 1999-2018 Gentoo Foundation
2
+# Distributed under the terms of the GNU General Public License v2
3
+
4
+EAPI=5
5
+
6
+PYTHON_COMPAT=( python2_7 )
7
+
8
+inherit eutils python-single-r1 multilib systemd user
9
+
10
+DESCRIPTION="A python-based mailing list server with an extensive web interface"
11
+SRC_URI="mirror://sourceforge/${PN}/${P/_p/-}.tgz"
12
+HOMEPAGE="http://www.list.org/"
13
+
14
+LICENSE="GPL-2"
15
+SLOT="0"
16
+KEYWORDS="amd64 ppc x86"
17
+IUSE="selinux"
18
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
19
+
20
+DEPEND="
21
+	${PYTHON_DEPS}
22
+	virtual/mta
23
+	virtual/cron
24
+	virtual/httpd-cgi
25
+	dev-python/python-recaptcha
26
+	virtual/python-dnspython[${PYTHON_USEDEP}]"
27
+RDEPEND="${DEPEND}
28
+	selinux? ( sec-policy/selinux-mailman )
29
+"
30
+
31
+S="${WORKDIR}/${P/_p/-}"
32
+
33
+pkg_setup() {
34
+	python-single-r1_pkg_setup
35
+	INSTALLDIR=${MAILMAN_PREFIX:-"/usr/$(get_libdir)/mailman"}
36
+	VAR_PREFIX=${MAILMAN_VAR_PREFIX:-"/var/lib/mailman"}
37
+	CGIUID=${MAILMAN_CGIUID:-apache}
38
+	CGIGID=${MAILMAN_CGIGID:-apache}
39
+	MAILUSR=${MAILMAN_MAILUSR:-mailman}
40
+	MAILUID=${MAILMAN_MAILUID:-280}
41
+	MAILGRP=${MAILMAN_MAILGRP:-mailman}
42
+	MAILGID=${MAILMAN_MAILGID:-280}
43
+
44
+	# Bug #58526: switch to enew{group,user}.
45
+	# need to add mailman here for compile process.
46
+	# Duplicated at pkg_postinst() for binary install.
47
+	enewgroup ${MAILGRP} ${MAILGID}
48
+	enewuser  ${MAILUSR} ${MAILUID} /bin/bash ${INSTALLDIR} mailman,cron
49
+}
50
+
51
+src_prepare() {
52
+	epatch "${FILESDIR}/${PN}-2.1.14_rc1-directory-check.patch"
53
+	epatch "${FILESDIR}/${PN}-2.1.9-icons.patch"
54
+	epatch "${FILESDIR}/${PN}-2.1.26-add-recaptcha.diff"
55
+	sed -i \
56
+	-e 's:<mm-digest-question-end>:<mm-digest-question-end><tr><td>\&nbsp;</td><td><mm-recaptcha-javascript></td></tr>:g' \
57
+	-e 's:</TITLE>:</TITLE>\n<MM-Recaptcha-Script>:g' \
58
+	./templates/*/listinfo.html
59
+}
60
+
61
+src_configure() {
62
+	econf \
63
+		--without-permcheck \
64
+		--prefix="${INSTALLDIR}" \
65
+		--with-mail-gid=${MAILGID} \
66
+		--with-cgi-gid=${CGIGID} \
67
+		--with-cgi-ext="${MAILMAN_CGIEXT}" \
68
+		--with-var-prefix="${VAR_PREFIX}" \
69
+		--with-username=${MAILUSR} \
70
+		--with-groupname=${MAILGRP} \
71
+		--with-python="${PYTHON}"
72
+}
73
+
74
+src_install () {
75
+	emake "DESTDIR=${D}" doinstall
76
+
77
+	insinto /etc/apache2/modules.d
78
+	newins "${FILESDIR}/50_mailman.conf-r2" 50_mailman.conf
79
+	sed \
80
+		-e "s:/usr/local/mailman/cgi-bin:${INSTALLDIR}/cgi-bin:g" \
81
+		-e "s:/usr/local/mailman/icons:${INSTALLDIR}/icons:g" \
82
+		-e "s:/usr/local/mailman/archives:${VAR_PREFIX}/archives:g" \
83
+		-i "${D}/etc/apache2/modules.d/50_mailman.conf" || die
84
+
85
+	newdoc "${FILESDIR}/README.gentoo-r3" README.gentoo
86
+
87
+	dodoc ACK* BUGS FAQ NEWS README* TODO UPGRADING INSTALL contrib/mailman.mc \
88
+		contrib/README.check_perms_grsecurity contrib/virtusertable
89
+
90
+	exeinto ${INSTALLDIR}/bin
91
+	doexe build/contrib/*.py contrib/majordomo2mailman.pl contrib/auto \
92
+		contrib/mm-handler*
93
+
94
+	dodir /etc/mailman
95
+	mv "${D}/${INSTALLDIR}/Mailman/mm_cfg.py" "${D}/etc/mailman"
96
+	dosym /etc/mailman/mm_cfg.py ${INSTALLDIR}/Mailman/mm_cfg.py
97
+
98
+	# Save the old config for updates from pre-2.1.9-r2
99
+	# To be removed some distant day
100
+	for i in /var/mailman /home/mailman /usr/local/mailman ${INSTALLDIR}; do
101
+		if [ -f ${i}/Mailman/mm_cfg.py ] && ! [ -L ${i}/Mailman/mm_cfg.py ]; then
102
+			cp ${i}/Mailman/mm_cfg.py "${D}/etc/mailman/mm_cfg.py" || die
103
+		fi
104
+	done
105
+
106
+	newinitd "${FILESDIR}/mailman.rc" mailman
107
+	cp "${FILESDIR}/mailman.service" "${T}/mailman.service" || die
108
+	sed -i "s/^User=.*/User=${MAILUSR}/" "${T}/mailman.service" || die
109
+	systemd_dounit "${T}/mailman.service"
110
+
111
+	keepdir ${VAR_PREFIX}/logs
112
+	keepdir ${VAR_PREFIX}/locks
113
+	keepdir ${VAR_PREFIX}/spam
114
+	keepdir ${VAR_PREFIX}/archives/public
115
+	keepdir ${VAR_PREFIX}/archives/private
116
+	keepdir ${VAR_PREFIX}/lists
117
+	keepdir ${VAR_PREFIX}/qfiles
118
+
119
+	chown -R ${MAILUSR}:${MAILGRP} "${D}/${VAR_PREFIX}" "${D}/${INSTALLDIR}" "${D}"/etc/mailman/* || die
120
+	chown ${CGIUID}:${MAILGRP} "${D}/${VAR_PREFIX}/archives/private" || die
121
+	chmod 2775 "${D}/${INSTALLDIR}" "${D}/${INSTALLDIR}"/templates/* \
122
+		"${D}/${INSTALLDIR}"/messages/* "${D}/${VAR_PREFIX}" "${D}/${VAR_PREFIX}"/{logs,lists,spam,locks,archives/public} || die
123
+	chmod 2770 "${D}/${VAR_PREFIX}/archives/private" || die
124
+	chmod 2770 "${D}/${VAR_PREFIX}/qfiles" || die
125
+	chmod 2755 "${D}/${INSTALLDIR}"/cgi-bin/* "${D}/${INSTALLDIR}/mail/mailman" || die
126
+
127
+	python_optimize "${D}/${INSTALLDIR}/bin/" \
128
+		"${D}/${INSTALLDIR}/Mailman/" \
129
+		"${D}/${INSTALLDIR}/Mailman/*"
130
+}
131
+
132
+pkg_postinst() {
133
+	enewgroup ${MAILGRP} ${MAILGID}
134
+	enewuser  ${MAILUSR} ${MAILUID} -1 ${INSTALLDIR} mailman,cron
135
+	echo
136
+	elog "Please read /usr/share/doc/${PF}/README.gentoo.bz2 for additional"
137
+	elog "Setup information, mailman will NOT run unless you follow"
138
+	elog "those instructions!"
139
+	echo
140
+
141
+	elog "An example Mailman configuration file for Apache has been installed into:"
142
+	elog "  ${APACHE2_MODULES_CONFDIR}/50_mailman.conf"
143
+	echo
144
+	elog "To enable, you will need to add \"-D MAILMAN\" to"
145
+	elog "/etc/conf.d/apache2."
146
+	echo
147
+
148
+	ewarn "Default-Configuration has changed deeply in 2.1.9-r2. You can configure"
149
+	ewarn "mailman with the following variables:"
150
+	ewarn "MAILMAN_PREFIX (default: /usr/$(get_libdir)/mailman)"
151
+	ewarn "MAILMAN_VAR_PREFIX (default: /var/lib/mailman)"
152
+	ewarn "MAILMAN_CGIUID (default: apache)"
153
+	ewarn "MAILMAN_CGIGID (default: apache)"
154
+	ewarn "MAILMAN_CGIEXT (default: empty)"
155
+	ewarn "MAILMAN_MAILUSR (default: mailman)"
156
+	ewarn "MAILMAN_MAILUID (default: 280)"
157
+	ewarn "MAILMAN_MAILGRP (default: mailman)"
158
+	ewarn "MAILMAN_MAILGID (default: 280)"
159
+	ewarn
160
+	ewarn "Config file is now symlinked in /etc/mailman, so etc-update works."
161
+	ewarn
162
+	ewarn "If you're upgrading from below 2.1.9-r2 or changed MAILMAN_PREFIX, you"
163
+	ewarn "NEED to make a few manual updates to your system:"
164
+	ewarn
165
+	ewarn "1.  Update your mailman users's home directory: usermod -d ${INSTALLDIR} mailman"
166
+	ewarn "2.  Re-import the crontab: su - mailman -c 'crontab cron/crontab.in'"
167
+	ewarn "3.  Copy your old mm_cfg.py file to /etc/mailman/mm_cfg.py"
168
+	ewarn
169
+	ewarn "Additionally if you've modified MAILMAN_VAR_PREFIX (or upgraded from"
170
+	ewarn "a pre 2.1.9-r2 installation), you should move your old lists/ and"
171
+	ewarn "archives/ directory to the new location, ensuring that the"
172
+	ewarn "permissions is correct.  See bug #208789 for a discussion."
173
+}
0 174
new file mode 100644
... ...
@@ -0,0 +1,14 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
+<pkgmetadata>
4
+	<maintainer type="person">
5
+		<email>hanno@gentoo.org</email>
6
+	</maintainer>
7
+	<maintainer type="project">
8
+		<email>net-mail@gentoo.org</email>
9
+		<name>Net-Mail</name>
10
+	</maintainer>
11
+	<upstream>
12
+		<remote-id type="sourceforge">mailman</remote-id>
13
+	</upstream>
14
+</pkgmetadata>