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