Skip to content

Commit b96c2c3

Browse files
jbescoslukasj
authored andcommitted
Rename resource files so JakartaMail and JavaMail can co-exist (#171)
Signed-off-by: Jorge Bescos Gascon <[email protected]>
1 parent 8d4a8ce commit b96c2c3

File tree

17 files changed

+163
-2
lines changed

17 files changed

+163
-2
lines changed

copyright-exclude

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ copyright-exclude
33
/META-INF/services/
44
/META-INF/javamail
55
/META-INF/mailcap
6+
/META-INF/jakarta
67
/README
78
/NOTICE
89
/Jenkinsfile
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
### JDK-to-MIME charset mapping table ####
2+
### This should be the first mapping table ###
3+
4+
8859_1 ISO-8859-1
5+
iso8859_1 ISO-8859-1
6+
ISO8859-1 ISO-8859-1
7+
8+
8859_2 ISO-8859-2
9+
iso8859_2 ISO-8859-2
10+
ISO8859-2 ISO-8859-2
11+
12+
8859_3 ISO-8859-3
13+
iso8859_3 ISO-8859-3
14+
ISO8859-3 ISO-8859-3
15+
16+
8859_4 ISO-8859-4
17+
iso8859_4 ISO-8859-4
18+
ISO8859-4 ISO-8859-4
19+
20+
8859_5 ISO-8859-5
21+
iso8859_5 ISO-8859-5
22+
ISO8859-5 ISO-8859-5
23+
24+
8859_6 ISO-8859-6
25+
iso8859_6 ISO-8859-6
26+
ISO8859-6 ISO-8859-6
27+
28+
8859_7 ISO-8859-7
29+
iso8859_7 ISO-8859-7
30+
ISO8859-7 ISO-8859-7
31+
32+
8859_8 ISO-8859-8
33+
iso8859_8 ISO-8859-8
34+
ISO8859-8 ISO-8859-8
35+
36+
8859_9 ISO-8859-9
37+
iso8859_9 ISO-8859-9
38+
ISO8859-9 ISO-8859-9
39+
40+
SJIS Shift_JIS
41+
JIS ISO-2022-JP
42+
ISO2022JP ISO-2022-JP
43+
EUC_JP euc-jp
44+
KOI8_R koi8-r
45+
EUC_CN euc-cn
46+
EUC_TW euc-tw
47+
EUC_KR euc-kr
48+
49+
--DIVIDER: this line *must* start with "--" and end with "--" --
50+
51+
#### XXX-to-JDK charset mapping table ####
52+
53+
iso-2022-cn ISO2022CN
54+
iso-2022-kr ISO2022KR
55+
utf-8 UTF8
56+
utf8 UTF8
57+
en_US.iso885915 ISO-8859-15
58+
ja_jp.iso2022-7 ISO2022JP
59+
ja_jp.eucjp EUCJIS
60+
61+
# these two are not needed in 1.1.6. (since EUC_KR exists
62+
# and KSC5601 will map to the correct converter)
63+
euc-kr KSC5601
64+
euckr KSC5601
65+
66+
# in JDK 1.1.6 we will no longer need the "us-ascii" convert
67+
us-ascii ISO-8859-1
68+
x-us-ascii ISO-8859-1
69+
70+
# Chinese charsets are a mess and widely misrepresented.
71+
# gb18030 is a superset of gbk, which is a supserset of cp936/ms936,
72+
# which is a superset of gb2312.
73+
# https://bugzilla.gnome.org/show_bug.cgi?id=446783
74+
# map all of these to gb18030.
75+
gb2312 GB18030
76+
cp936 GB18030
77+
ms936 GB18030
78+
gbk GB18030
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rfc822=smtp
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
#
3+
# Default mailcap file for the Jakarta Mail System.
4+
#
5+
# Jakarta Mail content-handlers:
6+
#
7+
text/plain;; x-java-content-handler=org.eclipse.angus.mail.handlers.text_plain
8+
text/html;; x-java-content-handler=org.eclipse.angus.mail.handlers.text_html
9+
text/xml;; x-java-content-handler=org.eclipse.angus.mail.handlers.text_xml
10+
multipart/*;; x-java-content-handler=org.eclipse.angus.mail.handlers.multipart_mixed; x-java-fallback-entry=true
11+
message/rfc822;; x-java-content-handler=org.eclipse.angus.mail.handlers.message_rfc822
12+
#
13+
# can't support image types because java.awt.Toolkit doesn't work on servers
14+
#
15+
#image/gif;; x-java-content-handler=org.eclipse.angus.mail.handlers.image_gif
16+
#image/jpeg;; x-java-content-handler=org.eclipse.angus.mail.handlers.image_jpeg

core/src/main/resources/META-INF/native-image/org.eclipse.angus/angus-core/resource-config.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@
1818
},
1919
{
2020
"pattern": "\\QMETA-INF/javamail.providers\\E"
21+
},
22+
{
23+
"pattern": "\\QMETA-INF/jakarta.charset.map\\E"
24+
},
25+
{
26+
"pattern": "\\QMETA-INF/jakarta.address.map\\E"
27+
},
28+
{
29+
"pattern": "\\QMETA-INF/jakarta.default.address.map\\E"
30+
},
31+
{
32+
"pattern": "\\QMETA-INF/jakarta.default.providers\\E"
33+
},
34+
{
35+
"pattern": "\\QMETA-INF/jakarta.providers\\E"
2136
}
2237
]
2338
}

doc/src/main/resources/docs/CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The following bugs have been fixed in the 2.0.4 release.
1313

1414
765: CVE
1515
141: Remove this-escape compiler warnings
16+
151: Rename resource files so JakartaMail and JavaMail can co-exist
1617

1718
CHANGES IN THE 2.0.3 RELEASE
1819
----------------------------

doc/src/main/resources/docs/COMPAT.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@
33

44
Angus Mail ${angus-mail.version} release
55
------------------------------
6+
-- Angus Mail 2.1.0 --
7+
8+
- Resource File Duplication due to Jakartification
9+
10+
After the migration of Mail to Jakarta packages, it was discovered that some
11+
resource files had the same name as those used in the legacy `javax.mail`
12+
implementation. As a result, when both the old `javax.mail` and the new
13+
`jakarta.mail` libraries were present in the classpath, conflicts could occur,
14+
as documented in:
15+
https://github.com/jakartaee/mail-api/issues/527
16+
17+
To resolve this issue, the resource files within Angus Mail that could lead
18+
to conflicts have been duplicated with a `jakarta.` prefix. The Mail-API
19+
will now attempt to load resources prefixed with `jakarta.` first. If no
20+
such resource is found, it will fall back to the older resource files.
21+
22+
Over time, the legacy resource files (without the `jakarta.` prefix) will be
23+
removed entirely, and only the `jakarta.`-prefixed resources will be kept.
624

725
-- Angus Mail 2.0.3 --
826

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
#
3+
# Jakarta Mail content-handlers:
4+
#
5+
multipart/report;; x-java-content-handler=org.eclipse.angus.mail.dsn.multipart_report
6+
message/delivery-status;; x-java-content-handler=org.eclipse.angus.mail.dsn.message_deliverystatus
7+
message/disposition-notification;; x-java-content-handler=org.eclipse.angus.mail.dsn.message_dispositionnotification
8+
text/rfc822-headers;; x-java-content-handler=org.eclipse.angus.mail.dsn.text_rfc822headers
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Jakarta Mail IMAP provider Oracle
2+
protocol=imap; type=store; class=org.eclipse.angus.mail.imap.IMAPStore; vendor=Oracle;
3+
protocol=imaps; type=store; class=org.eclipse.angus.mail.imap.IMAPSSLStore; vendor=Oracle;
4+
# Jakarta Mail SMTP provider Oracle
5+
protocol=smtp; type=transport; class=org.eclipse.angus.mail.smtp.SMTPTransport; vendor=Oracle;
6+
protocol=smtps; type=transport; class=org.eclipse.angus.mail.smtp.SMTPSSLTransport; vendor=Oracle;
7+
# Jakarta Mail POP3 provider Oracle
8+
protocol=pop3; type=store; class=org.eclipse.angus.mail.pop3.POP3Store; vendor=Oracle;
9+
protocol=pop3s; type=store; class=org.eclipse.angus.mail.pop3.POP3SSLStore; vendor=Oracle;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
protocol=gimap; type=store; class=org.eclipse.angus.mail.gimap.GmailStore; vendor=Oracle;
2+
protocol=gimaps; type=store; class=org.eclipse.angus.mail.gimap.GmailSSLStore; vendor=Oracle;

0 commit comments

Comments
 (0)