restore mailman with recaptcha patch
Hanno Böck

Hanno Böck commited on 2020-10-03 09:39:54
Zeige 11 geänderte Dateien mit 543 Einfügungen und 0 Löschungen.

... ...
@@ -0,0 +1,11 @@
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-fix-sitedir.diff 796 BLAKE2B e59e540b424f94959e14d9a67323373c885937c1f717517b93254418c2d6a195b44bfed6a59b74e31f387840331acfb273200c51eecd2f904b20069c6c5df4c3 SHA512 d7c3909eca4cf4161e2a51418b4800203184313260914c7bfe3ea6cffb065a610dffdce9a3c61a0d429cdae9cecc097da491dd56f384273ed13bcd6da9cf75ff
7
+AUX mailman.rc 488 BLAKE2B 76f35e4e1a5257b6aa058b0cea29cf53640322d436a195140cd71b7bc749d4205fc4555b611b1713663604c08ca929b3aa57d60355d8e9e5e9b7056b9dc1c5f1 SHA512 bb97f6fec48cf474be66c1aa73adc874ceaeee894acc3fad76f4b3f5e6f82dcd4238a6915de941fe87f815668dfb6c5ffe90926c5aaaddedf7dc06dfa4c1a126
8
+AUX mailman.service 288 BLAKE2B 64dad97b16458f9d9b64f249f9096e4217ce78e9a33e9d3ea55ef27d11daea102a1ecae30ddda095c1bbf1b175def17b9ad2db5a3e0b8e694ab02ed94a557e87 SHA512 c4a5532666afbebc5aa69463ec9b9eaa2dcb03fdd8fd62307920a4572d0c795c1d93478236240746018be617c0eec0fcfcc1c711e8810140fb8ffbc0a9b71009
9
+DIST mailman-2.1.29.tgz 9376258 BLAKE2B 63ae740abed79d2887eef35ddfd8b51f22ee984a0eaacddeb34afb8147c0d239e5eaf93579face987b3c604653fed4c13233de78298914b4eacf5a33f769a997 SHA512 ed25179a4580092629890664c5502908b20e326c2ed06ad4e597fb4e8de84076c369ecd7a272be5ed8a1cb4479413d0e004d87804de763ee850e4d04d9a83376
10
+EBUILD mailman-2.1.29-r1.ebuild 6231 BLAKE2B df3c6a0413c699325170243411b44733bf57246c42a8370931c87f001a162526bb220daad25fc5b5e998abe3392877e78037181f229bc3ec614f992f7722722b SHA512 58683c62a7e2b878085522cb64499867047ba5eddf853cbe89f07741f3e29a9b16b64df203c8e45fa77489e70bda763c1adbc497a23d713c623a121a8d330cc4
11
+MISC metadata.xml 398 BLAKE2B 47faf896df7388b5df4d4066764385d64413e8a48d57fee0ca63c98b574a2b219bae96d099f3e0f2f18988ae0aaf6e7c400b07c59bb02f4dbb77b740e1b76adc SHA512 e12fcde6e9360aaab80a5cece049ca20ba8deca00c7051987d0903d1dd9992545d62c10186f05dca6fed28682050efe704cc3ffd92bbcb0ceb9ce5ce972cf62f
... ...
@@ -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,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,0 +1,19 @@
1
+--- mailman-2.1.14rc1/bin/update	2010-09-09 18:51:09.000000000 +0200
2
++++ mailman-2.1.14rc1-1/bin/update	2010-09-14 01:02:09.000000000 +0200
3
+@@ -35,6 +35,7 @@
4
+ """
5
+ 
6
+ import os
7
++import stat
8
+ import sys
9
+ import time
10
+ import errno
11
+@@ -428,7 +429,7 @@
12
+     # Now update for the Mailman 2.1.5 qfile format.  For every filebase in
13
+     # the qfiles/* directories that has both a .pck and a .db file, pull the
14
+     # data out and re-queue them.
15
+-    for dirname in os.listdir(mm_cfg.QUEUE_DIR):
16
++    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)]:
17
+         dirpath = os.path.join(mm_cfg.QUEUE_DIR, dirname)
18
+         if dirpath == mm_cfg.BADQUEUE_DIR:
19
+             # The files in qfiles/bad can't possibly be pickles
... ...
@@ -0,0 +1,49 @@
1
+--- listinfo.py	2018-02-26 14:56:48.000000000 +0000
2
++++ /usr/lib/mailman/Mailman/Cgi/listinfo.py	2018-02-26 14:08:34.000000000 +0000
3
+@@ -31,6 +31,7 @@
4
+ from Mailman import i18n
5
+ from Mailman.htmlformat import *
6
+ from Mailman.Logging.Syslog import syslog
7
++from recaptcha.client import captcha
8
+ 
9
+ # Set up i18n
10
+ _ = i18n._
11
+@@ -244,6 +245,10 @@
12
+     replacements[''] = mlist.FormatFormStart('listinfo')
13
+     replacements[''] = mlist.FormatBox('fullname', size=30)
14
+ 
15
++    # Captcha
16
++    replacements['<mm-recaptcha-javascript>'] = captcha.displayhtml(mm_cfg.RECAPTCHA_PUBLIC_KEY, use_ssl=True, version=2)
17
++    replacements['<mm-recaptcha-script>'] = captcha.load_script(version=2)
18
++
19
+     # Do the expansion.
20
+     doc.AddItem(mlist.ParseTags('listinfo.html', replacements, lang))
21
+     print doc.Format()
22
+--- subscribe.py	2018-02-26 14:56:38.000000000 +0000
23
++++ /usr/lib/mailman/Mailman/Cgi/subscribe.py	2018-02-26 14:08:18.000000000 +0000
24
+@@ -32,6 +32,7 @@
25
+ from Mailman.UserDesc import UserDesc
26
+ from Mailman.htmlformat import *
27
+ from Mailman.Logging.Syslog import syslog
28
++from recaptcha.client import captcha
29
+ 
30
+ SLASH = '/'
31
+ ERRORSEP = '\n\n<p>'
32
+@@ -165,6 +166,17 @@
33
+             results.append(
34
+     _('There was no hidden token in your submission or it was corrupted.'))
35
+             results.append(_('You must GET the form before submitting it.'))
36
++
37
++    # recaptcha
38
++    captcha_response = captcha.v2submit(
39
++        cgidata.getvalue('g-recaptcha-response', ""),
40
++        mm_cfg.RECAPTCHA_PRIVATE_KEY,
41
++        remote,
42
++    )
43
++
44
++    if not captcha_response.is_valid:
45
++        results.append(_('Invalid captcha: %s' % captcha_response.error_code))
46
++
47
+     # Was an attempt made to subscribe the list to itself?
48
+     if email == mlist.GetListEmail():
49
+         syslog('mischief', 'Attempt to self subscribe %s: %s', email, remote)
... ...
@@ -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
++++ mailman-2.1.9/Mailman/Defaults.py.in	2008-02-03 14:27:02.000000000 +0200
4
+@@ -54,7 +54,7 @@
5
+ # disable Mailman's logo footer altogther, hack
6
+ # Mailman/htmlformat.py:MailmanLogo(), which also contains the hardcoded links
7
+ # and image names.
8
+-IMAGE_LOGOS = '/icons/'
9
++IMAGE_LOGOS = '/mailman-icons/'
10
+ 
11
+ # The name of the Mailman favicon
12
+ SHORTCUT_ICON = 'mm-icon.png'
... ...
@@ -0,0 +1,24 @@
1
+diff -Naurp a/misc/paths.py.in b/misc/paths.py.in
2
+--- a/misc/paths.py.in	2018-07-25 00:01:28.000000000 +0200
3
++++ b/misc/paths.py.in	2019-08-03 11:56:57.032059619 +0200
4
+@@ -26,6 +26,7 @@
5
+ 
6
+ import os
7
+ import sys
8
++import site
9
+ 
10
+ # some scripts expect this attribute to be in this module
11
+ prefix = '@prefix@'
12
+@@ -58,9 +59,9 @@ sys.path.insert(0, prefix)
13
+ sys.path.insert(0, os.path.join(prefix, 'pythonlib'))
14
+ 
15
+ # Include Python's site-packages directory.
16
+-sitedir = os.path.join(sys.prefix, 'lib', 'python'+sys.version[:3],
17
+-                       'site-packages')
18
+-sys.path.append(sitedir)
19
++sitedirs = site.getsitepackages()
20
++for sitedir in sitedirs:
21
++    sys.path.append(sitedir)
22
+ 
23
+ # Include Python's dist-packages directory.
24
+ distdir = os.path.join(sys.prefix, 'lib', 'python'+sys.version[:3],
... ...
@@ -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,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,0 +1,176 @@
1
+# Copyright 1999-2020 Gentoo Authors
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
+	$(python_gen_cond_dep '
23
+		dev-python/python-recaptcha[${PYTHON_MULTI_USEDEP}]
24
+		dev-python/dnspython[${PYTHON_MULTI_USEDEP}]
25
+	')
26
+	virtual/mta
27
+	virtual/cron
28
+	virtual/httpd-cgi"
29
+RDEPEND="${DEPEND}
30
+	selinux? ( sec-policy/selinux-mailman )
31
+"
32
+
33
+S="${WORKDIR}/${P/_p/-}"
34
+
35
+pkg_setup() {
36
+	python-single-r1_pkg_setup
37
+	INSTALLDIR=${MAILMAN_PREFIX:-"/usr/$(get_libdir)/mailman"}
38
+	VAR_PREFIX=${MAILMAN_VAR_PREFIX:-"/var/lib/mailman"}
39
+	CGIUID=${MAILMAN_CGIUID:-apache}
40
+	CGIGID=${MAILMAN_CGIGID:-apache}
41
+	MAILUSR=${MAILMAN_MAILUSR:-mailman}
42
+	MAILUID=${MAILMAN_MAILUID:-280}
43
+	MAILGRP=${MAILMAN_MAILGRP:-mailman}
44
+	MAILGID=${MAILMAN_MAILGID:-280}
45
+
46
+	# Bug #58526: switch to enew{group,user}.
47
+	# need to add mailman here for compile process.
48
+	# Duplicated at pkg_postinst() for binary install.
49
+	enewgroup ${MAILGRP} ${MAILGID}
50
+	enewuser  ${MAILUSR} ${MAILUID} /bin/bash ${INSTALLDIR} mailman,cron
51
+}
52
+
53
+src_prepare() {
54
+	epatch "${FILESDIR}/${PN}-2.1.14_rc1-directory-check.patch"
55
+	epatch "${FILESDIR}/${PN}-2.1.9-icons.patch"
56
+	epatch "${FILESDIR}/${PN}-2.1.26-add-recaptcha.diff"
57
+	epatch "${FILESDIR}/mailman-fix-sitedir.diff"
58
+	sed -i \
59
+	-e 's:<mm-digest-question-end>:<mm-digest-question-end><tr><td>\&nbsp;</td><td><mm-recaptcha-javascript></td></tr>:g' \
60
+	-e 's:</TITLE>:</TITLE>\n<MM-Recaptcha-Script>:g' \
61
+	./templates/*/listinfo.html
62
+}
63
+
64
+src_configure() {
65
+	econf \
66
+		--without-permcheck \
67
+		--prefix="${INSTALLDIR}" \
68
+		--with-mail-gid=${MAILGID} \
69
+		--with-cgi-gid=${CGIGID} \
70
+		--with-cgi-ext="${MAILMAN_CGIEXT}" \
71
+		--with-var-prefix="${VAR_PREFIX}" \
72
+		--with-username=${MAILUSR} \
73
+		--with-groupname=${MAILGRP} \
74
+		--with-python="${PYTHON}"
75
+}
76
+
77
+src_install() {
78
+	emake "DESTDIR=${D}" doinstall
79
+
80
+	insinto /etc/apache2/modules.d
81
+	newins "${FILESDIR}/50_mailman.conf-r2" 50_mailman.conf
82
+	sed \
83
+		-e "s:/usr/local/mailman/cgi-bin:${INSTALLDIR}/cgi-bin:g" \
84
+		-e "s:/usr/local/mailman/icons:${INSTALLDIR}/icons:g" \
85
+		-e "s:/usr/local/mailman/archives:${VAR_PREFIX}/archives:g" \
86
+		-i "${D}/etc/apache2/modules.d/50_mailman.conf" || die
87
+
88
+	newdoc "${FILESDIR}/README.gentoo-r3" README.gentoo
89
+
90
+	dodoc ACK* BUGS FAQ NEWS README* TODO UPGRADING INSTALL contrib/mailman.mc \
91
+		contrib/README.check_perms_grsecurity contrib/virtusertable
92
+
93
+	exeinto ${INSTALLDIR}/bin
94
+	doexe build/contrib/*.py contrib/majordomo2mailman.pl contrib/auto \
95
+		contrib/mm-handler*
96
+
97
+	dodir /etc/mailman
98
+	mv "${D}/${INSTALLDIR}/Mailman/mm_cfg.py" "${D}/etc/mailman"
99
+	dosym /etc/mailman/mm_cfg.py ${INSTALLDIR}/Mailman/mm_cfg.py
100
+
101
+	# Save the old config for updates from pre-2.1.9-r2
102
+	# To be removed some distant day
103
+	for i in /var/mailman /home/mailman /usr/local/mailman ${INSTALLDIR}; do
104
+		if [ -f ${i}/Mailman/mm_cfg.py ] && ! [ -L ${i}/Mailman/mm_cfg.py ]; then
105
+			cp ${i}/Mailman/mm_cfg.py "${D}/etc/mailman/mm_cfg.py" || die
106
+		fi
107
+	done
108
+
109
+	newinitd "${FILESDIR}/mailman.rc" mailman
110
+	cp "${FILESDIR}/mailman.service" "${T}/mailman.service" || die
111
+	sed -i "s/^User=.*/User=${MAILUSR}/" "${T}/mailman.service" || die
112
+	systemd_dounit "${T}/mailman.service"
113
+
114
+	keepdir ${VAR_PREFIX}/logs
115
+	keepdir ${VAR_PREFIX}/locks
116
+	keepdir ${VAR_PREFIX}/spam
117
+	keepdir ${VAR_PREFIX}/archives/public
118
+	keepdir ${VAR_PREFIX}/archives/private
119
+	keepdir ${VAR_PREFIX}/lists
120
+	keepdir ${VAR_PREFIX}/qfiles
121
+
122
+	chown -R ${MAILUSR}:${MAILGRP} "${D}/${VAR_PREFIX}" "${D}/${INSTALLDIR}" "${D}"/etc/mailman/* || die
123
+	chown ${CGIUID}:${MAILGRP} "${D}/${VAR_PREFIX}/archives/private" || die
124
+	chmod 2775 "${D}/${INSTALLDIR}" "${D}/${INSTALLDIR}"/templates/* \
125
+		"${D}/${INSTALLDIR}"/messages/* "${D}/${VAR_PREFIX}" "${D}/${VAR_PREFIX}"/{logs,lists,spam,locks,archives/public} || die
126
+	chmod 2770 "${D}/${VAR_PREFIX}/archives/private" || die
127
+	chmod 2770 "${D}/${VAR_PREFIX}/qfiles" || die
128
+	chmod 2755 "${D}/${INSTALLDIR}"/cgi-bin/* "${D}/${INSTALLDIR}/mail/mailman" || die
129
+
130
+	python_optimize "${D}/${INSTALLDIR}/bin/" \
131
+		"${D}/${INSTALLDIR}/Mailman/" \
132
+		"${D}/${INSTALLDIR}/Mailman/*"
133
+}
134
+
135
+pkg_postinst() {
136
+	enewgroup ${MAILGRP} ${MAILGID}
137
+	enewuser  ${MAILUSR} ${MAILUID} -1 ${INSTALLDIR} mailman,cron
138
+	echo
139
+	elog "Please read /usr/share/doc/${PF}/README.gentoo.bz2 for additional"
140
+	elog "Setup information, mailman will NOT run unless you follow"
141
+	elog "those instructions!"
142
+	echo
143
+
144
+	elog "An example Mailman configuration file for Apache has been installed into:"
145
+	elog "  ${APACHE2_MODULES_CONFDIR}/50_mailman.conf"
146
+	echo
147
+	elog "To enable, you will need to add \"-D MAILMAN\" to"
148
+	elog "/etc/conf.d/apache2."
149
+	echo
150
+
151
+	ewarn "Default-Configuration has changed deeply in 2.1.9-r2. You can configure"
152
+	ewarn "mailman with the following variables:"
153
+	ewarn "MAILMAN_PREFIX (default: /usr/$(get_libdir)/mailman)"
154
+	ewarn "MAILMAN_VAR_PREFIX (default: /var/lib/mailman)"
155
+	ewarn "MAILMAN_CGIUID (default: apache)"
156
+	ewarn "MAILMAN_CGIGID (default: apache)"
157
+	ewarn "MAILMAN_CGIEXT (default: empty)"
158
+	ewarn "MAILMAN_MAILUSR (default: mailman)"
159
+	ewarn "MAILMAN_MAILUID (default: 280)"
160
+	ewarn "MAILMAN_MAILGRP (default: mailman)"
161
+	ewarn "MAILMAN_MAILGID (default: 280)"
162
+	ewarn
163
+	ewarn "Config file is now symlinked in /etc/mailman, so etc-update works."
164
+	ewarn
165
+	ewarn "If you're upgrading from below 2.1.9-r2 or changed MAILMAN_PREFIX, you"
166
+	ewarn "NEED to make a few manual updates to your system:"
167
+	ewarn
168
+	ewarn "1.  Update your mailman users's home directory: usermod -d ${INSTALLDIR} mailman"
169
+	ewarn "2.  Re-import the crontab: su - mailman -c 'crontab cron/crontab.in'"
170
+	ewarn "3.  Copy your old mm_cfg.py file to /etc/mailman/mm_cfg.py"
171
+	ewarn
172
+	ewarn "Additionally if you've modified MAILMAN_VAR_PREFIX (or upgraded from"
173
+	ewarn "a pre 2.1.9-r2 installation), you should move your old lists/ and"
174
+	ewarn "archives/ directory to the new location, ensuring that the"
175
+	ewarn "permissions is correct.  See bug #208789 for a discussion."
176
+}
... ...
@@ -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>
0 15