You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
When running the SMTP server on a platform with an encoding that it not based
on ASCII (i.e. most IBM platforms are based on EBCDIC) the server is unable to
do its work.
A look into the sources showed, that the CRLFTerminatedReader takes an
InputStream and every consumed byte is simply converted into a char. Java will
use the platform's default encoding to convert a byte into a char. When using
any ASCII based default encoding this is no problem. But on IBM platforms with
default encoding EBCDIC this does not work.
The same problem occurrs, when writing the data to the socket output stream.
The OutputStream is simply wrapped by a PrintWriter, that uses the platform's
default encoding.
I fixed the first issue by changing the input of the CRLFTerminatedReader into
an InputStreamReader that explicitly uses ASCII as character encoding (and by
the way changed the super class to FilterReader to minimize the number of
methods I had to overwrite).
The OutputStream problem could be fixed using a similar "trick": Simply wrap
the socket's output stream in a OutputStreamWriter and then wrap that Writer in
a PrintWriter.
Attached you can find both files I changed.
Tested on Windows 7 x64 and IBM z/OS (both Java 1.6)
Version of SubethaSMTP: 3.1.7
Original issue reported on code.google.com by [email protected] on 5 Jan 2015 at 12:58
Original issue reported on code.google.com by
[email protected]
on 5 Jan 2015 at 12:58Attachments:
The text was updated successfully, but these errors were encountered: