Move to python3, pymilter is available for python3

This commit is contained in:
2019-03-13 10:11:22 +01:00
parent f49b1493bb
commit 49e38e239a
10 changed files with 12 additions and 22 deletions

View File

@@ -1,5 +1,3 @@
#!/usr/bin/env python2
#
# PyQuarantine-Milter is free software: you can redistribute it and/or modify # PyQuarantine-Milter is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or
@@ -108,7 +106,7 @@ class QuarantineMilter(Milter.Base):
self.recipients_quarantines = {} self.recipients_quarantines = {}
# iterate email headers # iterate email headers
recipients_to_check = self.recipients[:] recipients_to_check = self.recipients.copy()
for header in self.headers: for header in self.headers:
self.logger.debug("{}: checking header against configured quarantines: {}".format(self.queueid, header)) self.logger.debug("{}: checking header against configured quarantines: {}".format(self.queueid, header))
# iterate quarantines # iterate quarantines
@@ -137,7 +135,7 @@ class QuarantineMilter(Milter.Base):
whitelisted_recipients = {} whitelisted_recipients = {}
# iterate recipients # iterate recipients
for recipient in recipients_to_check[:]: for recipient in recipients_to_check.copy():
if recipient in whitelisted_recipients: if recipient in whitelisted_recipients:
# recipient is whitelisted in this quarantine # recipient is whitelisted in this quarantine

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
# #
# PyQuarantine-Milter is free software: you can redistribute it and/or modify # PyQuarantine-Milter is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,3 @@
#!/usr/bin/env python2
#
# PyQuarantine-Milter is free software: you can redistribute it and/or modify # PyQuarantine-Milter is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,5 +1,3 @@
#!/usr/bin/env python2
#
# PyQuarantine-Milter is free software: you can redistribute it and/or modify # PyQuarantine-Milter is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,5 +1,3 @@
#!/usr/bin/env python2
#
# PyQuarantine-Milter is free software: you can redistribute it and/or modify # PyQuarantine-Milter is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
# #
# PyQuarantine-Milter is free software: you can redistribute it and/or modify # PyQuarantine-Milter is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by

View File

@@ -1,5 +1,3 @@
#!/usr/bin/env python2
#
# PyQuarantine-Milter is free software: you can redistribute it and/or modify # PyQuarantine-Milter is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or # the Free Software Foundation, either version 3 of the License, or

View File

@@ -5,10 +5,10 @@ def read_file(fname):
return f.read() return f.read()
setup(name = "pyquarantine", setup(name = "pyquarantine",
version = "1.0.0", version = "0.0.1",
author = "Thomas Oettli", author = "Thomas Oettli",
author_email = "spacefreak86@gmx.ch", author_email = "spacefreak@noop.ch",
description = "A milter to handle multiple quarantines.", description = "A pymilter based sendmail/postfix pre-queue filter.",
license = "GPL 3", license = "GPL 3",
keywords = "quarantine milter", keywords = "quarantine milter",
url = "https://github.com/spacefreak86/pyquarantine-milter", url = "https://github.com/spacefreak86/pyquarantine-milter",
@@ -22,7 +22,7 @@ setup(name = "pyquarantine",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: OS Independent", "Operating System :: OS Independent",
"Programming Language :: Python", "Programming Language :: Python",
"Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3",
"Topic :: Communications :: Email :: Quarantine" "Topic :: Communications :: Email :: Quarantine"
], ],
entry_points = { entry_points = {
@@ -31,6 +31,6 @@ setup(name = "pyquarantine",
"pyquarantine=pyquarantine.cli:main" "pyquarantine=pyquarantine.cli:main"
] ]
}, },
install_requires = ["pymilter", "peewee"], install_requires = ["pymilter", "beautifulsoup4", "peewee"],
python_requires = ">=2.7,<3" python_requires = ">=3"
) )

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
import sys import sys
import pyquarantine.cli import pyquarantine.cli

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python
import sys import sys
import pyquarantine.run import pyquarantine.run