javax.mail.internet.ParseException: Missing charset in encoded value: %61%6C%6C%79%6C%6F%6E%67%66%69%6C%65%6E%61%6D%65%77%69%74%68

Atlassian JIRA | Jeff Turner | 10 years ago
  1. 0

    Mail clients like Thunderbird will break long attachment names up into multiple short lines, as per [RFC 2231|http://www.faqs.org/rfcs/rfc2231.html]: Content-Type: application/pdf; name*0="alreallyreallyreallylongfilenamewithlogsoftextthatshouldlinewrap"; name*1=".pdf" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename*0="alreallyreallyreallylongfilenamewithlogsoftextthatshouldline"; filename*1="wrap.pdf" Unfortunately JavaMail (as of 1.4) [does not support this aspect of RFC 2231|http://forum.java.sun.com/thread.jspa?forumID=43&threadID=783009]. JIRA will fail to add the attachment, and in the logs prints something like: 2007-04-11 17:48:28,604 JiraQuartzScheduler_Worker-3 DEBUG [service.util.handler.AbstractMessageHandler] part=javax.mail.internet.MimeBodyPart@13cd5b5 2007-04-11 17:48:28,605 JiraQuartzScheduler_Worker-3 DEBUG [service.util.handler.AbstractMessageHandler] Filename=null, content type=application/pdf;^M name*0="alreallyreallyreallylongfilenamewithlogsoftextthatshouldlinewrap";^M name*1=".pdf", content=com.sun.mail.util.BASE64DecoderStream@f27b6e 2007-04-11 17:48:28,605 JiraQuartzScheduler_Worker-3 WARN [jira.issue.managers.DefaultAttachmentManager] Cannot create attachment without a filename - inline content? See http://jira.atlassian.com/browse/JRA-10825 (file=tempattach34617dat). 2007-04-11 17:48:28,605 JiraQuartzScheduler_Worker-3 DEBUG [service.util.handler.AbstractMessageHandler] Encountered an error creating the attachment null for issue TP-39 2007-04-11 17:48:28,605 JiraQuartzScheduler_Worker-3 DEBUG [service.services.mail.MailFetcherService] Deleting Message: <461C92BC.1030609@atlassian.com> JavaMail may also to even parse the email, and can die with: {noformat} 2007-04-11 17:50:28,128 JiraQuartzScheduler_Worker-1 ERROR [service.util.handler.CreateIssueHandler] Could not create issue! javax.mail.internet.ParseException: Missing charset in encoded value: %61%6C%6C%79%6C%6F%6E%67%66%69%6C%65%6E%61%6D%65%77%69%74%68 at javax.mail.internet.ParameterList.decodeValue(ParameterList.java:385) at javax.mail.internet.ParameterList.<init>(ParameterList.java:175) at javax.mail.internet.ContentDisposition.<init>(ContentDisposition.java:87) at javax.mail.internet.MimeBodyPart.getDisposition(MimeBodyPart.java:1039) at javax.mail.internet.MimeBodyPart.getDisposition(MimeBodyPart.java:299) at com.atlassian.jira.service.util.handler.AbstractMessageHandler.saveAttachment(AbstractMessageHandler.java:311) at com.atlassian.jira.service.util.handler.AbstractMessageHandler.handleMultipart(AbstractMessageHandler.java:295) at com.atlassian.jira.service.util.handler.AbstractMessageHandler.createAttachmentsForMessage(AbstractMessageHandler.java:243) at com.atlassian.jira.service.util.handler.CreateIssueHandler.handleMessage(CreateIssueHandler.java:202) 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) {noformat} In this case, the mail is left in the queue, and you will see these stacktraces repeated in the logs every time the mail service triggers (usu. once a minute).

    Atlassian JIRA | 10 years ago | Jeff Turner
    javax.mail.internet.ParseException: Missing charset in encoded value: %61%6C%6C%79%6C%6F%6E%67%66%69%6C%65%6E%61%6D%65%77%69%74%68
  2. 0

    Mail clients like Thunderbird will break long attachment names up into multiple short lines, as per [RFC 2231|http://www.faqs.org/rfcs/rfc2231.html]: Content-Type: application/pdf; name*0="alreallyreallyreallylongfilenamewithlogsoftextthatshouldlinewrap"; name*1=".pdf" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename*0="alreallyreallyreallylongfilenamewithlogsoftextthatshouldline"; filename*1="wrap.pdf" Unfortunately JavaMail (as of 1.4) [does not support this aspect of RFC 2231|http://forum.java.sun.com/thread.jspa?forumID=43&threadID=783009]. JIRA will fail to add the attachment, and in the logs prints something like: 2007-04-11 17:48:28,604 JiraQuartzScheduler_Worker-3 DEBUG [service.util.handler.AbstractMessageHandler] part=javax.mail.internet.MimeBodyPart@13cd5b5 2007-04-11 17:48:28,605 JiraQuartzScheduler_Worker-3 DEBUG [service.util.handler.AbstractMessageHandler] Filename=null, content type=application/pdf;^M name*0="alreallyreallyreallylongfilenamewithlogsoftextthatshouldlinewrap";^M name*1=".pdf", content=com.sun.mail.util.BASE64DecoderStream@f27b6e 2007-04-11 17:48:28,605 JiraQuartzScheduler_Worker-3 WARN [jira.issue.managers.DefaultAttachmentManager] Cannot create attachment without a filename - inline content? See http://jira.atlassian.com/browse/JRA-10825 (file=tempattach34617dat). 2007-04-11 17:48:28,605 JiraQuartzScheduler_Worker-3 DEBUG [service.util.handler.AbstractMessageHandler] Encountered an error creating the attachment null for issue TP-39 2007-04-11 17:48:28,605 JiraQuartzScheduler_Worker-3 DEBUG [service.services.mail.MailFetcherService] Deleting Message: <461C92BC.1030609@atlassian.com> JavaMail may also to even parse the email, and can die with: {noformat} 2007-04-11 17:50:28,128 JiraQuartzScheduler_Worker-1 ERROR [service.util.handler.CreateIssueHandler] Could not create issue! javax.mail.internet.ParseException: Missing charset in encoded value: %61%6C%6C%79%6C%6F%6E%67%66%69%6C%65%6E%61%6D%65%77%69%74%68 at javax.mail.internet.ParameterList.decodeValue(ParameterList.java:385) at javax.mail.internet.ParameterList.<init>(ParameterList.java:175) at javax.mail.internet.ContentDisposition.<init>(ContentDisposition.java:87) at javax.mail.internet.MimeBodyPart.getDisposition(MimeBodyPart.java:1039) at javax.mail.internet.MimeBodyPart.getDisposition(MimeBodyPart.java:299) at com.atlassian.jira.service.util.handler.AbstractMessageHandler.saveAttachment(AbstractMessageHandler.java:311) at com.atlassian.jira.service.util.handler.AbstractMessageHandler.handleMultipart(AbstractMessageHandler.java:295) at com.atlassian.jira.service.util.handler.AbstractMessageHandler.createAttachmentsForMessage(AbstractMessageHandler.java:243) at com.atlassian.jira.service.util.handler.CreateIssueHandler.handleMessage(CreateIssueHandler.java:202) 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) {noformat} In this case, the mail is left in the queue, and you will see these stacktraces repeated in the logs every time the mail service triggers (usu. once a minute).

    Atlassian JIRA | 10 years ago | Jeff Turner
    javax.mail.internet.ParseException: Missing charset in encoded value: %61%6C%6C%79%6C%6F%6E%67%66%69%6C%65%6E%61%6D%65%77%69%74%68
  3. 0

    javamail-1.4.5 error at parsing gmail message received via imap

    Stack Overflow | 2 years ago | Bekzat Abdiraimov
    javax.mail.internet.ParseException: Expected ';', got "," at javax.mail.internet.ParameterList.&lt;init&gt;(ParameterList.java:289) at javax.mail.internet.ContentDisposition.&lt;init&gt;(ContentDisposition.java:100)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Commons - Issues - [jira] [Commented] (EMAIL-159) Parse exception when parsing the email content

    nabble.com | 1 year ago
    javax.mail.internet.ParseException: Expected parameter value, got "="
  6. 0

    When using the CreateOrCommentHandler to create issues from email in a POP box, it is possible for some emails to get 'stuck', so they create a new JIRA issue(s) every time the POPService runs. This happens when a user's mail client (here, Lotus Notes) tries to encode the filename field of the Content-Disposition: header, as described at http://www.mhonarc.org/~ehood/MIME/2047/rfc2047.html. According to: http://java.sun.com/products/javamail/FAQ.html#encodefilename this is not MIME-compliant behaviour. The attachment is saved with the base64-encoded name ('=?UTF-8?B?U291bmR...'). JIRA may throw an exception [1] when trying to parse the header, and on Windows, will throw another exception[2] when trying to save the attachment with an undecoded filename. A partial workaround has been implemented for 2.5. The filename is checked to see if it appears to be encoded (begins with '=?'), and if so, is decoded. This avoids the second exception, but not the first (which I cannot replicate). [1] 2003-10-16 06:51:42,125 DEBUG [atlassian.jira.mail.MailQueueImpl] Queued: +com.atlassian.jira.mail.IssueMailQueueItem@8ea21d[issue=org.ofbiz.core.entity.GenericValue@e6e42e[id=11392,summary=RE: +Seeking a "Great" Marketing Partner?,key=CSS-56,created=2003-10-16 06:50:55.078,updated=2003-10-16 +06:50:55.078,assignee=<null>,reporter=externaluser],remoteUser=externaluser,notificationType=ISSUE_CREATED,template=issuecrea +ted.vm,subjectPrefix=Created: ]^M 2003-10-16 06:51:42,140 DEBUG [service.util.handler.CreateIssueHandler] Issue CSS-56 created^M 2003-10-16 06:51:42,156 ERROR [service.util.handler.CreateIssueHandler] Could not create issue!^M javax.mail.internet.ParseException^M at javax.mail.internet.ParameterList.<init>(ParameterList.java:61)^M at javax.mail.internet.ContentDisposition.<init>(ContentDisposition.java:70)^M at javax.mail.internet.MimeBodyPart.getDisposition(MimeBodyPart.java:827)^M at javax.mail.internet.MimeBodyPart.getDisposition(MimeBodyPart.java:241)^M at +com.atlassian.jira.service.util.handler.AbstractMessageHandler.createAttachmentsForMessage(AbstractMessageHandler.java:75)^M at com.atlassian.jira.service.util.handler.CreateIssueHandler.handleMessage(CreateIssueHandler.java:122)^M at com.atlassian.jira.service.util.handler.CreateOrCommentHandler.handleMessage(CreateOrCommentHandler.java:112)^M at com.atlassian.jira.service.services.pop.PopService.run(PopService.java:97)^M at com.atlassian.jira.service.JiraServiceContainer.run(JiraServiceContainer.java:54)^M at com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:53)^M at org.quartz.core.JobRunShell.run(JobRunShell.java:147)^M at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:387)^M [2] 2003-10-16 06:53:28,093 ERROR [service.util.handler.AbstractMessageHandler] Exception while creating attachment^M java.io.IOException: Could not move (or copy) attachment from d:\Jira\Attachments\CSS\CSS-57\tempattach22747dat to +d:\Jira\Attachments\CSS\CSS-57\10130_=?UTF-8?B?U291bmRXYXZlIGFuZCBOdWNsZXVzIFIxMjYgU2lkZS1ieS1TaWRlIEluc3RhbGxhdGlvbi5kb2M=?= +:java.io.FileNotFoundException: +d:\Jira\Attachments\CSS\CSS-57\10130_=?UTF-8?B?U291bmRXYXZlIGFuZCBOdWNsZXVzIFIxMjYgU2lkZS1ieS1TaWRlIEluc3RhbGxhdGlvbi5kb2M=?= +(The filename, directory name, or volume label syntax is incorrect)^M

    Atlassian JIRA | 1 decade ago | Jeff Turner
    javax.mail.internet.ParseException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. javax.mail.internet.ParseException

      Missing charset in encoded value: %61%6C%6C%79%6C%6F%6E%67%66%69%6C%65%6E%61%6D%65%77%69%74%68

      at javax.mail.internet.ParameterList.decodeValue()
    2. JavaMail API
      MimeBodyPart.getDisposition
      1. javax.mail.internet.ParameterList.decodeValue(ParameterList.java:385)
      2. javax.mail.internet.ParameterList.<init>(ParameterList.java:175)
      3. javax.mail.internet.ContentDisposition.<init>(ContentDisposition.java:87)
      4. javax.mail.internet.MimeBodyPart.getDisposition(MimeBodyPart.java:1039)
      5. javax.mail.internet.MimeBodyPart.getDisposition(MimeBodyPart.java:299)
      5 frames
    3. com.atlassian.jira
      ServiceRunner.execute
      1. com.atlassian.jira.service.util.handler.AbstractMessageHandler.saveAttachment(AbstractMessageHandler.java:311)
      2. com.atlassian.jira.service.util.handler.AbstractMessageHandler.handleMultipart(AbstractMessageHandler.java:295)
      3. com.atlassian.jira.service.util.handler.AbstractMessageHandler.createAttachmentsForMessage(AbstractMessageHandler.java:243)
      4. com.atlassian.jira.service.util.handler.CreateIssueHandler.handleMessage(CreateIssueHandler.java:202)
      5. com.atlassian.jira.service.util.handler.CreateOrCommentHandler.handleMessage(CreateOrCommentHandler.java:115)
      6. com.atlassian.jira.service.services.mail.MailFetcherService.run(MailFetcherService.java:190)
      7. com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:67)
      8. com.atlassian.jira.service.ServiceRunner.execute(ServiceRunner.java:48)
      8 frames
    4. quartz
      SimpleThreadPool$WorkerThread.run
      1. org.quartz.core.JobRunShell.run(JobRunShell.java:191)
      2. org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
      2 frames