Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6456422
Votes 1
Synopsis NullPointerException in smtptransport when sending MimeMessages with no encoding
Category java_mail:smtp
Reported Against
Release Fixed 1.4.1
State 11-Closed, Unverified, bug
Priority: 4-Low
Related Bugs
Submit Date 02-AUG-2006
Description
FULL PRODUCT VERSION :
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
 customer  Windows XP [Versione 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
1) allow8bitmime set to true
2) MimeMessage created from stream having no encoding specified
3) remote SMTP server supports ESMTP 8BITMIME

As soon as smtptransport is called it calls SMTPTransport.convertTo8Bit that throws the NullPointerException here:

String enc = part.getEncoding();
if (enc.equalsIgnoreCase("quoted-printable") ||
enc.equalsIgnoreCase("base64")) {

Adding an (enc != null) check before the enc.equalsIgnoreCase, or inverting the condition to "quoted-printable".equalsIgnoreCase(enc) || "base64".equalsIgnoreCase(enc) would remove the NPE.


REPRODUCIBILITY :
This bug can be reproduced always.
Posted Date : 2006-08-02 18:30:39.0
Work Around
N/A
Evaluation
Yes, this is a bug.
Posted Date : 2006-08-02 18:36:36.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang