ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 51353] New: Mail task fails to send correctly on IBM z/OS EBCDIC operating system
Date Fri, 10 Jun 2011 14:30:44 GMT

             Bug #: 51353
           Summary: Mail task fails to send correctly on IBM z/OS EBCDIC
                    operating system
           Product: Ant
           Version: 1.7.1
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
    Classification: Unclassified

On attempting to use the Ant mail task on an IBM z/OS environment running in
the EBCDIC codepage, the mail fails to send completely.

The problem appears to be related to the JVM failing to flush the the output
stream correctly when it encounters a /n character in the PrintStream.write(int
byte) method on an EBCDIC environment. However, I don't believe this is a JVM

When the JVM fails to flush the stream, the mail task hangs waiting for the
SMTP server to respond, which it never will as the stream hasn't been flushed.

The following build.xml can be used to recreate the problem on an EBCDIC

<?xml version="1.0" ?>
 <target name="SEND_EMAIL" >
  <mail mailhost=""
    subject="My email test"
    <from address=""/>
    <to address=""/>
    <message>this is a test message</message>

A similar issue exists in the writing of MIME headers to the SMTP server. 

I believe PrintStream.println(String x) is used to write MIME headers, but the
javadoc for PrintStream.println(String x) says that the string's characters are
converted into bytes according to the platform's default character encoding.
However, if your SMTP server doesn't support EBCDIC it won't understand the
MIME headers being sent from an EBCDIC environment. 

I believe the fix for this would be to use the PrintStream.write(byte[] buff,
int off, int len) method to write the headers to the output stream instead. The
String.getBytes(String charsetName) method should be used to provide the byte
buffer in the correct character set.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message