summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c5ea52e)
raw | patch | inline | side by side (parent: c5ea52e)
author | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 28 Sep 2011 15:50:20 +0000 (15:50 +0000) | ||
committer | schlatterbeck <schlatterbeck@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 28 Sep 2011 15:50:20 +0000 (15:50 +0000) |
config.ini) write header for unix mailbox format so that resulting debug
file can be opened with a standard mailer.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4649 57a73879-2fb5-44c3-a270-3262357dd7e2
file can be opened with a standard mailer.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4649 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/mailer.py | patch | blob | history |
diff --git a/roundup/mailer.py b/roundup/mailer.py
index d44568e5fb190751b7ebc99e7acdeebb17e1c501..a91baf2cee5ebfeaf705c09c6e8c6a3285d29f9a 100644 (file)
--- a/roundup/mailer.py
+++ b/roundup/mailer.py
from cStringIO import StringIO
from roundup import __version__
-from roundup.date import get_timezone
+from roundup.date import get_timezone, Date
from email.Utils import formatdate, formataddr, specialsre, escapesre
from email.Message import Message
if not sender:
sender = self.config.ADMIN_EMAIL
if self.debug:
- # don't send - just write to a file
- open(self.debug, 'a').write('FROM: %s\nTO: %s\n%s\n' %
- (sender,
+ # don't send - just write to a file, use unix from line so
+ # that resulting file can be openened in a mailer
+ fmt = '%a %b %m %H:%M:%S %Y'
+ unixfrm = 'From %s %s' % (sender, Date ('.').pretty (fmt))
+ open(self.debug, 'a').write('%s\nFROM: %s\nTO: %s\n%s\n\n' %
+ (unixfrm, sender,
', '.join(to), message))
else:
# now try to send the message