51
51
original_date = msg.get('date')
52
52
received_time = formatdate(msgdata['received_time'])
55
elif int(config.archiver.pipermail.clobber_date_policy) == 1:
57
elif int(config.archiver.pipermail.clobber_date_policy) == 2:
58
# What's the timestamp on the original message?
59
timetup = parsedate_tz(original_date)
65
utc_timestamp = datetime.fromtimestamp(mktime_tz(timetup))
66
date_skew = as_timedelta(
67
config.archiver.pipermail.allowable_sane_date_skew)
68
clobber = (abs(now - utc_timestamp) > date_skew)
69
except (ValueError, OverflowError):
70
# The likely cause of this is that the year in the Date: field
71
# is horribly incorrect, e.g. (from SF bug # 571634):
72
# Date: Tue, 18 Jun 0102 05:12:09 +0500
73
# Obviously clobber such dates.
77
del msg['x-original-date']
78
msg['Date'] = received_time
80
msg['X-Original-Date'] = original_date
53
# FIXME 2012-03-23 BAW: LP: #963612
54
## if not original_date:
56
## elif int(config.archiver.pipermail.clobber_date_policy) == 1:
58
## elif int(config.archiver.pipermail.clobber_date_policy) == 2:
59
## # What's the timestamp on the original message?
60
## timetup = parsedate_tz(original_date)
61
## now = datetime.now()
66
## utc_timestamp = datetime.fromtimestamp(mktime_tz(timetup))
67
## date_skew = as_timedelta(
68
## config.archiver.pipermail.allowable_sane_date_skew)
69
## clobber = (abs(now - utc_timestamp) > date_skew)
70
## except (ValueError, OverflowError):
71
## # The likely cause of this is that the year in the Date: field
72
## # is horribly incorrect, e.g. (from SF bug # 571634):
73
## # Date: Tue, 18 Jun 0102 05:12:09 +0500
74
## # Obviously clobber such dates.
78
## del msg['x-original-date']
79
## msg['Date'] = received_time
81
## msg['X-Original-Date'] = original_date
81
82
# Always put an indication of when we received the message.
82
83
msg['X-List-Received-Date'] = received_time
83
84
# While a list archiving lock is acquired, archive the message.