|
1 | 1 | """Sending Roundup-specific mail over SMTP. |
2 | 2 | """ |
3 | 3 | __docformat__ = 'restructuredtext' |
4 | | -# $Id: mailer.py,v 1.13 2006-01-27 02:41:18 richard Exp $ |
| 4 | +# $Id: mailer.py,v 1.14 2006-02-02 04:14:29 richard Exp $ |
5 | 5 |
|
6 | 6 | import time, quopri, os, socket, smtplib, re |
7 | 7 |
|
|
14 | 14 | try: |
15 | 15 | from email.Utils import formatdate |
16 | 16 | except ImportError: |
17 | | - def formatdate(timeval): |
18 | | - return time.strftime("%a, %d %b %Y %H:%M:%S +0000", timeval) |
| 17 | + def formatdate(): |
| 18 | + return time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()) |
19 | 19 |
|
20 | 20 | class MessageSendError(RuntimeError): |
21 | 21 | pass |
@@ -60,7 +60,7 @@ def get_standard_message(self, to, subject, author=None): |
60 | 60 | writer.addheader('Subject', encode_header(subject, charset)) |
61 | 61 | writer.addheader('To', ', '.join(to)) |
62 | 62 | writer.addheader('From', author) |
63 | | - writer.addheader('Date', formatdate(time.mktime(time.gmtime()))) |
| 63 | + writer.addheader('Date', formatdate()) |
64 | 64 |
|
65 | 65 | # Add a unique Roundup header to help filtering |
66 | 66 | writer.addheader('X-Roundup-Name', encode_header(tracker_name, |
|
0 commit comments