11"""Sending Roundup-specific mail over SMTP."""
2- # $Id: mailer.py,v 1.3 2003-10-04 11:21:47 jlgijsbers Exp $
2+ # $Id: mailer.py,v 1.4 2004-01-20 00:05:46 richard Exp $
33
44import time , quopri , os , socket , smtplib , re
55
66from cStringIO import StringIO
77from MimeWriter import MimeWriter
88
99from roundup .rfc2822 import encode_header
10+ from roundup import __version__
1011
1112class MessageSendError (RuntimeError ):
1213 pass
@@ -36,6 +37,8 @@ def get_standard_message(self, to, subject, author=None):
3637 writer .addheader ('X-Roundup-Name' , self .config .TRACKER_NAME )
3738 # and another one to avoid loops
3839 writer .addheader ('X-Roundup-Loop' , 'hello' )
40+ # finally, an aid to debugging problems
41+ writer .addheader ('X-Roundup-Version' , __version__ )
3942
4043 writer .addheader ('MIME-Version' , '1.0' )
4144
@@ -58,7 +61,7 @@ def standard_message(self, to, subject, content, author=None):
5861 quopri .encode (content , body , 0 )
5962
6063 self .smtp_send (to , message )
61-
64+
6265 def bounce_message (self , bounced_message , to , error ,
6366 subject = 'Failed issue tracker submission' ):
6467 """Bounce a message, attaching the failed submission.
0 commit comments