Hi web2py community.

My users complained that emails (sent through mail.send)
arrive dated by Jan 1st, 1970.
Quick investigation showed that it is due to localized date:
Date: пт, 14 окт 2011 13:16:56 +0000

I fixed it by dropping hand-made line and using one from email.utils
instead (there is already an 'from email import *' line at the
beginning so i didn't have to add an import):

--- tools.orig.py       2011-10-14 15:27:00.527823284 +0200
+++ tools.py    2011-10-14 15:27:16.709040018 +0200
@@ -559,8 +559,7 @@
         if bcc:
             to.extend(bcc)
         payload['Subject'] = encode_header(subject.decode(encoding))
-        payload['Date'] = time.strftime("%a, %d %b %Y %H:%M:%S +0000",
-                                        time.gmtime())
+        payload['Date'] = utils.formatdate()
         result = {}
         try:
             if self.settings.server == 'logging':

Regards
Alexey

Reply via email to