Merge lp:~aanand0071/mailman/967951 into lp:mailman

Proposed by Aanand
Status: Needs review
Proposed branch: lp:~aanand0071/mailman/967951
Merge into: lp:mailman
Diff against target: 33 lines (+7/-0)
1 file modified
src/mailman/runners/lmtp.py (+7/-0)
To merge this branch: bzr merge lp:~aanand0071/mailman/967951
Reviewer Review Type Date Requested Status
Barry Warsaw Needs Fixing
Review via email: mp+251906@code.launchpad.net

Description of the change

Added patch for bug #967951

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

Can you write some tests for this change?

review: Needs Fixing

Unmerged revisions

7302. By Aanand

patch for bug #967951

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'copybump.py' (properties changed: +x to -x)
=== modified file 'cron/crontab.in.in' (properties changed: +x to -x)
=== modified file 'src/mailman/runners/lmtp.py'
--- src/mailman/runners/lmtp.py 2015-01-05 01:22:39 +0000
+++ src/mailman/runners/lmtp.py 2015-03-05 11:20:26 +0000
@@ -53,6 +53,7 @@
53from mailman.utilities.datetime import now53from mailman.utilities.datetime import now
54from mailman.utilities.email import add_message_hash54from mailman.utilities.email import add_message_hash
55from zope.component import getUtility55from zope.component import getUtility
56from mailman.interfaces.messages import IMessageStore
5657
5758
58elog = logging.getLogger('mailman.error')59elog = logging.getLogger('mailman.error')
@@ -93,6 +94,7 @@
93ERR_502 = '502 Error: command HELO not implemented'94ERR_502 = '502 Error: command HELO not implemented'
94ERR_550 = '550 Requested action not taken: mailbox unavailable'95ERR_550 = '550 Requested action not taken: mailbox unavailable'
95ERR_550_MID = '550 No Message-ID header provided'96ERR_550_MID = '550 No Message-ID header provided'
97ERR_550_DID = '550 Duplicate Message ID'
9698
97# XXX Blech99# XXX Blech
98smtpd.__version__ = 'Python LMTP runner 1.0'100smtpd.__version__ = 'Python LMTP runner 1.0'
@@ -185,6 +187,11 @@
185 # Do basic post-processing of the message, checking it for defects or187 # Do basic post-processing of the message, checking it for defects or
186 # other missing information.188 # other missing information.
187 message_id = msg.get('message-id')189 message_id = msg.get('message-id')
190 msg_obj = getUtility(IMessageStore)
191 try:
192 msg_obj.add(msg)
193 except ValueError as e:
194 return ERR_550_DID
188 if message_id is None:195 if message_id is None:
189 return ERR_550_MID196 return ERR_550_MID
190 if msg.defects:197 if msg.defects: