javax.mail.internet.ParseException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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
    via by Jeff Turner,
  • Hi, It looks like Confluence has a bug related to mail imports. The message from the attachment could not be parsed. Confluence constantly reports "1 mail imported", but the message is left on the mail server (POP) forever, even after several retries. I have removed this message from the server manually and the mail import functinonality is restored. But all my previously imported mails (dozens of them) ARE LOST :( Emails could have disappeared for some other resaon, though... We are using the latest trial version (we bought a license too, but we are still playing with the old, HSQL-based installation, Version: 2.2.9 Build:#527 Sep 07, 2006). I have searched log files, and found the following message: 2006-10-10 10:36:00,132 WARN [atlassian.confluence.mail.DefaultMailAccountManager] retrieveMessages Could not store message within Confluence: [com.sun.mail.pop3.POP3Message@a852b] - this message will be left on the server com.atlassian.confluence.core.ConfluenceException: Could not store incoming mail: null at com.atlassian.confluence.mail.DefaultMailContentManager.storeIncomingMail(DefaultMailContentManager.java:237) at sun.reflect.GeneratedMethodAccessor305.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.springframework.aop.framework.AopProxyUtils.invokeJoinpointUsingReflection(AopProxyUtils.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:149) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:116) at com.atlassian.confluence.util.profiling.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:18) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:56) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:152) at $Proxy31.storeIncomingMail(Unknown Source) at com.atlassian.confluence.mail.DefaultMailAccountManager.retrieveMessages(DefaultMailAccountManager.java:135) at com.atlassian.confluence.mail.DefaultMailAccountManager.poll(DefaultMailAccountManager.java:88) at com.atlassian.confluence.mail.DefaultMailAccountManager.poll(DefaultMailAccountManager.java:57) at com.atlassian.confluence.mail.DefaultMailAccountManager.pollAllSpaces(DefaultMailAccountManager.java:239) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.springframework.aop.framework.AopProxyUtils.invokeJoinpointUsingReflection(AopProxyUtils.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:149) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:116) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:56) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:152) at $Proxy41.pollAllSpaces(Unknown Source) at com.atlassian.confluence.mail.jobs.MailPollJob.executeInternal(MailPollJob.java:29) at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:66) at org.quartz.core.JobRunShell.run(JobRunShell.java:191) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516) Caused by: javax.mail.internet.ParseException at javax.mail.internet.ParameterList.<init>(ParameterList.java:61) at javax.mail.internet.ContentType.<init>(ContentType.java:83) at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:269) at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:159) at com.atlassian.mail.MailUtils.getFirstInlinePartWithMimeType(MailUtils.java:369) at com.atlassian.mail.MailUtils.getBodyFromMultipart(MailUtils.java:343) at com.atlassian.mail.MailUtils.getBody(MailUtils.java:116) at com.atlassian.confluence.mail.DefaultMailContentManager.storeIncomingMail(DefaultMailContentManager.java:222) ... 31 more
    via by Sasa Markovic,
    • javax.mail.internet.ParseException: Expected ';', got ":" at javax.mail.internet.ParameterList.<init>(ParameterList.java:179) at javax.mail.internet.ContentType.<init>(ContentType.java:100) at javax.mail.internet.MimeMultipart.parsebm(MimeMultipart.java:651)

    Users with the same issue

    pnaranja
    2 times, last one,
    Unknown visitor1 times, last one,