[don't quite have the bits to build a patch right now...]
If you find the line near the bottom of Message.py which has:-
def SetDate(self, date=time.ctime(time.time())):
and modify it to something like:-
def SetDate(self, date=time.strftime("%a, %d %b %Y %H:%M:%S %z",
time.localtime(time.time()))):
[which has probably wrapped on mail send :-( ]
BTW the %z might be a GNU library special - not sure what other strftimes have. Also if you use gmtime rather than localtime you may see some very odd behaviour - at least I do during the first hour after midnight each day during DST.
Nigel.
-- [ Nigel Metheringham Nigel.Metheringham@VData.co.uk ] [ Phone: +44 1423 850000 Fax +44 1423 858866 ]
On 19-Jul-99 Nigel Metheringham wrote:
If you find the line near the bottom of Message.py which has:-
def SetDate(self, date=time.ctime(time.time())):and modify it to something like:-
def SetDate(self, date=time.strftime("%a, %d %b %Y %H:%M:%S %z",time.localtime(time.time()))):
Yes. That fixed it. Thanks much!
I had actually tried hacking that line previously, but I didn't have the syntax right (not surprising, since I don't really know Python...).
Brian Knotts bknotts@europa.com
"NM" == Nigel Metheringham <Nigel.Metheringham@vdata.co.uk> writes:
NM> BTW the %z might be a GNU library special - not sure what
NM> other strftimes have. Also if you use gmtime rather than
NM> localtime you may see some very odd behaviour - at least I do
NM> during the first hour after midnight each day during DST.
Sorry, we can't use %z because it isn't on every system (Linux has it, but Solaris does not, though it has the less useful %Z). We calculate that field, but why should Mailman be adding a Date: header anyway? Won't most (all?) MTAs insert the proper Date: header anyway if one isn't present?
Below isn't exactly the patch that I'd like to apply, but it has the same effect.
-Barry
-------------------- snip snip -------------------- Index: Message.py
RCS file: /projects/cvsroot/mailman/Mailman/Message.py,v retrieving revision 1.22 diff -c -r1.22 Message.py *** Message.py 1999/07/01 12:26:51 1.22 --- Message.py 1999/07/19 22:04:54
*** 230,236 **** self.SetHeader('from', sender)
def SetDate(self, date=time.ctime(time.time())):
! self.SetHeader('date', date)
def GetSender(self):
return self.sender
--- 230,237 ---- self.SetHeader('from', sender)
def SetDate(self, date=time.ctime(time.time())):
! ## self.SetHeader('date', date) ! pass
def GetSender(self):
return self.sender
participants (3)
-
Barry A. Warsaw -
Brian Knotts -
Nigel Metheringham