Compare commits

...
5 Commits
4 changed files with 9 additions and 7 deletions
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{11..13} )
PYTHON_COMPAT=( python3_{13..14} )
DISTUTILS_USE_PEP517=setuptools
SCM=""
+1 -1
View File
@@ -27,7 +27,7 @@ __all__ = [
"lists",
"QuarantineMilter"]
__version__ = "2.1.1"
__version__ = "2.1.2"
from pyquarantine import _runtime_patches
+6 -4
View File
@@ -13,13 +13,14 @@
#
import logging
import multiprocessing as mp
import smtplib
from multiprocessing import Process, Queue
from queue import Full as QueueFull
logger = logging.getLogger(__name__)
queue = Queue(maxsize=50)
queue = mp.Queue(maxsize=50)
process = None
@@ -71,7 +72,8 @@ def sendmail(smtp_host, smtp_port, qid, mailfrom, recipients, mail,
# start mailprocess if it is not started yet
if process is None:
process = Process(target=mailprocess)
ctx = mp.get_context('fork')
process = ctx.Process(target=mailprocess)
process.daemon = True
logger.debug("starting mailer process")
process.start()
@@ -82,5 +84,5 @@ def sendmail(smtp_host, smtp_port, qid, mailfrom, recipients, mail,
(smtp_host, smtp_port, qid, mailfrom, recipient, mail,
emailtype),
timeout=30)
except Queue.Full:
except QueueFull:
raise RuntimeError("email queue is full")
+1 -1
View File
@@ -33,5 +33,5 @@ setup(name = "pyquarantine",
]
},
install_requires = ["pymilter >= 1.5", "jsonschema", "netaddr", "beautifulsoup4[lxml]", "peewee"],
python_requires = ">=3.10"
python_requires = ">=3.13"
)