Hanno Böck commited on 2019-11-10 14:34:55
Zeige 7 geänderte Dateien mit 0 Einfügungen und 231 Löschungen.
... | ... |
@@ -1,9 +0,0 @@ |
1 |
-AUX courier-pythonfilter-fix-charset-issue-and-controlfile-issue.diff 2175 BLAKE2B e69f1bd4c4d7567d7ded99685d2b1aa177cbf5a7c5d9aed35dd1ff5c297cbb0c14c7bbbfcf25b0c2a284a0eba48583ee28057948fdec2d830293ed18d73d6494 SHA512 5efaea5188f5e97b3343c1e2b2dc99ef23e61f29aa7ca150144e9aa16e49b2c2790aadff877a46fcd37fcfce68bd26d2c9a38f984f1283b62a3ddb382d816b65 |
|
2 |
-AUX courier-pythonfilter-ipv6-networkblocks.patch 1257 BLAKE2B 4f1a59347a34676d996f8ecc1bbc7c15296d86466dd236cc638ea0ec87fffaa4faef2b57fbd55bc6714d21b81911a3cf62ce2387b719d7bbdf01021ccceff55e SHA512 29c80a3f247259d35076c985a54e9e053b61867da12849fa1bffc98ba45e9d56cd3afda9d61c9b65e2cfc9897e313d2ce40e14b71157aa5df03d58728ce92c37 |
|
3 |
-AUX courier-pythonfilter-whitelist-sender.patch 2205 BLAKE2B f136fb9d5fef6ccf70edea0c36e324060778c5adcd9621b4955dde5563e3d55d7c733743df0ebd59ef700961acdfcbd97f9d3fe2330076406bb07e0a8f0f0055 SHA512 9a25b079ed7b7680ba59809a1cf600c53b0ca688f138e01255e8d47ba34d144996381ac38d5a0ce93986c73e0c59adf59661d8824c190371744c789b4a667d75 |
|
4 |
-DIST courier-pythonfilter-1.11.tar.gz 65193 BLAKE2B 9b14e8caa6f173abb15c74c43854c917c61731e0610a9acd4f4e8300043663dca6f00e99f9c7eed7296bb07a37726457a6aaa182981e522632057ffc70250bbf SHA512 75ffff7d9692861c535ee18d1d25954c79e81275641172ad706caf0c65dc715ffd4a1c021b0e26fc992fffdf6c2842ed8fc688eff82ec42591b35af834c0ace4 |
|
5 |
-DIST courier-pythonfilter-3.0.2.tar.gz 59121 BLAKE2B 6223ddd62c1c1af980720451e3446cd3b2296a243c5c8d3b5e60fd8640e3391ba2e561ea251bbacbb4a1c6cdbe7eccf6f7ff8221d952cf5703d389b0267a1a2f SHA512 62985a3fefc2d324b3ba7035117e88e4e246815e63fe1b681af11a38a20ea55e649a233c1979b918b166f5c2abbcc22037f215b73be298763f777648249cd652 |
|
6 |
-DIST courier-pythonfilter-3.0.tar.gz 59420 BLAKE2B 61ab15a0ee55a0cba5bde632cb28a0f17e4b0285e0a7060e5771b5ea2ecde8bc1306cc2b1c0b3833e521a8ca5a899ae9f56fdb26f89c76d38e0ce25ea75e8f04 SHA512 6c13c65111ac6ab86d93d3ccfa27208c963dbf4fd67b86d3948fa1935c131fd2ca5944cb4163ecf71355760ccb478faf59974ee0573b9e74bc163f633333c5c0 |
|
7 |
-EBUILD courier-pythonfilter-1.11.ebuild 626 BLAKE2B 92901ce0f943e1e9036dd859e8b5a376f625315ac10df504faaf967419e81234e820fa15156f645b2fe01f49affded41af9a48861eb95c18e2db6546c293a815 SHA512 19eb0bd699ebb65a0a2a451742d7ca5331f2c830877dece69314103f7b7636fa1f066860daf596b711377e749a317ad4ceed8496287fac16a4eaade74d6cd831 |
|
8 |
-EBUILD courier-pythonfilter-3.0.2.ebuild 498 BLAKE2B 9585022201b151a162ae3c6e0b70b95c5a949baa6cc670817e0e41fa333cc2f5569ea8cd573dbdd96db69a1c9a30691799a73f97e90ee4baa21fa2875304f20f SHA512 e3d59b8e67f9ea46d4340cdf69f5e478a6d03e6cf17f7801fd81db4302505a6cfd56cc1d81c74c07a29cb6d51f0ff34356df13eeff8929997f03e6d6604e4046 |
|
9 |
-EBUILD courier-pythonfilter-3.0.ebuild 568 BLAKE2B 43d07c8b880429e9f971fbc7727ddc1781b325ba0d58987d6b2a9444a19aa78fe605bb3ca55b076ed65ba6cc8a67725735c6e1b7c03f9397b3ebf41210472fe7 SHA512 3654aea2cad4ec8a97fcae8b7b7a92194da63e1046bc5c3f028f0aea15103a0ef39bdf3674619a8271a2133196a486133b60b9bc125167f6b51e65dd2e7e4a17 |
... | ... |
@@ -1,27 +0,0 @@ |
1 |
-# Copyright 1999-2017 Gentoo Foundation |
|
2 |
-# Distributed under the terms of the GNU General Public License v2 |
|
3 |
- |
|
4 |
-EAPI=6 |
|
5 |
- |
|
6 |
-PYTHON_COMPAT=( python2_7 ) |
|
7 |
- |
|
8 |
-inherit distutils-r1 |
|
9 |
- |
|
10 |
-DESCRIPTION="Python filtering architecture for the Courier MTA" |
|
11 |
-HOMEPAGE="https://pypi.python.org/pypi/courier-pythonfilter/" |
|
12 |
-SRC_URI="http://phantom.dragonsdawn.net/~gordon/${PN}/${P}.tar.gz" |
|
13 |
- |
|
14 |
-LICENSE="GPL-3" |
|
15 |
-SLOT="0" |
|
16 |
-KEYWORDS="~amd64" |
|
17 |
-IUSE="" |
|
18 |
- |
|
19 |
-RDEPEND="" |
|
20 |
-DEPEND="dev-python/setuptools[${PYTHON_USEDEP}] |
|
21 |
- mail-mta/courier" |
|
22 |
- |
|
23 |
-PATCHES=( |
|
24 |
- "${FILESDIR}/courier-pythonfilter-ipv6-networkblocks.patch" |
|
25 |
- "${FILESDIR}/courier-pythonfilter-whitelist-sender.patch" |
|
26 |
- ) |
|
27 |
- |
... | ... |
@@ -1,21 +0,0 @@ |
1 |
-# Copyright 1999-2019 Gentoo Authors |
|
2 |
-# Distributed under the terms of the GNU General Public License v2 |
|
3 |
- |
|
4 |
-EAPI=7 |
|
5 |
- |
|
6 |
-PYTHON_COMPAT=( python3_{5,6,7} ) |
|
7 |
- |
|
8 |
-inherit distutils-r1 |
|
9 |
- |
|
10 |
-DESCRIPTION="Python filtering architecture for the Courier MTA" |
|
11 |
-HOMEPAGE="https://bitbucket.org/gordonmessmer/courier-pythonfilter/src/default/" |
|
12 |
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" |
|
13 |
- |
|
14 |
-LICENSE="GPL-3" |
|
15 |
-SLOT="0" |
|
16 |
-KEYWORDS="~amd64" |
|
17 |
-IUSE="" |
|
18 |
- |
|
19 |
-RDEPEND="" |
|
20 |
-DEPEND="dev-python/setuptools[${PYTHON_USEDEP}] |
|
21 |
- mail-mta/courier" |
... | ... |
@@ -1,23 +0,0 @@ |
1 |
-# Copyright 1999-2019 Gentoo Authors |
|
2 |
-# Distributed under the terms of the GNU General Public License v2 |
|
3 |
- |
|
4 |
-EAPI=7 |
|
5 |
- |
|
6 |
-PYTHON_COMPAT=( python3_{5,6,7} ) |
|
7 |
- |
|
8 |
-inherit distutils-r1 |
|
9 |
- |
|
10 |
-DESCRIPTION="Python filtering architecture for the Courier MTA" |
|
11 |
-HOMEPAGE="https://pypi.python.org/pypi/courier-pythonfilter/" |
|
12 |
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" |
|
13 |
- |
|
14 |
-LICENSE="GPL-3" |
|
15 |
-SLOT="0" |
|
16 |
-KEYWORDS="~amd64" |
|
17 |
-IUSE="" |
|
18 |
- |
|
19 |
-RDEPEND="" |
|
20 |
-DEPEND="dev-python/setuptools[${PYTHON_USEDEP}] |
|
21 |
- mail-mta/courier" |
|
22 |
- |
|
23 |
-PATCHES="${FILESDIR}/courier-pythonfilter-fix-charset-issue-and-controlfile-issue.diff" |
... | ... |
@@ -1,60 +0,0 @@ |
1 |
-diff -r e76f1ee05cc8 courier/control.py |
|
2 |
---- a/courier/control.py Sun Apr 28 14:56:49 2019 -0700 |
|
3 |
-+++ b/courier/control.py Fri Aug 09 12:31:26 2019 +0200 |
|
4 |
-@@ -73,7 +73,7 @@ |
|
5 |
- sender = get_senders_mta(control_paths) |
|
6 |
- if not sender: |
|
7 |
- return None |
|
8 |
-- ipstr = sender.partition('[')[2].partition(']')[0] |
|
9 |
-+ ipstr = sender.rpartition('[')[2].partition(']')[0] |
|
10 |
- if not ipstr: |
|
11 |
- return None |
|
12 |
- sender_ip = ipaddress.ip_address(ipstr) |
|
13 |
-diff -r e76f1ee05cc8 courier/xfilter.py |
|
14 |
---- a/courier/xfilter.py Sun Apr 28 14:56:49 2019 -0700 |
|
15 |
-+++ b/courier/xfilter.py Fri Aug 09 12:31:26 2019 +0200 |
|
16 |
-@@ -26,6 +26,7 @@ |
|
17 |
- import email.generator |
|
18 |
- import courier.control |
|
19 |
- import courier.config |
|
20 |
-+import tempfile |
|
21 |
- |
|
22 |
- |
|
23 |
- class XFilterError(Exception): |
|
24 |
-@@ -86,18 +87,24 @@ |
|
25 |
- return self.control_data |
|
26 |
- |
|
27 |
- def submit(self): |
|
28 |
-- bfo = open(self.body_path, 'r+') |
|
29 |
-- bfo.truncate(0) |
|
30 |
-- g = email.generator.Generator(bfo, mangle_from_=False) |
|
31 |
-- g.flatten(self.message) |
|
32 |
-- # Make sure that the file ends with a newline, or courier |
|
33 |
-- # will choke on the new message file. |
|
34 |
-- bfo.seek(0, 2) |
|
35 |
-- bfo.seek(bfo.tell() - 1, 0) |
|
36 |
-- if bfo.read(1) != '\n': |
|
37 |
-- bfo.seek(0, 2) |
|
38 |
-- bfo.write('\n') |
|
39 |
-- bfo.close() |
|
40 |
-+ with tempfile.TemporaryFile(mode='w+b', prefix='pythonfilter') as tmp: |
|
41 |
-+ g = email.generator.BytesGenerator(tmp, mangle_from_=False) |
|
42 |
-+ g.flatten(self.message) |
|
43 |
-+ # Make sure that the file ends with a newline, or courier |
|
44 |
-+ # will choke on the new message file. |
|
45 |
-+ tmp.seek(0, 2) |
|
46 |
-+ tmp.seek(tmp.tell() - 1, 0) |
|
47 |
-+ if tmp.read(1).decode('ascii') != '\n': |
|
48 |
-+ tmp.seek(0, 2) |
|
49 |
-+ tmp.write('\n'.encode('ascii')) |
|
50 |
-+ tmp.seek(0) |
|
51 |
-+ with open(self.body_path, 'r+b') as bfo: |
|
52 |
-+ bfo.truncate(0) |
|
53 |
-+ while True: |
|
54 |
-+ data = tmp.read(4096) |
|
55 |
-+ if not data: |
|
56 |
-+ break |
|
57 |
-+ bfo.write(data) |
|
58 |
- return '' |
|
59 |
- |
|
60 |
- # Deprecated names preserved for compatibility with older releases |
... | ... |
@@ -1,32 +0,0 @@ |
1 |
-From 85c456fce923cb967fb3852d81763eb74093cc26 Mon Sep 17 00:00:00 2001 |
|
2 |
-From: Bernd Wurst <bernd@milch.schokokeks.org> |
|
3 |
-Date: Tue, 14 Mar 2017 14:44:28 +0100 |
|
4 |
-Subject: [PATCH] Add IPv6 network calculation |
|
5 |
- |
|
6 |
---- |
|
7 |
- filters/greylist.py | 12 ++++++++++-- |
|
8 |
- 1 file changed, 10 insertions(+), 2 deletions(-) |
|
9 |
- |
|
10 |
-diff --git a/filters/greylist.py b/filters/greylist.py |
|
11 |
-index ad044ea..ffc1eb7 100644 |
|
12 |
---- a/filters/greylist.py |
|
13 |
-+++ b/filters/greylist.py |
|
14 |
-@@ -87,8 +87,16 @@ def doFilter(bodyFile, controlFileList): |
|
15 |
- # Calculate the /24 network |
|
16 |
- IPv4Match = _IPv4Regex.match(sendersIP) |
|
17 |
- if(IPv4Match is None): |
|
18 |
-- # IPv6 network calculation isn't handled yet |
|
19 |
-- sendersIPNetwork = sendersIP |
|
20 |
-+ # possibly IPv6 |
|
21 |
-+ try: |
|
22 |
-+ pos = sendersIP.rindex(':') |
|
23 |
-+ sendersIPNetwork = sendersIP[:pos+1] |
|
24 |
-+ # If there are not more than 4 colons left in the address after stripping, something is wrong |
|
25 |
-+ if sendersIPNetwork.count(':') < 5: |
|
26 |
-+ raise ValueError('Too generic address or no valid ipv6 address: %s\n' % sendersIPNetwork) |
|
27 |
-+ except ValueError as e: |
|
28 |
-+ sendersIPNetwork = sendersIP |
|
29 |
-+ sys.stderr.write(str(e)) |
|
30 |
- else: |
|
31 |
- sendersIPNetwork = IPv4Match.group(1) |
|
32 |
- |
... | ... |
@@ -1,59 +0,0 @@ |
1 |
-From 61f1ae2cd94ece9e452e8fd02dbdf4d2f91f85e2 Mon Sep 17 00:00:00 2001 |
|
2 |
-From: Bernd Wurst <bernd@milch.schokokeks.org> |
|
3 |
-Date: Tue, 14 Mar 2017 15:44:40 +0100 |
|
4 |
-Subject: [PATCH] Add configurable mode that whitelists only senders IP |
|
5 |
- addresses instead of triplets |
|
6 |
- |
|
7 |
---- |
|
8 |
- filters/greylist.py | 24 +++++++++++++++++++++++- |
|
9 |
- 1 file changed, 23 insertions(+), 1 deletion(-) |
|
10 |
- |
|
11 |
-diff --git a/filters/greylist.py b/filters/greylist.py |
|
12 |
-index ffc1eb7..614e4c4 100644 |
|
13 |
---- a/filters/greylist.py |
|
14 |
-+++ b/filters/greylist.py |
|
15 |
-@@ -42,6 +42,7 @@ |
|
16 |
- sendersPassedTTL = 60 * 60 * 24 * 36 |
|
17 |
- sendersNotPassedTTL = 60 * 60 * 24 |
|
18 |
- greylistTime = 300 |
|
19 |
-+onlySendersIP = False |
|
20 |
- |
|
21 |
- _IPv4Regex = re.compile('^(\d+\.\d+\.\d+)\.\d+$') |
|
22 |
- |
|
23 |
-@@ -113,6 +114,22 @@ def doFilter(bodyFile, controlFileList): |
|
24 |
- _sendersPassed.purge() |
|
25 |
- _sendersNotPassed.purge() |
|
26 |
- |
|
27 |
-+ if onlySendersIP: |
|
28 |
-+ found = False |
|
29 |
-+ addrMd5 = hashlib.md5(sendersIPNetwork) |
|
30 |
-+ addrdigest = addrMd5.hexdigest() |
|
31 |
-+ _sendersPassed.lock() |
|
32 |
-+ try: |
|
33 |
-+ if _sendersPassed.has_key(addrdigest): |
|
34 |
-+ _Debug('address found in the Passed db') |
|
35 |
-+ _sendersPassed[addrdigest] = time.time() |
|
36 |
-+ found = True |
|
37 |
-+ finally: |
|
38 |
-+ _sendersPassed.unlock() |
|
39 |
-+ |
|
40 |
-+ if found: |
|
41 |
-+ return '' |
|
42 |
-+ |
|
43 |
- # Create a new MD5 object. The sender/recipient/IP triplets will |
|
44 |
- # be stored in the db in the form of an MD5 digest. |
|
45 |
- senderMd5 = hashlib.md5(sender) |
|
46 |
-@@ -152,7 +169,12 @@ def doFilter(bodyFile, controlFileList): |
|
47 |
- biggestTimeToGo = timeToGo |
|
48 |
- else: |
|
49 |
- _Debug('triplet in NotPassed db is now passed') |
|
50 |
-- _sendersPassed[cdigest] = time.time() |
|
51 |
-+ if onlySendersIP: |
|
52 |
-+ addrMd5 = hashlib.md5(sendersIPNetwork) |
|
53 |
-+ addrdigest = addrMd5.hexdigest() |
|
54 |
-+ _sendersPassed[addrdigest] = time.time() |
|
55 |
-+ else: |
|
56 |
-+ _sendersPassed[cdigest] = time.time() |
|
57 |
- del(_sendersNotPassed[cdigest]) |
|
58 |
- elif _sendersPassed.has_key(cdigest): |
|
59 |
- _Debug('triplet found in the Passed db') |
|
60 | 0 |