You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sent Date: Mon Jun 10 08:46:28 CEST 2024
When I open the file in Outlook the sent date is 04.06.2024 15:31
The strange thing for me is that only one customer is able to produce these kind of mails, I haven't manage to create one myself.
The mail is exported from Outlook via Drag&Drop to our software, which then shows the sent date as the exact time when the mail was exported. This behaviour persists when downloading the file from their instance and then uploading it into another instance.
If I download the mail and open it in Outlook the correct sent date is displayed. When I drag the file on to Outlook the mail is sorted with the expected sent date, if I export it again from my Outlook and put in our software the correct date is shown and running the example from above the output is Sent Date: Tue Jun 04 15:31:19 CEST 2024
No, but a quick Google search tells it might need to be the delivery-time as well, which is apparently what the Outlook client uses according to some sources. So add that to the gamut of options :/
I reproduced this with the attached test.msg and traced the wrong date to outlook-message-parser.
Simple Java Mail is currently using OutlookMessage#getClientSubmitTime() first and falling back to getDate(). For this file, outlook-message-parser returns null for client submit time, so SJM falls back to the export/creation timestamp (2024-06-10 08:46:28 CEST). Apache POI can read PR_CLIENT_SUBMIT_TIME from the same file as 2024-06-04 15:31:19 CEST, which matches Outlook and the corrected export.
Confirmed delegated upstream and no SJM glue change appears needed.
This is fixed in outlook-message-parser via bbottema/outlook-message-parser#87. The parser now keeps the MSG property stream aligned and exposes PR_CLIENT_SUBMIT_TIME through OutlookMessage#getClientSubmitTime() for the repro file. SJM already prefers that value for Email#getSentDate().
SJM currently still depends on outlook-message-parser 1.14.1. This issue should close when SJM consumes the upcoming outlook-message-parser 1.15.0 release.
Fixed on develop for the 9.0.0 line by updating Simple Java Mail to outlook-message-parser 1.15.0.
The parser now exposes the Outlook PR_CLIENT_SUBMIT_TIME value for the affected MSG shape, and Simple Java Mail already prefers that value when populating Email#getSentDate().
Activity
bbottema commentedon Jun 10, 2024
I had a quick look how this field is populated right now:
I'm not sure this is correct. Probably not, considering your bug and the TODO question...
Faelean commentedon Jul 11, 2024
Hi, do you have an update on this bug?
bbottema commentedon Jul 14, 2024
No, but a quick Google search tells it might need to be the delivery-time as well, which is apparently what the Outlook client uses according to some sources. So add that to the gamut of options :/
Which could translate into something like this:
bbottema commentedon Jul 4, 2026
I reproduced this with the attached
test.msgand traced the wrong date tooutlook-message-parser.Simple Java Mail is currently using
OutlookMessage#getClientSubmitTime()first and falling back togetDate(). For this file,outlook-message-parserreturnsnullfor client submit time, so SJM falls back to the export/creation timestamp (2024-06-10 08:46:28 CEST). Apache POI can readPR_CLIENT_SUBMIT_TIMEfrom the same file as2024-06-04 15:31:19 CEST, which matches Outlook and the corrected export.Upstream issue: bbottema/outlook-message-parser#87
bbottema commentedon Jul 6, 2026
Confirmed delegated upstream and no SJM glue change appears needed.
This is fixed in
outlook-message-parservia bbottema/outlook-message-parser#87. The parser now keeps the MSG property stream aligned and exposesPR_CLIENT_SUBMIT_TIMEthroughOutlookMessage#getClientSubmitTime()for the repro file. SJM already prefers that value forEmail#getSentDate().SJM currently still depends on
outlook-message-parser1.14.1. This issue should close when SJM consumes the upcomingoutlook-message-parser1.15.0 release.bbottema commentedon Jul 6, 2026
Fixed on
developfor the 9.0.0 line by updating Simple Java Mail tooutlook-message-parser1.15.0.The parser now exposes the Outlook
PR_CLIENT_SUBMIT_TIMEvalue for the affected MSG shape, and Simple Java Mail already prefers that value when populatingEmail#getSentDate().bbottema commentedon Jul 8, 2026
Released in Simple Java Mail v9.0.0, which is now available from Maven Central:
https://repo1.maven.org/maven2/org/simplejavamail/simple-java-mail/9.0.0/
Release notes:
https://github.com/bbottema/simple-java-mail/releases/tag/9.0.0