apache / apache/ponymail

Bug: emails allocated to wrong month

Open
#84 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
80
Forks
32
PR merge metrics
No merged PRs in 30d

Description

Emails which are sent within a few hours of the end of a month may be incorrectly allocated to the subsequent month.

For example, the earliest emails in the following mbox should be in the May 2015 chunk.

https://lists.apache.org/list.html?notifications@commons.apache.org:2015-6

The displayed timestamp shows the date 2015-05-31 (assuming that the local TZ is no further east than GMT+1)

These mails were uploaded from a file, if that makes a difference.

It looks like the mails were allocated to a month based on a local timezone at least 2 hours before GMT.
It does not make sense to use the local timezone for this. The database should work in UTC only.
If necessary, the display can show times using the local timezone, but the underlying data should only be stored in UTC.

I found one place where localtime is used in the backend code:

https://github.com/apache/incubator-ponymail/blob/master/tools/archiver.py#L274

This would probably cause the upload issue.

See also https://issues.apache.org/jira/browse/INFRA-12079

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with tools/archiver.py around line 274 and trace how uploaded email timestamps determine their month. Compare the earliest messages in the linked May/June 2015 mbox and verify that month allocation is independent of the local timezone while displayed times may still be localized. The issue does not name a test file.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.