summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarry Warsaw2012-04-22 16:44:23 -0400
committerBarry Warsaw2012-04-22 16:44:23 -0400
commit410123421733763fdc95f07197d581ebc9a5db0e (patch)
tree323485f88a0924ffecaed427581c8d8e4638cbc2 /src
parent3ffddba89c0a0c66280a90b6643d9a66632a5b74 (diff)
downloadmailman-410123421733763fdc95f07197d581ebc9a5db0e.tar.gz
mailman-410123421733763fdc95f07197d581ebc9a5db0e.tar.zst
mailman-410123421733763fdc95f07197d581ebc9a5db0e.zip
Diffstat (limited to 'src')
-rw-r--r--src/mailman/runners/incoming.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mailman/runners/incoming.py b/src/mailman/runners/incoming.py
index d8db926c7..1e4ceaa65 100644
--- a/src/mailman/runners/incoming.py
+++ b/src/mailman/runners/incoming.py
@@ -26,7 +26,7 @@ prepared for delivery. Rejections, discards, and holds are processed
immediately.
"""
-from __future__ import absolute_import, unicode_literals
+from __future__ import absolute_import, print_function, unicode_literals
__metaclass__ = type
__all__ = [
@@ -36,9 +36,9 @@ __all__ = [
from zope.component import getUtility
-from mailman.config import config
from mailman.core.chains import process
from mailman.core.runner import Runner
+from mailman.database.transaction import transaction
from mailman.interfaces.address import ExistingAddressError
from mailman.interfaces.usermanager import IUserManager
@@ -54,12 +54,12 @@ class IncomingRunner(Runner):
# Ensure that the email addresses of the message's senders are known
# to Mailman. This will be used in nonmember posting dispositions.
user_manager = getUtility(IUserManager)
- for sender in msg.senders:
- try:
- user_manager.create_address(sender)
- except ExistingAddressError:
- pass
- config.db.commit()
+ with transaction():
+ for sender in msg.senders:
+ try:
+ user_manager.create_address(sender)
+ except ExistingAddressError:
+ pass
# Process the message through the mailing list's start chain.
start_chain = (mlist.owner_chain
if msgdata.get('to_owner', False)