java.lang.IllegalArgumentException: Invalida e-mail address: <address_with&amp;>

Sonatype JIRA | Sylvain Baudoin | 2 years ago
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Our internal functional mailbox has a '&' character in its address. I would like to set this e-mail address as the system email in the SMTP settings so that Nexus can send notification. The problem is that Nexus claims that this is an invalid e-mail address, although I can send mails from another mailbox (e.g. Gmail) and there is an option, as per RFC 822, using quotes to have special characters in e-mail addresses. So how to set an e-mail address with '&' in it? Nexus shows a short pop-up with a 500 error and generates the following stacktrace: {code}2015-08-26 14:48:58 ERROR [qtp26197757-103] - - Unhandled exception or error intercepted java.lang.IllegalArgumentException: Invalida e-mail address: <address_with&amp;> at org.sonatype.micromailer.Address.validateAddress( ~[sisu-mailer-1.8.jar:1.8] at org.sonatype.micromailer.Address.<init>( ~[sisu-mailer-1.8.jar:1.8] at org.sonatype.micromailer.Address.<init>( ~[sisu-mailer-1.8.jar:1.8] at ~[nexus-restlet1x-plugin-2.10.0-02/:na] at ~[nexus-restlet1x-plugin-2.10.0-02/:na] at ~[nexus-restlet1x-plugin-2.10.0-02/:na] ... Caused by: javax.mail.internet.AddressException: Local address contains illegal character at javax.mail.internet.InternetAddress.checkAddress( ~[mail-1.4.7.jar:1.4.7] at javax.mail.internet.InternetAddress.validate( ~[mail-1.4.7.jar:1.4.7] at org.sonatype.micromailer.Address.getInternetAddress( ~[sisu-mailer-1.8.jar:1.8] at org.sonatype.micromailer.Address.validateAddress( ~[sisu-mailer-1.8.jar:1.8] ... 131 common frames omitted {code}

    Sonatype JIRA | 2 years ago | Sylvain Baudoin
    java.lang.IllegalArgumentException: Invalida e-mail address: <address_with&amp;>

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Invalida e-mail address: <address_with&amp;>

      at org.sonatype.micromailer.Address.validateAddress()
    2. org.sonatype.micromailer
      1. org.sonatype.micromailer.Address.validateAddress([sisu-mailer-1.8.jar:1.8]
      2. org.sonatype.micromailer.Address.<init>([sisu-mailer-1.8.jar:1.8]
      3. org.sonatype.micromailer.Address.<init>([sisu-mailer-1.8.jar:1.8]
      3 frames
    3. Nexus Core
      1 frame
    4. ${project.groupId}:${project.artifactId}
      1 frame
    5. Nexus Core
      1 frame