comparison roundup/mailgw.py @ 2669:42f69daa70b2 maint-0.7

Reject raised against email messages should result in email rejection... ...not discarding of the message
author Richard Jones <richard@users.sourceforge.net>
date Tue, 07 Sep 2004 10:37:52 +0000
parents 27ba128ab567
children 1154e7fa2f47
comparison
equal deleted inserted replaced
2659:28e91fb523e1 2669:42f69daa70b2
72 set() method to add the message to the item's spool; in the second case we 72 set() method to add the message to the item's spool; in the second case we
73 are calling the create() method to create a new node). If an auditor raises 73 are calling the create() method to create a new node). If an auditor raises
74 an exception, the original message is bounced back to the sender with the 74 an exception, the original message is bounced back to the sender with the
75 explanatory message given in the exception. 75 explanatory message given in the exception.
76 76
77 $Id: mailgw.py,v 1.149 2004-04-20 22:01:12 richard Exp $ 77 $Id: mailgw.py,v 1.149.2.1 2004-09-07 10:37:52 richard Exp $
78 """ 78 """
79 __docformat__ = 'restructuredtext' 79 __docformat__ = 'restructuredtext'
80 80
81 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri 81 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
82 import time, random, sys 82 import time, random, sys
902 try: 902 try:
903 message_id = self.db.msg.create(author=author, 903 message_id = self.db.msg.create(author=author,
904 recipients=recipients, date=date.Date('.'), 904 recipients=recipients, date=date.Date('.'),
905 summary=summary, content=content, files=files, 905 summary=summary, content=content, files=files,
906 messageid=messageid, inreplyto=inreplyto, **msg_props) 906 messageid=messageid, inreplyto=inreplyto, **msg_props)
907 except exceptions.Reject: 907 except exceptions.Reject, error:
908 pass 908 raise MailUsageError, '''
909 else: 909 Mail message was rejected by a detector.
910 %s
911 '''%error
910 # attach the message to the node 912 # attach the message to the node
911 if nodeid: 913 if nodeid:
912 # add the message to the node's list 914 # add the message to the node's list
913 messages = cl.get(nodeid, 'messages') 915 messages = cl.get(nodeid, 'messages')
914 messages.append(message_id) 916 messages.append(message_id)

Roundup Issue Tracker: http://roundup-tracker.org/