On 5 June 2017 at 10:45, Daniel Gruno <[email protected]> wrote: > On 06/05/2017 11:40 AM, sebb wrote: >> On 5 June 2017 at 10:14, <[email protected]> wrote: >>> Repository: incubator-ponymail >>> Updated Branches: >>> refs/heads/master fda07b8d7 -> 15c355442 >>> >>> >>> wrong var name >>> >>> >>> Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo >>> Commit: >>> http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/15c35544 >>> Tree: >>> http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/15c35544 >>> Diff: >>> http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/15c35544 >>> >>> Branch: refs/heads/master >>> Commit: 15c355442ea146f1ee28315e0e7ac4b203a5b851 >>> Parents: fda07b8 >>> Author: Daniel Gruno <[email protected]> >>> Authored: Mon Jun 5 11:14:17 2017 +0200 >>> Committer: Daniel Gruno <[email protected]> >>> Committed: Mon Jun 5 11:14:17 2017 +0200 >>> >>> ---------------------------------------------------------------------- >>> tools/generators.py | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> ---------------------------------------------------------------------- >>> >>> >>> http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/15c35544/tools/generators.py >>> ---------------------------------------------------------------------- >>> diff --git a/tools/generators.py b/tools/generators.py >>> index 73a8210..b1d8e28 100644 >>> --- a/tools/generators.py >>> +++ b/tools/generators.py >>> @@ -46,8 +46,8 @@ def medium(msg, body, lid, attachments): >>> # For all intents and purposes, this is not a proper way of maintaining >>> # a consistent ID in case of missing dates. It is recommended to use >>> # another generator such as full or redundant here. >>> - if not mdate and msg_metadata.get('archived-at'): >>> - mdate = email.utils.parsedate_tz(msg_metadata.get('archived-at')) >>> + if not mdate and msg.get('archived-at'): >>> + mdate = email.utils.parsedate_tz(msg.get('archived-at')) >> >> -1 >> >> msg_metadata is not an exact copy of the msg metadata > > For all intents and purposes here, it is. > The only difference is within the headers 'to', 'from', 'subject', > 'message-id'.
Not entirely true, there is a format lambda involved. > There is a larger issue with the medium generator in that if both Date: > and archived-at are missing, the archiver will set archived-at to the > current date, which would mess up reimporting emails without any of > these headers. Hence recommending we avoid that generator in the future, > but keep it for legacy reasons. Agreed, but that's a separate issue. > With regards, > Daniel. > >> >> This could perhaps result in changes to the hash. >> >> Has that been tested? >> >>> elif not mdate: >>> mdate = time.gmtime() # Get a standard 9-tuple >>> mdate = mdate + (0, ) # Fake a TZ (10th element) >>> >
