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