Support mail with UTF-7 encoding using JDK17+

UTF-7 is not supported by java, the previous workaround ( https://jira.atlassian.com/browse/JRASERVER-5812 ) for DC worked prior to JDK17.

JDK17 is modular, to make this work, we need to use JDK17 to generate a JRE that contains the necessary (additional) modules:

Get the UTF7 library

Go to Java UTF-7 Charset support and access Files > jutf7 > 1.0.0 to get jutf7-1.0.0.zip

Unpack the zip and find jutf7-1.0.0.jar

Move this into your JDK17/jmods folder, eg : /usr/local/apps/java/jdk-17.0.10+7/jmods

Generate a module-info file

Following the same process as shown in Installing Graal Script Engine

change directory into the jmods folder then:

root@ppl7:/usr/local/apps/java/jdk-17.0.10+7/jmods# jdeps --generate-module-info out jutf7-1.0.0.jar writing to out/jutf7/module-info.java

Compile generated module info class

root@ppl7:/usr/local/apps/java/jdk-17.0.10+7/jmods# javac --patch-module jutf7=jutf7-1.0.0.jar out/jutf7/module-info.java out/jutf7/module-info.java:1: warning: [module] module name component jutf7 should avoid terminal digits module jutf7 { ^ 1 warning

Build a new JRE folder that contains the new module

Change directory into the root of the JDK folder, eg /usr/local/apps/java/jdk-17.0.10+7 and run:

jlink --module-path $JAVA_HOME/jmods/ --add-modules ALL-MODULE-PATH --output jre

This will create a jre folder that should be used as the JAVA_HOME folder when running Jira DC, it has UTF7 character support.

Prove it works

Here is a test case with UTF-7 encoding, update the To: to match your JEMH Catchemail mailbox address.

Success can be shown on the issue created:

image-20241014-151957.png