geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesse Glick (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GERONIMO-6166) Improper handling of empty address arrays
Date Tue, 20 Sep 2011 16:34:09 GMT
Improper handling of empty address arrays
-----------------------------------------

                 Key: GERONIMO-6166
                 URL: https://issues.apache.org/jira/browse/GERONIMO-6166
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: mail
    Affects Versions: 1.x
         Environment: Linux, JDK 6
            Reporter: Jesse Glick


When I try to use the Ant {{<mail>}} task with {{geronimo-javamail-1.4-mail-1.2.jar}}
(and {{geronimo-activation-1.1-spec-1.0.jar}} and {{geronimo-activation-2.0.2.jar}}), I get
a stack trace:

{{{
java.lang.ArrayIndexOutOfBoundsException: 0
	at javax.mail.internet.InternetHeaders.setHeader(InternetHeaders.java:562)
	at javax.mail.internet.MimeMessage.setHeader(MimeMessage.java:1492)
	at javax.mail.internet.MimeMessage.setReplyTo(MimeMessage.java:513)
	at org.apache.tools.ant.taskdefs.email.MimeMailer.send(MimeMailer.java:186)
	at org.apache.tools.ant.taskdefs.email.EmailTask.execute(EmailTask.java:577)
}}}

or similarly:

{{{
java.lang.ArrayIndexOutOfBoundsException: 0
	at javax.mail.internet.InternetHeaders.setHeader(InternetHeaders.java:562)
	at javax.mail.internet.MimeMessage.setHeader(MimeMessage.java:1492)
	at javax.mail.internet.MimeMessage.setRecipients(MimeMessage.java:445)
	at org.apache.tools.ant.taskdefs.email.MimeMailer.send(MimeMailer.java:189)
}}}

http://javamail.kenai.com/nonav/javadocs/javax/mail/Message.html gives no indication that
empty arrays are forbidden. In fact {{InternetHeaders}} seems to be checking for a zero-length
list but then failing to return.

Workaround is to specify at least one address for every possible field:

{{{
replyto="_@nowhere.net" cclist="_@nowhere.net" bcclist="_@nowhere.net"
}}}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message