jakartaee / jakartaee/mail-api

Default MailDateFormat pattern might not be compatible with RFC 2822?

Open
#820 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
285
Forks
109
Avg merge
15h 19m
Merged PRs (30d)
1

Description

https://github.com/jakartaee/mail-api/blob/d93e2fd55f7d1ac1037c656518e0ec71a047cea1/api/src/main/java/jakarta/mail/internet/MailDateFormat.java#L127

I think the `(z)` part is incorrect and should be removed according to RFC 2822.

Currently this generates `Date` headers like this one:

```
Date: Sun, 7 Dec 2025 15:58:53 +0100 (GMT+01:00)
```

But the last part between parenthesis is not part of the RFC, and parsing it with some software will fail (for example with PHP) as it specifies two timezones.

Contributor guide

Open the contributing guide

Research direction

Start with the default pattern in api/src/main/java/jakarta/mail/internet/MailDateFormat.java at the linked line. Compare its generated Date header with RFC 2822 and verify that the resulting output no longer includes the parenthesized timezone, using any existing MailDateFormat coverage you find.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.