javax.mail.internet.AddressException

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.

  • Duplicate issues created when email is not process correctly. A few known behaviour/root cause: h3.Malformed email address in the To or CC/Bcc section caused the "Unable to create issue with message" message in the logs. The logs contain: {noformat} 2012-08-02 14:00:01,487 QuartzWorker-1 INFO ServiceRunner Mails an diagnostic-request@example.co.uk[atlassian.mail.incoming.mailfetcherservice] Mails an diagnostic-request@example.co.uk[10200]: Issue DIAREQ-13 created 2012-08-02 14:00:01,490 QuartzWorker-1 WARN ServiceRunner Mails an diagnostic-request@example.co.uk [atlassian.mail.incoming.mailfetcherservice] Mails an diagnostic-request@example.co.uk[10200]: Unable to create issue with message. javax.mail.internet.AddressException: Domain contains control or whitespace in string ``jira.admin@example co.uk'' at javax.mail.internet.InternetAddress.checkAddress(InternetAddress.java:1253) at javax.mail.internet.InternetAddress.parse(InternetAddress.java:965) at javax.mail.internet.InternetAddress.parseHeader(InternetAddress.java:658) at javax.mail.internet.MimeMessage.getAddressHeader(MimeMessage.java:702) at javax.mail.internet.MimeMessage.getRecipients(MimeMessage.java:534) at javax.mail.Message.getAllRecipients(Message.java:305) at javax.mail.internet.MimeMessage.getAllRecipients(MimeMessage.java:549) at com.atlassian.jira.plugins.mail.handlers.CreateIssueHandler.addCcWatchersToIssue(CreateIssueHandler.java:313) at com.atlassian.jira.plugins.mail.handlers.CreateIssueHandler.handleMessage(CreateIssueHandler.java:249) at com.atlassian.jira.plugins.mail.handlers.CreateOrCommentHandler.handleMessage(CreateOrCommentHandler.java:133) ... 2012-08-02 14:02:01,329 QuartzWorker-1 INFO ServiceRunner Mails an diagnostic-request@example.co.uk [atlassian.mail.incoming.mailfetcherservice] Mails an diagnostic-request@example.co.uk[10200]: Issue DIAREQ-14 created 2012-08-02 14:02:01,330 QuartzWorker-1 WARN ServiceRunner Mails an diagnostic-request@example.co.uk [atlassian.mail.incoming.mailfetcherservice] Mails an diagnostic-request@example.co.uk[10200]: Unable to create issue with message. javax.mail.internet.AddressException: Domain contains control or whitespace in string ``jira.admin@example co.uk'' at javax.mail.internet.InternetAddress.checkAddress(InternetAddress.java:1253) at javax.mail.internet.InternetAddress.parse(InternetAddress.java:965) at javax.mail.internet.InternetAddress.parseHeader(InternetAddress.java:658) at javax.mail.internet.MimeMessage.getAddressHeader(MimeMessage.java:702) at javax.mail.internet.MimeMessage.getRecipients(MimeMessage.java:534) at javax.mail.Message.getAllRecipients(Message.java:305) at javax.mail.internet.MimeMessage.getAllRecipients(MimeMessage.java:549) at com.atlassian.jira.plugins.mail.handlers.CreateIssueHandler.addCcWatchersToIssue(CreateIssueHandler.java:313) at com.atlassian.jira.plugins.mail.handlers.CreateIssueHandler.handleMessage(CreateIssueHandler.java:249) {noformat} h3. File can't be attach to issue. The logs contain: {noformat} 2012-09-19 14:35:46,258 ERROR [application.imap.example.com] QuartzWorker-0 ServiceRunner CSP Problem reading attachment from email for issue CSP-959 com.sun.mail.util.FolderClosedIOException at com.sun.mail.imap.IMAPInputStream.forceCheckExpunged(IMAPInputStream.java:100) at com.sun.mail.imap.IMAPInputStream.fill(IMAPInputStream.java:150) at com.sun.mail.imap.IMAPInputStream.read(IMAPInputStream.java:208) ... 2012-09-19 14:35:46,293 DEBUG [application.imap.example.com] QuartzWorker-0 ServiceRunner CSP part=com.sun.mail.imap.IMAPBodyPart@a49a03 2012-09-19 14:35:46,295 DEBUG [application.imap.example.com] QuartzWorker-0 ServiceRunner CSP Filename=example file, content type=message/rfc822, content=com.sun.mail.imap.IMAPNestedMessage@1610d1f 2012-09-19 14:35:46,304 INFO [application.imap.example.com] QuartzWorker-0 ServiceRunner CSP CSP[10200]: Added attachment to issue 'CSP-959' 2012-09-19 14:35:46,307 DEBUG [application.imap.example.com] QuartzWorker-0 ServiceRunner CSP Created attachment null for issue CSP-959 2012-09-19 14:35:46,310 DEBUG [application.imap.example.com] QuartzWorker-0 ServiceRunner CSP Deleting Message: <0381CA4265117445BAD6757C1FCCA514ADA247@example.com> 2012-09-19 14:35:46,314 ERROR [application.imap.example.com] QuartzWorker-0 ServiceRunner CSP CSP[10200]: Messaging Exception in service 'com.atlassian.jira.service.services.mail.MailFetcherService$MessageProviderImpl' when getting mail: null javax.mail.FolderClosedException ... 2012-09-19 14:35:46,333 DEBUG [application.imap.example.com] QuartzWorker-0 ServiceRunner CSP Closing folder 2012-09-19 14:35:46,334 DEBUG [application.imap.example.com] QuartzWorker-0 ServiceRunner CSP Closing store 2012-09-19 14:35:46,336 DEBUG [application.imap.example.com] QuartzWorker-0 ServiceRunner CSP DEBUG: IMAPStore cleanup, force false 2012-09-19 14:35:46,337 DEBUG [application.imap.example.com] QuartzWorker-0 ServiceRunner CSP DEBUG: IMAPStore cleanup done 2012-09-19 14:35:46,339 DEBUG [application.imap.example.com] QuartzWorker-0 ServiceRunner CSP DEBUG: IMAPStore cleanup, not connected {noformat} h3. Workaround * Delete the malformed-email in the mailbox. * If this is only occurring for certain mails, such as those with larger attachments, increasing the timeout *on the mail server* (not JIRA) can mitigate this problem.
    via by Janet Albion [Atlassian],
  • A user in support had their JIRA instance receiving an email with an address that java mail feels is invalid. This generates a MessageException in the handleMessage method of our email handlers. javax.mail.internet.AddressException: Illegal whitespace in address in string ``jira_gmitbrazil (APPLICATION)'' at javax.mail.internet.InternetAddress.checkAddress(InternetAddress.java:900) at javax.mail.internet.InternetAddress.parse(InternetAddress.java:793) at javax.mail.internet.InternetAddress.parseHeader(InternetAddress.java:554) at javax.mail.internet.MimeMessage.getAddressHeader(MimeMessage.java:658) at javax.mail.internet.MimeMessage.getRecipients(MimeMessage.java:483) at javax.mail.Message.getAllRecipients(Message.java:272) at javax.mail.internet.MimeMessage.getAllRecipients(MimeMessage.java:498) at com.atlassian.mail.MailUtils.hasRecipient(MailUtils.java:254) at com.atlassian.jira.service.util.handler.AbstractMessageHandler.canHandleMessage(AbstractMessageHandler.java:206) at com.atlassian.jira.service.util.handler.AbstractCommentHandler.handleMessage(AbstractCommentHandler.java:55) 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:61) at org.quartz.core.JobRunShell.run(JobRunShell.java:191) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516) The exception propagates up to the MailFetcherService where all we do is log the exception and leave the mail behind. In this case we really want to forward the message on to the forward address (if specified). The problem is that the canHandleMessage call is not inside the try/catch that looks for a message exception. See JSP-32493 for more details.
    via by Dylan Etkin [Atlassian],
  • We get an exception in the log when receiving mail: 2006-06-05 15:10:04,191 ERROR [service.services.mail.MailFetcherService] Throwable: javax.mail.internet.AddressException: Illegal character in local name in string ``http://vintagerolextoo.infoO_EMAIL'' javax.mail.internet.AddressException: Illegal character in local name in string ``http://vintagerolextoo.infoO_EMAIL'' at javax.mail.internet.InternetAddress.checkAddress(InternetAddress.java:903) at javax.mail.internet.InternetAddress.parse(InternetAddress.java:793) at javax.mail.internet.InternetAddress.parseHeader(InternetAddress.java:554) at javax.mail.internet.MimeMessage.getAddressHeader(MimeMessage.java:658) at javax.mail.internet.MimeMessage.getRecipients(MimeMessage.java:483) at javax.mail.Message.getAllRecipients(Message.java:272) at javax.mail.internet.MimeMessage.getAllRecipients(MimeMessage.java:498) at com.atlassian.mail.MailUtils.hasRecipient(MailUtils.java:249) at com.atlassian.jira.service.util.handler.AbstractMessageHandler.canHandleMessage(AbstractMessageHandler.java:172) at com.atlassian.jira.service.util.handler.CreateOrCommentHandler.handleMessage(CreateOrCommentHandler.java:74) at com.atlassian.jira.service.services.mail.MailFetcherService.run(MailFetcherService.java:184) at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:61) 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) This is a spam mail, but it should be avoided however, as we cannot totally block the received mails.
    via by Mickaël Rémond,
    • javax.mail.internet.AddressException: Domain contains control or whitespace in string ``jira.admin@example co.uk'' at javax.mail.internet.InternetAddress.checkAddress(InternetAddress.java:1253) at javax.mail.internet.InternetAddress.parse(InternetAddress.java:965) at javax.mail.internet.InternetAddress.parseHeader(InternetAddress.java:658) at javax.mail.internet.MimeMessage.getAddressHeader(MimeMessage.java:702) at javax.mail.internet.MimeMessage.getRecipients(MimeMessage.java:534) at javax.mail.Message.getAllRecipients(Message.java:305) at javax.mail.internet.MimeMessage.getAllRecipients(MimeMessage.java:549) at com.atlassian.jira.plugins.mail.handlers.CreateIssueHandler.addCcWatchersToIssue(CreateIssueHandler.java:313) at com.atlassian.jira.plugins.mail.handlers.CreateIssueHandler.handleMessage(CreateIssueHandler.java:249) at com.atlassian.jira.plugins.mail.handlers.CreateOrCommentHandler.handleMessage(CreateOrCommentHandler.java:133)

    Users with the same issue

    jedcuajedcua
    2 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    rprp
    6 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    6 more bugmates