|
15 | 15 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
16 | 16 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
17 | 17 | # |
18 | | -# $Id: roundupdb.py,v 1.31 2001-12-15 19:24:39 rochecompaan Exp $ |
| 18 | +# $Id: roundupdb.py,v 1.32 2001-12-15 23:48:35 richard Exp $ |
19 | 19 |
|
20 | 20 | __doc__ = """ |
21 | 21 | Extending hyperdb with types specific to issue-tracking. |
|
27 | 27 |
|
28 | 28 | import hyperdb, date |
29 | 29 |
|
| 30 | +# set to indicate to roundup not to actually _send_ email |
| 31 | +ROUNDUPDBSENDMAILDEBUG = os.environ.get('ROUNDUPDBSENDMAILDEBUG', '') |
| 32 | + |
30 | 33 | class DesignatorError(ValueError): |
31 | 34 | pass |
32 | 35 | def splitDesignator(designator, dre=re.compile(r'([^\d]+)(\d+)')): |
@@ -401,10 +404,14 @@ def sendmessage(self, nodeid, msgid, change_note): |
401 | 404 |
|
402 | 405 | # now try to send the message |
403 | 406 | try: |
404 | | - smtp = smtplib.SMTP(self.MAILHOST) |
405 | | - # send the message as admin so bounces are sent there instead |
406 | | - # of to roundup |
407 | | - smtp.sendmail(self.ADMIN_EMAIL, sendto, message.getvalue()) |
| 407 | + if ROUNDUPDBSENDMAILDEBUG: |
| 408 | + print 'From: %s\nTo: %s\n%s\n=-=-=-=-=-=-=-='%( |
| 409 | + self.ADMIN_EMAIL, sendto, message.getvalue()) |
| 410 | + else: |
| 411 | + smtp = smtplib.SMTP(self.MAILHOST) |
| 412 | + # send the message as admin so bounces are sent there instead |
| 413 | + # of to roundup |
| 414 | + smtp.sendmail(self.ADMIN_EMAIL, sendto, message.getvalue()) |
408 | 415 | except socket.error, value: |
409 | 416 | raise MessageSendError, \ |
410 | 417 | "Couldn't send confirmation email: mailhost %s"%value |
@@ -497,6 +504,13 @@ def generateChangeNote(self, nodeid, oldvalues): |
497 | 504 |
|
498 | 505 | # |
499 | 506 | # $Log: not supported by cvs2svn $ |
| 507 | +# Revision 1.31 2001/12/15 19:24:39 rochecompaan |
| 508 | +# . Modified cgi interface to change properties only once all changes are |
| 509 | +# collected, files created and messages generated. |
| 510 | +# . Moved generation of change note to nosyreactors. |
| 511 | +# . We now check for changes to "assignedto" to ensure it's added to the |
| 512 | +# nosy list. |
| 513 | +# |
500 | 514 | # Revision 1.30 2001/12/12 21:47:45 richard |
501 | 515 | # . Message author's name appears in From: instead of roundup instance name |
502 | 516 | # (which still appears in the Reply-To:) |
|
0 commit comments