Merge dkimpy-milter:dkg/python3 into dkimpy-milter:1_0
- Git
- lp:dkimpy-milter
- dkg/python3
- Merge into 1_0
Proposed by
dkg
Status: | Merged |
---|---|
Merge reported by: | Scott Kitterman |
Merged at revision: | ea09bab1a8fb9eeed3429e9a8411ee42f9c423f3 |
Proposed branch: | dkimpy-milter:dkg/python3 |
Merge into: | dkimpy-milter:1_0 |
Prerequisite: | dkimpy-milter:dkg/test-suite |
Diff against target: |
327 lines (+55/-56) 6 files modified
dkimpy_milter/__init__.py (+31/-32) dkimpy_milter/__main__.py (+1/-1) dkimpy_milter/config.py (+10/-10) dkimpy_milter/dnsplug.py (+8/-8) setup.py (+4/-4) tests/dkimpy-milter (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Scott Kitterman | Pending | ||
Review via email: mp+363528@code.launchpad.net |
Commit message
This brief series converts dkimpy-milter to python3. It depends on the test-suite branch to verify that the major functionality remains functional.
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/dkimpy_milter/__init__.py b/dkimpy_milter/__init__.py | |||
2 | index 5345fc7..bcdf2a7 100644 | |||
3 | --- a/dkimpy_milter/__init__.py | |||
4 | +++ b/dkimpy_milter/__init__.py | |||
5 | @@ -1,4 +1,4 @@ | |||
7 | 1 | #! /usr/bin/python2 | 1 | #! /usr/bin/python3 |
8 | 2 | # Original dkim-milter.py code: | 2 | # Original dkim-milter.py code: |
9 | 3 | # Author: Stuart D. Gathman <stuart@bmsi.com> | 3 | # Author: Stuart D. Gathman <stuart@bmsi.com> |
10 | 4 | # Copyright 2007 Business Management Systems, Inc. | 4 | # Copyright 2007 Business Management Systems, Inc. |
11 | @@ -28,8 +28,9 @@ import dkim | |||
12 | 28 | import authres | 28 | import authres |
13 | 29 | import os | 29 | import os |
14 | 30 | import tempfile | 30 | import tempfile |
16 | 31 | import StringIO | 31 | import io |
17 | 32 | import re | 32 | import re |
18 | 33 | import codecs | ||
19 | 33 | from Milter.utils import parse_addr, parseaddr | 34 | from Milter.utils import parse_addr, parseaddr |
20 | 34 | import dkimpy_milter.config as config | 35 | import dkimpy_milter.config as config |
21 | 35 | from dkimpy_milter.util import drop_privileges | 36 | from dkimpy_milter.util import drop_privileges |
22 | @@ -110,7 +111,7 @@ class dkimMilter(Milter.Base): | |||
23 | 110 | def envfrom(self, f, *str): | 111 | def envfrom(self, f, *str): |
24 | 111 | if milterconfig.get('Syslog') and milterconfig.get('debugLevel') >= 2: | 112 | if milterconfig.get('Syslog') and milterconfig.get('debugLevel') >= 2: |
25 | 112 | syslog.syslog("mail from: {0} {1}".format(f, str)) | 113 | syslog.syslog("mail from: {0} {1}".format(f, str)) |
27 | 113 | self.fp = StringIO.StringIO() | 114 | self.fp = io.BytesIO() |
28 | 114 | self.mailfrom = f | 115 | self.mailfrom = f |
29 | 115 | t = parse_addr(f) | 116 | t = parse_addr(f) |
30 | 116 | if len(t) == 2: | 117 | if len(t) == 2: |
31 | @@ -142,13 +143,13 @@ class dkimMilter(Milter.Base): | |||
32 | 142 | elif lname == 'authentication-results': | 143 | elif lname == 'authentication-results': |
33 | 143 | self.arheaders.append(val) | 144 | self.arheaders.append(val) |
34 | 144 | if self.fp: | 145 | if self.fp: |
36 | 145 | self.fp.write("%s: %s\n" % (name, val)) | 146 | self.fp.write(b"%s: %s\n" % (codecs.encode(name, 'ascii'), codecs.encode(val, 'ascii'))) |
37 | 146 | return Milter.CONTINUE | 147 | return Milter.CONTINUE |
38 | 147 | 148 | ||
39 | 148 | @Milter.noreply | 149 | @Milter.noreply |
40 | 149 | def eoh(self): | 150 | def eoh(self): |
41 | 150 | if self.fp: | 151 | if self.fp: |
43 | 151 | self.fp.write("\n") # terminate headers | 152 | self.fp.write(b"\n") # terminate headers |
44 | 152 | self.bodysize = 0 | 153 | self.bodysize = 0 |
45 | 153 | return Milter.CONTINUE | 154 | return Milter.CONTINUE |
46 | 154 | 155 | ||
47 | @@ -195,20 +196,20 @@ class dkimMilter(Milter.Base): | |||
48 | 195 | h = authres.AuthenticationResultsHeader(authserv_id= | 196 | h = authres.AuthenticationResultsHeader(authserv_id= |
49 | 196 | self.AuthservID, | 197 | self.AuthservID, |
50 | 197 | results=self.arresults) | 198 | results=self.arresults) |
52 | 198 | h = fold(str(h)) | 199 | h = fold(codecs.encode(str(h), 'ascii')) |
53 | 199 | if (milterconfig.get('Syslog') and | 200 | if (milterconfig.get('Syslog') and |
54 | 200 | milterconfig.get('debugLevel') >= 2): | 201 | milterconfig.get('debugLevel') >= 2): |
57 | 201 | syslog.syslog(str(h)) | 202 | syslog.syslog(codecs.decode(h, 'ascii')) |
58 | 202 | name, val = str(h).split(': ', 1) | 203 | name, val = codecs.decode(h, 'ascii').split(': ', 1) |
59 | 203 | self.addheader(name, val, 0) | 204 | self.addheader(name, val, 0) |
60 | 204 | return Milter.CONTINUE | 205 | return Milter.CONTINUE |
61 | 205 | 206 | ||
62 | 206 | def sign_dkim(self, txt): | 207 | def sign_dkim(self, txt): |
64 | 207 | canon = milterconfig.get('Canonicalization') | 208 | canon = codecs.encode(milterconfig.get('Canonicalization'), 'ascii') |
65 | 208 | canonicalize = [] | 209 | canonicalize = [] |
69 | 209 | if len(canon.split('/')) == 2: | 210 | if len(canon.split(b'/')) == 2: |
70 | 210 | canonicalize.append(canon.split('/')[0]) | 211 | canonicalize.append(canon.split(b'/')[0]) |
71 | 211 | canonicalize.append(canon.split('/')[1]) | 212 | canonicalize.append(canon.split(b'/')[1]) |
72 | 212 | else: | 213 | else: |
73 | 213 | canonicalize.append(canon) | 214 | canonicalize.append(canon) |
74 | 214 | canonicalize.append(canon) | 215 | canonicalize.append(canon) |
75 | @@ -218,11 +219,12 @@ class dkimMilter(Milter.Base): | |||
76 | 218 | try: | 219 | try: |
77 | 219 | if privateRSA: | 220 | if privateRSA: |
78 | 220 | d = dkim.DKIM(txt) | 221 | d = dkim.DKIM(txt) |
84 | 221 | h = d.sign(milterconfig.get('Selector'), self.fdomain, | 222 | h = d.sign(codecs.encode(milterconfig.get('Selector'), 'ascii'), codecs.encode(self.fdomain, 'ascii'), |
85 | 222 | privateRSA, canonicalize=(canonicalize[0], | 223 | codecs.encode(privateRSA, 'ascii'), |
86 | 223 | canonicalize[1])) | 224 | canonicalize=(canonicalize[0], |
87 | 224 | name, val = h.split(': ', 1) | 225 | canonicalize[1])) |
88 | 225 | self.addheader(name, val.strip().replace('\r\n', '\n'), 0) | 226 | name, val = h.split(b': ', 1) |
89 | 227 | self.addheader(codecs.decode(name, 'ascii'), codecs.decode(val, 'ascii').strip().replace('\r\n', '\n'), 0) | ||
90 | 226 | if (milterconfig.get('Syslog') and | 228 | if (milterconfig.get('Syslog') and |
91 | 227 | (milterconfig.get('SyslogSuccess') | 229 | (milterconfig.get('SyslogSuccess') |
92 | 228 | or milterconfig.get('debugLevel') >= 1)): | 230 | or milterconfig.get('debugLevel') >= 1)): |
93 | @@ -233,12 +235,12 @@ class dkimMilter(Milter.Base): | |||
94 | 233 | d.domain.lower())) | 235 | d.domain.lower())) |
95 | 234 | if privateEd25519: | 236 | if privateEd25519: |
96 | 235 | d = dkim.DKIM(txt) | 237 | d = dkim.DKIM(txt) |
98 | 236 | h = d.sign(milterconfig.get('SelectorEd25519'), self.fdomain, | 238 | h = d.sign(codecs.encode(milterconfig.get('SelectorEd25519'), 'ascii'), codecs.encode(self.fdomain, 'ascii'), |
99 | 237 | privateEd25519, canonicalize=(canonicalize[0], | 239 | privateEd25519, canonicalize=(canonicalize[0], |
100 | 238 | canonicalize[1]), | 240 | canonicalize[1]), |
104 | 239 | signature_algorithm='ed25519-sha256') | 241 | signature_algorithm=b'ed25519-sha256') |
105 | 240 | name, val = h.split(': ', 1) | 242 | name, val = h.split(b': ', 1) |
106 | 241 | self.addheader(name, val.strip().replace('\r\n', '\n'), 0) | 243 | self.addheader(codecs.decode(name, 'ascii'), codecs.decode(val, 'ascii').strip().replace('\r\n', '\n'), 0) |
107 | 242 | if (milterconfig.get('Syslog') and | 244 | if (milterconfig.get('Syslog') and |
108 | 243 | (milterconfig.get('SyslogSuccess') | 245 | (milterconfig.get('SyslogSuccess') |
109 | 244 | or milterconfig.get('debugLevel') >= 1)): | 246 | or milterconfig.get('debugLevel') >= 1)): |
110 | @@ -266,20 +268,17 @@ class dkimMilter(Milter.Base): | |||
111 | 266 | res = d.verify(idx=y, dnsfunc=lambda _x: dnsoverride) | 268 | res = d.verify(idx=y, dnsfunc=lambda _x: dnsoverride) |
112 | 267 | else: | 269 | else: |
113 | 268 | res = d.verify(idx=y) | 270 | res = d.verify(idx=y) |
114 | 271 | algo = codecs.decode(d.signature_fields.get(b'a'), 'ascii') | ||
115 | 269 | if res: | 272 | if res: |
117 | 270 | if d.signature_fields.get(b'a') == 'ed25519-sha256': | 273 | if algo == 'ed25519-sha256': |
118 | 271 | self.dkim_comment = ('Good {0} signature' | 274 | self.dkim_comment = ('Good {0} signature' |
121 | 272 | .format(d.signature_fields | 275 | .format(algo)) |
120 | 273 | .get(b'a'))) | ||
122 | 274 | else: | 276 | else: |
123 | 275 | self.dkim_comment = ('Good {0} bit {1} signature' | 277 | self.dkim_comment = ('Good {0} bit {1} signature' |
127 | 276 | .format(d.keysize, | 278 | .format(d.keysize, algo)) |
125 | 277 | d.signature_fields | ||
126 | 278 | .get(b'a'))) | ||
128 | 279 | else: | 279 | else: |
129 | 280 | self.dkim_comment = ('Bad {0} bit {1} signature.' | 280 | self.dkim_comment = ('Bad {0} bit {1} signature.' |
132 | 281 | .format(d.keysize, | 281 | .format(d.keysize, algo)) |
131 | 282 | d.signature_fields.get(b'a'))) | ||
133 | 283 | except dkim.DKIMException as x: | 282 | except dkim.DKIMException as x: |
134 | 284 | self.dkim_comment = str(x) | 283 | self.dkim_comment = str(x) |
135 | 285 | if milterconfig.get('Syslog'): | 284 | if milterconfig.get('Syslog'): |
136 | @@ -288,9 +287,9 @@ class dkimMilter(Milter.Base): | |||
137 | 288 | self.dkim_comment = str(x) | 287 | self.dkim_comment = str(x) |
138 | 289 | if milterconfig.get('Syslog'): | 288 | if milterconfig.get('Syslog'): |
139 | 290 | syslog.syslog("check_dkim: {0}".format(x)) | 289 | syslog.syslog("check_dkim: {0}".format(x)) |
143 | 291 | self.header_i = d.signature_fields.get(b'i') | 290 | self.header_i = codecs.decode(d.signature_fields.get(b'i'), 'ascii') |
144 | 292 | self.header_d = d.signature_fields.get(b'd') | 291 | self.header_d = codecs.decode(d.signature_fields.get(b'd'), 'ascii') |
145 | 293 | self.header_a = d.signature_fields.get(b'a') | 292 | self.header_a = codecs.decode(d.signature_fields.get(b'a'), 'ascii') |
146 | 294 | if res: | 293 | if res: |
147 | 295 | if (milterconfig.get('Syslog') and | 294 | if (milterconfig.get('Syslog') and |
148 | 296 | (milterconfig.get('SyslogSuccess') or | 295 | (milterconfig.get('SyslogSuccess') or |
149 | diff --git a/dkimpy_milter/__main__.py b/dkimpy_milter/__main__.py | |||
150 | index 8c5cf9c..f95075f 100644 | |||
151 | --- a/dkimpy_milter/__main__.py | |||
152 | +++ b/dkimpy_milter/__main__.py | |||
153 | @@ -1,4 +1,4 @@ | |||
155 | 1 | #!/usr/bin/python2 | 1 | #!/usr/bin/python3 |
156 | 2 | 2 | ||
157 | 3 | from dkimpy_milter import main | 3 | from dkimpy_milter import main |
158 | 4 | 4 | ||
159 | diff --git a/dkimpy_milter/config.py b/dkimpy_milter/config.py | |||
160 | index d562e97..bf6551a 100644 | |||
161 | --- a/dkimpy_milter/config.py | |||
162 | +++ b/dkimpy_milter/config.py | |||
163 | @@ -31,13 +31,13 @@ import stat | |||
164 | 31 | import dkim | 31 | import dkim |
165 | 32 | import socket | 32 | import socket |
166 | 33 | import ipaddress | 33 | import ipaddress |
168 | 34 | from dnsplug import Session | 34 | from .dnsplug import Session |
169 | 35 | 35 | ||
170 | 36 | # default values | 36 | # default values |
171 | 37 | defaultConfigData = { | 37 | defaultConfigData = { |
172 | 38 | 'Syslog': 'yes', | 38 | 'Syslog': 'yes', |
173 | 39 | 'SyslogFacility': 'mail', | 39 | 'SyslogFacility': 'mail', |
175 | 40 | 'UMask': 007, | 40 | 'UMask': 0o07, |
176 | 41 | 'Mode': 'sv', | 41 | 'Mode': 'sv', |
177 | 42 | 'Socket': 'local:/var/run/dkimpy-milter/dkimpy-milter.sock', | 42 | 'Socket': 'local:/var/run/dkimpy-milter/dkimpy-milter.sock', |
178 | 43 | 'PidFile': '/var/run/dkimpy-milter/dkimpy-milter.pid', | 43 | 'PidFile': '/var/run/dkimpy-milter/dkimpy-milter.pid', |
179 | @@ -85,14 +85,14 @@ class HostsDataset(object): | |||
180 | 85 | self.item = item[1:] | 85 | self.item = item[1:] |
181 | 86 | self.negative = True | 86 | self.negative = True |
182 | 87 | try: | 87 | try: |
184 | 88 | self.item = ipaddress.ip_address(unicode(self.item, "utf-8")) | 88 | self.item = ipaddress.ip_address(str(self.item, "utf-8")) |
185 | 89 | if isinstance(self.item, ipaddress.IPv4Address): | 89 | if isinstance(self.item, ipaddress.IPv4Address): |
186 | 90 | self.isipv4 = True | 90 | self.isipv4 = True |
187 | 91 | elif isinstance(self.item, ipaddress.IPv6Address): | 91 | elif isinstance(self.item, ipaddress.IPv6Address): |
188 | 92 | self.isipv6 = True | 92 | self.isipv6 = True |
189 | 93 | except ValueError as e: | 93 | except ValueError as e: |
190 | 94 | try: | 94 | try: |
192 | 95 | self.item = ipaddress.ip_network(unicode | 95 | self.item = ipaddress.ip_network(str |
193 | 96 | (self.item, "utf-8"), | 96 | (self.item, "utf-8"), |
194 | 97 | strict=False) | 97 | strict=False) |
195 | 98 | if isinstance(self.item, ipaddress.IPv4Network): | 98 | if isinstance(self.item, ipaddress.IPv4Network): |
196 | @@ -110,7 +110,7 @@ class HostsDataset(object): | |||
197 | 110 | 110 | ||
198 | 111 | def match(self, connectip): | 111 | def match(self, connectip): |
199 | 112 | '''Check if the connect IP is part of the dataset''' | 112 | '''Check if the connect IP is part of the dataset''' |
201 | 113 | source = ipaddress.ip_address(unicode(connectip, "utf-8")) | 113 | source = ipaddress.ip_address(str(connectip, "utf-8")) |
202 | 114 | for item in self.dataset: | 114 | for item in self.dataset: |
203 | 115 | if item.isdomain or item.ishostname: | 115 | if item.isdomain or item.ishostname: |
204 | 116 | result = self.matchname(source) # Match host/domains first | 116 | result = self.matchname(source) # Match host/domains first |
205 | @@ -160,13 +160,13 @@ class HostsDataset(object): | |||
206 | 160 | if isinstance(source, ipaddress.IPv4Address): | 160 | if isinstance(source, ipaddress.IPv4Address): |
207 | 161 | ips = s.dns(name, 'A') | 161 | ips = s.dns(name, 'A') |
208 | 162 | for ip in ips: | 162 | for ip in ips: |
210 | 163 | ip = ipaddress.IPv4Address(unicode(ip, 'UTF-8')) | 163 | ip = ipaddress.IPv4Address(str(ip, 'UTF-8')) |
211 | 164 | if ip == source: | 164 | if ip == source: |
212 | 165 | results.append(name) | 165 | results.append(name) |
213 | 166 | if isinstance(source, ipaddress.IPv6Address): | 166 | if isinstance(source, ipaddress.IPv6Address): |
214 | 167 | ips = s.dns(name, 'AAAA') | 167 | ips = s.dns(name, 'AAAA') |
215 | 168 | for ip in ips: | 168 | for ip in ips: |
217 | 169 | ip = ipaddress.IPv6Address(unicode(ip, 'UTF-8')) | 169 | ip = ipaddress.IPv6Address(str(ip, 'UTF-8')) |
218 | 170 | if ip == source: | 170 | if ip == source: |
219 | 171 | results.append(name) | 171 | results.append(name) |
220 | 172 | return results | 172 | return results |
221 | @@ -225,13 +225,13 @@ def _processConfigFile(filename=None, configdata=None, useSyslog=1, | |||
222 | 225 | '''Load the specified config file, exit and log errors if it fails, | 225 | '''Load the specified config file, exit and log errors if it fails, |
223 | 226 | otherwise return a config dictionary.''' | 226 | otherwise return a config dictionary.''' |
224 | 227 | 227 | ||
226 | 228 | import config | 228 | from . import config |
227 | 229 | if configdata is None: | 229 | if configdata is None: |
228 | 230 | configdata = config.defaultConfigData | 230 | configdata = config.defaultConfigData |
229 | 231 | if filename is not None: | 231 | if filename is not None: |
230 | 232 | try: | 232 | try: |
231 | 233 | _readConfigFile(filename, configdata) | 233 | _readConfigFile(filename, configdata) |
233 | 234 | except Exception, e: | 234 | except Exception as e: |
234 | 235 | raise | 235 | raise |
235 | 236 | if useSyslog: | 236 | if useSyslog: |
236 | 237 | syslog.syslog(e.args[0]) | 237 | syslog.syslog(e.args[0]) |
237 | @@ -342,7 +342,7 @@ def _readConfigFile(path, configData=None, configGlobal={}): | |||
238 | 342 | # check to see if it's a file | 342 | # check to see if it's a file |
239 | 343 | try: | 343 | try: |
240 | 344 | mode = os.stat(path)[0] | 344 | mode = os.stat(path)[0] |
242 | 345 | except OSError, e: | 345 | except OSError as e: |
243 | 346 | syslog.syslog(syslog.LOG_ERR, 'ERROR stating "%s": %s' | 346 | syslog.syslog(syslog.LOG_ERR, 'ERROR stating "%s": %s' |
244 | 347 | % (path, e.strerror)) | 347 | % (path, e.strerror)) |
245 | 348 | return(configData) | 348 | return(configData) |
246 | diff --git a/dkimpy_milter/dnsplug.py b/dkimpy_milter/dnsplug.py | |||
247 | index aa357ec..33067e9 100644 | |||
248 | --- a/dkimpy_milter/dnsplug.py | |||
249 | +++ b/dkimpy_milter/dnsplug.py | |||
250 | @@ -84,7 +84,7 @@ class Session(object): | |||
251 | 84 | raise DNSError('Length of CNAME chain exceeds %d' % MAX_CNAME) | 84 | raise DNSError('Length of CNAME chain exceeds %d' % MAX_CNAME) |
252 | 85 | cnames[name] = cname | 85 | cnames[name] = cname |
253 | 86 | if cname in cnames: | 86 | if cname in cnames: |
255 | 87 | raise DNSError, 'CNAME loop' | 87 | raise DNSError('CNAME loop') |
256 | 88 | result = self.dns(cname, qtype, cnames=cnames) | 88 | result = self.dns(cname, qtype, cnames=cnames) |
257 | 89 | return result | 89 | return result |
258 | 90 | 90 | ||
259 | @@ -103,16 +103,16 @@ def DNSLookup_pydns(name, qtype, tcpfallback=True, timeout=30): | |||
260 | 103 | # | 103 | # |
261 | 104 | if resp.header['tc'] == True: | 104 | if resp.header['tc'] == True: |
262 | 105 | if not tcpfallback: | 105 | if not tcpfallback: |
264 | 106 | raise DNS.DNSError, 'DNS: Truncated UDP Reply, SPF records should fit in a UDP packet' | 106 | raise DNS.DNSError('DNS: Truncated UDP Reply, SPF records should fit in a UDP packet') |
265 | 107 | try: | 107 | try: |
266 | 108 | req = DNS.DnsRequest(name, qtype=qtype, protocol='tcp', | 108 | req = DNS.DnsRequest(name, qtype=qtype, protocol='tcp', |
267 | 109 | timeout=timeout) | 109 | timeout=timeout) |
268 | 110 | resp = req.req() | 110 | resp = req.req() |
271 | 111 | except DNS.DNSError, x: | 111 | except DNS.DNSError as x: |
272 | 112 | raise DNS.DNSError, 'TCP Fallback error: ' + str(x) | 112 | raise DNS.DNSError('TCP Fallback error: ' + str(x)) |
273 | 113 | return [((a['name'], a['typename']), a['data']) for a in resp.answers] | 113 | return [((a['name'], a['typename']), a['data']) for a in resp.answers] |
276 | 114 | except IOError, x: | 114 | except IOError as x: |
277 | 115 | raise DNS.DNSError, 'DNS: ' + str(x) | 115 | raise DNS.DNSError('DNS: ' + str(x)) |
278 | 116 | 116 | ||
279 | 117 | def DNSLookup_dnspython(name,qtype,tcpfallback=True,timeout=30): | 117 | def DNSLookup_dnspython(name,qtype,tcpfallback=True,timeout=30): |
280 | 118 | retVal = [] | 118 | retVal = [] |
281 | @@ -164,5 +164,5 @@ if __name__ == '__main__': | |||
282 | 164 | import sys | 164 | import sys |
283 | 165 | s = Session() | 165 | s = Session() |
284 | 166 | for n,t in zip(*[iter(sys.argv[1:])]*2): | 166 | for n,t in zip(*[iter(sys.argv[1:])]*2): |
287 | 167 | print n,t | 167 | print(n,t) |
288 | 168 | print s.dns(n,t) | 168 | print(s.dns(n,t)) |
289 | diff --git a/setup.py b/setup.py | |||
290 | index 18c2ec9..c7990d7 100644 | |||
291 | --- a/setup.py | |||
292 | +++ b/setup.py | |||
293 | @@ -1,4 +1,4 @@ | |||
295 | 1 | #! /usr/bin/python | 1 | #! /usr/bin/python3 |
296 | 2 | # dkimpy-milter: A DKIM signing/verification Milter application | 2 | # dkimpy-milter: A DKIM signing/verification Milter application |
297 | 3 | # Author: Scott Kitterman <scott@kitterman.com> | 3 | # Author: Scott Kitterman <scott@kitterman.com> |
298 | 4 | # Copyright 2018 Scott Kitterman | 4 | # Copyright 2018 Scott Kitterman |
299 | @@ -24,9 +24,9 @@ description = "Domain Keys Identified Mail (DKIM) signing/verifying milter for P | |||
300 | 24 | kw = {} # Work-around for lack of 'or' requires in setuptools. | 24 | kw = {} # Work-around for lack of 'or' requires in setuptools. |
301 | 25 | try: | 25 | try: |
302 | 26 | import dns | 26 | import dns |
304 | 27 | kw['install_requires'] = ['dkimpy>=0.7', 'pymilter', 'authres>=1.1.0', 'PyNaCl', 'ipaddress', 'dnspython'] | 27 | kw['install_requires'] = ['dkimpy>=0.7', 'pymilter', 'authres>=1.1.0', 'PyNaCl', 'dnspython'] |
305 | 28 | except ImportError: # If PyDNS is not installed, prefer dnspython | 28 | except ImportError: # If PyDNS is not installed, prefer dnspython |
307 | 29 | kw['install_requires'] = ['dkimpy>=0.7', 'pymilter', 'authres>=1.1.0', 'PyNaCl', 'ipaddress', 'PyDNS'] | 29 | kw['install_requires'] = ['dkimpy>=0.7', 'pymilter', 'authres>=1.1.0', 'PyNaCl', 'PyDNS'] |
308 | 30 | 30 | ||
309 | 31 | setup( | 31 | setup( |
310 | 32 | name='dkimpy-milter', | 32 | name='dkimpy-milter', |
311 | @@ -43,7 +43,7 @@ setup( | |||
312 | 43 | 'License :: OSI Approved :: GNU General Public License (GPL)', | 43 | 'License :: OSI Approved :: GNU General Public License (GPL)', |
313 | 44 | 'Natural Language :: English', | 44 | 'Natural Language :: English', |
314 | 45 | 'Operating System :: POSIX', | 45 | 'Operating System :: POSIX', |
316 | 46 | 'Programming Language :: Python :: 2 :: Only', | 46 | 'Programming Language :: Python :: 3 :: Only', |
317 | 47 | 'Topic :: Communications :: Email :: Mail Transport Agents', | 47 | 'Topic :: Communications :: Email :: Mail Transport Agents', |
318 | 48 | 'Topic :: Communications :: Email :: Filters', | 48 | 'Topic :: Communications :: Email :: Filters', |
319 | 49 | 'Topic :: Security', | 49 | 'Topic :: Security', |
320 | diff --git a/tests/dkimpy-milter b/tests/dkimpy-milter | |||
321 | index 39b64d5..9ee02e9 100755 | |||
322 | --- a/tests/dkimpy-milter | |||
323 | +++ b/tests/dkimpy-milter | |||
324 | @@ -1,2 +1,2 @@ | |||
325 | 1 | #!/bin/sh | 1 | #!/bin/sh |
327 | 2 | python2 -m dkimpy_milter "$@" | 2 | python3 -m dkimpy_milter "$@" |