Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pymilter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
misc
pymilter
Commits
36750bac
Commit
36750bac
authored
8 years ago
by
Stuart D. Gathman
Browse files
Options
Downloads
Patches
Plain Diff
Fix some python3 syntax errors
parent
42e7a026
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Milter/dns.py
+2
-2
2 additions, 2 deletions
Milter/dns.py
Milter/dsn.py
+3
-3
3 additions, 3 deletions
Milter/dsn.py
with
5 additions
and
5 deletions
Milter/dns.py
+
2
−
2
View file @
36750bac
...
@@ -26,8 +26,8 @@ def DNSLookup(name, qtype):
...
@@ -26,8 +26,8 @@ def DNSLookup(name, qtype):
# A RR as dotted quad. For consistency, this driver should
# A RR as dotted quad. For consistency, this driver should
# return both as binary string.
# return both as binary string.
return
[((
a
[
'
name
'
],
a
[
'
typename
'
]),
a
[
'
data
'
])
for
a
in
resp
.
answers
]
return
[((
a
[
'
name
'
],
a
[
'
typename
'
]),
a
[
'
data
'
])
for
a
in
resp
.
answers
]
except
IOError
,
x
:
except
IOError
as
x
:
raise
DNSError
,
str
(
x
)
raise
DNSError
(
str
(
x
)
)
class
Session
(
object
):
class
Session
(
object
):
"""
A Session object has a simple cache with no TTL that is valid
"""
A Session object has a simple cache with no TTL that is valid
...
...
This diff is collapsed.
Click to expand it.
Milter/dsn.py
+
3
−
3
View file @
36750bac
...
@@ -142,13 +142,13 @@ def send_dsn(mailfrom,receiver,msg=None,timeout=600,session=None,ourfrom=''):
...
@@ -142,13 +142,13 @@ def send_dsn(mailfrom,receiver,msg=None,timeout=600,session=None,ourfrom=''):
if
badrcpts
:
if
badrcpts
:
return
badrcpts
return
badrcpts
return
None
# success
return
None
# success
except
smtplib
.
SMTPRecipientsRefused
,
x
:
except
smtplib
.
SMTPRecipientsRefused
as
x
:
if
len
(
x
.
recipients
)
==
1
:
if
len
(
x
.
recipients
)
==
1
:
return
x
.
recipients
.
values
()[
0
]
# permanent error
return
x
.
recipients
.
values
()[
0
]
# permanent error
return
x
.
recipients
return
x
.
recipients
except
smtplib
.
SMTPSenderRefused
,
x
:
except
smtplib
.
SMTPSenderRefused
as
x
:
return
x
.
args
[:
2
]
# does not accept DSN
return
x
.
args
[:
2
]
# does not accept DSN
except
smtplib
.
SMTPDataError
,
x
:
except
smtplib
.
SMTPDataError
as
x
:
return
x
.
args
# permanent error
return
x
.
args
# permanent error
except
smtplib
.
SMTPException
:
except
smtplib
.
SMTPException
:
pass
# any other error, try next MX
pass
# any other error, try next MX
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment