comparison roundup/mailgw.py @ 1096:fa7df238e2d4

More cleaning up of configuration, and the "instance" -> "tracker" renaming.
author Richard Jones <richard@users.sourceforge.net>
date Tue, 10 Sep 2002 03:01:20 +0000
parents 711f2ecee20f
children db787cef1385
comparison
equal deleted inserted replaced
1095:711f2ecee20f 1096:fa7df238e2d4
71 set() method to add the message to the item's spool; in the second case we 71 set() method to add the message to the item's spool; in the second case we
72 are calling the create() method to create a new node). If an auditor raises 72 are calling the create() method to create a new node). If an auditor raises
73 an exception, the original message is bounced back to the sender with the 73 an exception, the original message is bounced back to the sender with the
74 explanatory message given in the exception. 74 explanatory message given in the exception.
75 75
76 $Id: mailgw.py,v 1.84 2002-09-10 02:37:27 richard Exp $ 76 $Id: mailgw.py,v 1.85 2002-09-10 03:01:18 richard Exp $
77 ''' 77 '''
78 78
79 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri 79 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
80 import time, random 80 import time, random
81 import traceback, MimeWriter 81 import traceback, MimeWriter
237 message. 237 message.
238 ''' 238 '''
239 msg = cStringIO.StringIO() 239 msg = cStringIO.StringIO()
240 writer = MimeWriter.MimeWriter(msg) 240 writer = MimeWriter.MimeWriter(msg)
241 writer.addheader('Subject', subject) 241 writer.addheader('Subject', subject)
242 writer.addheader('From', '%s <%s>'% (self.instance.config.INSTANCE_NAME, 242 writer.addheader('From', '%s <%s>'% (self.instance.config.TRACKER_NAME,
243 self.instance.config.ISSUE_TRACKER_EMAIL)) 243 self.instance.config.TRACKER_EMAIL))
244 writer.addheader('To', ','.join(sendto)) 244 writer.addheader('To', ','.join(sendto))
245 writer.addheader('MIME-Version', '1.0') 245 writer.addheader('MIME-Version', '1.0')
246 part = writer.startmultipartbody('mixed') 246 part = writer.startmultipartbody('mixed')
247 part = writer.nextpart() 247 part = writer.nextpart()
248 body = part.startbody('text/plain') 248 body = part.startbody('text/plain')
559 # re-get the class with the new database connection 559 # re-get the class with the new database connection
560 cl = self.db.getclass(classname) 560 cl = self.db.getclass(classname)
561 561
562 # now update the recipients list 562 # now update the recipients list
563 recipients = [] 563 recipients = []
564 tracker_email = self.instance.config.ISSUE_TRACKER_EMAIL.lower() 564 tracker_email = self.instance.config.TRACKER_EMAIL.lower()
565 for recipient in message.getaddrlist('to') + message.getaddrlist('cc'): 565 for recipient in message.getaddrlist('to') + message.getaddrlist('cc'):
566 r = recipient[1].strip().lower() 566 r = recipient[1].strip().lower()
567 if r == tracker_email or not r: 567 if r == tracker_email or not r:
568 continue 568 continue
569 569

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