Parsing UTF-7 email messages

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

UTF-7 is a rather unusual encoding, while Atlassian allows the below changes for the bundled Java, however, Atlassian Support does not provide assistance for configuring them. Consequently, Atlassian cannot guarantee to provide any support for them.

This is mainly a Java limitation, accordingly, If you need help with the Jave configurations please reach out to the Java vendor.

Email messages in unicode-1-1-utf-7 (aka utf-7) cannot be parsed.The following appears in the atlassian-jira.log:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2007-01-31 12:54:59,176 JiraQuartzScheduler_Worker-2 ERROR [service.util.handler.CreateIssueHandler] Could not create issue! java.io.UnsupportedEncodingException: unicode-1-1-utf-7 at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:52) at java.io.InputStreamReader.<init>(InputStreamReader.java:83) at com.sun.mail.handlers.text_plain.getContent(text_plain.java:64) at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:774) at javax.activation.DataHandler.getContent(DataHandler.java:521) at javax.mail.internet.MimeBodyPart.getContent(MimeBodyPart.java:603) at com.atlassian.jira.service.util.handler.AbstractMessageHandler.handleMultipart(AbstractMessageHandler.java:236) at com.atlassian.jira.service.util.handler.AbstractMessageHandler.createAttachmentsForMessage(AbstractMessageHandler.java:201) at com.atlassian.jira.service.util.handler.CreateIssueHandler.handleMessage(CreateIssueHandler.java:201) at com.atlassian.jira.service.util.handler.CreateOrCommentHandler.handleMessage(CreateOrCommentHandler.java:115) at com.atlassian.jira.service.services.mail.MailFetcherService.run(MailFetcherService.java:190) at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:67) at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:48) at org.quartz.core.JobRunShell.run(JobRunShell.java:191) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)

Solution

Workaround

Java 8

  1. Download the jutf7 jar from http://sourceforge.net/projects/jutf7

  2. Copy the jar to your $JAVA_HOME/jre/lib/ext directory.

    The JAR file has to be in exactly this directory for the class loader to pick it up.

  3. Restart JIRA.

Java 11

As per Oracle documentation, the "ext" path has been removed starting from java 9 and needs to be set in the classpath, accordingly, you can add the jar directory in the "setenv.sh".

  1. Download the jutf7 jar from http://sourceforge.net/projects/jutf7.

  2. Copy the jar to your desired $JAVA_HOME directory.

  3. Export the file in your setenv.sh.

1 export CLASSPATH=.:path1/xxx.jar:path2/yyy.jar

4. Restart Jira.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.