Theseus007

Untitled

Feb 11th, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. === modified file 'copybump.py' (properties changed: +x to -x)
  2. === modified file 'cron/crontab.in.in' (properties changed: +x to -x)
  3. === modified file 'src/mailman/runners/lmtp.py'
  4. --- src/mailman/runners/lmtp.py 2015-01-05 01:22:39 +0000
  5. +++ src/mailman/runners/lmtp.py 2015-02-11 14:10:30 +0000
  6. @@ -53,7 +53,7 @@
  7. from mailman.utilities.datetime import now
  8. from mailman.utilities.email import add_message_hash
  9. from zope.component import getUtility
  10. -
  11. +from mailman.interfaces.messages import IMessageStore
  12.  
  13. elog = logging.getLogger('mailman.error')
  14. qlog = logging.getLogger('mailman.runner')
  15. @@ -93,6 +93,7 @@
  16. ERR_502 = '502 Error: command HELO not implemented'
  17. ERR_550 = '550 Requested action not taken: mailbox unavailable'
  18. ERR_550_MID = '550 No Message-ID header provided'
  19. +ERR_550_DID = '550 Duplicate Message ID'
  20.  
  21. # XXX Blech
  22. smtpd.__version__ = 'Python LMTP runner 1.0'
  23. @@ -185,6 +186,11 @@
  24. # Do basic post-processing of the message, checking it for defects or
  25. # other missing information.
  26. message_id = msg.get('message-id')
  27. + msg_obj = getUtility(IMessageStore)
  28. + try:
  29. + msg_obj.add(msg)
  30. + except ValueError as e:
  31. + return ERR_550_DID
  32. if message_id is None:
  33. return ERR_550_MID
  34. if msg.defects:
  35. @@ -262,3 +268,4 @@
  36. asyncore.socket_map.clear()
  37. asyncore.close_all()
  38. self.close()
  39. +
Advertisement
Add Comment
Please, Sign In to add comment