From 49e38e239a1f6480969a84a6739fc7a872d2a88a Mon Sep 17 00:00:00 2001 From: Thomas Oettli Date: Wed, 13 Mar 2019 10:11:22 +0100 Subject: [PATCH] Move to python3, pymilter is available for python3 --- pyquarantine/__init__.py | 6 ++---- pyquarantine/cli.py | 2 +- pyquarantine/mailer.py | 2 -- pyquarantine/notifications.py | 2 -- pyquarantine/quarantines.py | 2 -- pyquarantine/run.py | 2 +- pyquarantine/whitelists.py | 2 -- setup.py | 12 ++++++------ test-pyquarantine | 2 +- test-pyquarantine-milter | 2 +- 10 files changed, 12 insertions(+), 22 deletions(-) diff --git a/pyquarantine/__init__.py b/pyquarantine/__init__.py index 98c663c..e2bc75c 100644 --- a/pyquarantine/__init__.py +++ b/pyquarantine/__init__.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python2 -# # 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 # the Free Software Foundation, either version 3 of the License, or @@ -108,7 +106,7 @@ class QuarantineMilter(Milter.Base): self.recipients_quarantines = {} # iterate email headers - recipients_to_check = self.recipients[:] + recipients_to_check = self.recipients.copy() for header in self.headers: self.logger.debug("{}: checking header against configured quarantines: {}".format(self.queueid, header)) # iterate quarantines @@ -137,7 +135,7 @@ class QuarantineMilter(Milter.Base): whitelisted_recipients = {} # iterate recipients - for recipient in recipients_to_check[:]: + for recipient in recipients_to_check.copy(): if recipient in whitelisted_recipients: # recipient is whitelisted in this quarantine diff --git a/pyquarantine/cli.py b/pyquarantine/cli.py index 66c9355..4f7ae99 100644 --- a/pyquarantine/cli.py +++ b/pyquarantine/cli.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # # 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 diff --git a/pyquarantine/mailer.py b/pyquarantine/mailer.py index 1c970c5..e9a0c27 100644 --- a/pyquarantine/mailer.py +++ b/pyquarantine/mailer.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python2 -# # 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 # the Free Software Foundation, either version 3 of the License, or diff --git a/pyquarantine/notifications.py b/pyquarantine/notifications.py index 54752d5..242ecc4 100644 --- a/pyquarantine/notifications.py +++ b/pyquarantine/notifications.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python2 -# # 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 # the Free Software Foundation, either version 3 of the License, or diff --git a/pyquarantine/quarantines.py b/pyquarantine/quarantines.py index 1bca19b..a8ef1be 100644 --- a/pyquarantine/quarantines.py +++ b/pyquarantine/quarantines.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python2 -# # 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 # the Free Software Foundation, either version 3 of the License, or diff --git a/pyquarantine/run.py b/pyquarantine/run.py index 33e1eb0..4839b43 100644 --- a/pyquarantine/run.py +++ b/pyquarantine/run.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # # 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 diff --git a/pyquarantine/whitelists.py b/pyquarantine/whitelists.py index 33654e6..f22ef19 100644 --- a/pyquarantine/whitelists.py +++ b/pyquarantine/whitelists.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python2 -# # 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 # the Free Software Foundation, either version 3 of the License, or diff --git a/setup.py b/setup.py index 3b94e58..5c7c7c6 100644 --- a/setup.py +++ b/setup.py @@ -5,10 +5,10 @@ def read_file(fname): return f.read() setup(name = "pyquarantine", - version = "1.0.0", + version = "0.0.1", author = "Thomas Oettli", - author_email = "spacefreak86@gmx.ch", - description = "A milter to handle multiple quarantines.", + author_email = "spacefreak@noop.ch", + description = "A pymilter based sendmail/postfix pre-queue filter.", license = "GPL 3", keywords = "quarantine 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+)", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", "Topic :: Communications :: Email :: Quarantine" ], entry_points = { @@ -31,6 +31,6 @@ setup(name = "pyquarantine", "pyquarantine=pyquarantine.cli:main" ] }, - install_requires = ["pymilter", "peewee"], - python_requires = ">=2.7,<3" + install_requires = ["pymilter", "beautifulsoup4", "peewee"], + python_requires = ">=3" ) diff --git a/test-pyquarantine b/test-pyquarantine index 8de1752..ecece9b 100755 --- a/test-pyquarantine +++ b/test-pyquarantine @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python import sys import pyquarantine.cli diff --git a/test-pyquarantine-milter b/test-pyquarantine-milter index fae2ecb..3ab34c7 100755 --- a/test-pyquarantine-milter +++ b/test-pyquarantine-milter @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python import sys import pyquarantine.run