Encoding problems

4 views
Skip to first unread message

mlohbihler

unread,
Aug 11, 2010, 11:44:32 AM8/11/10
to Java Email Server
When sending through JES, sometimes my messages reach the recipients
looking like this:

:���v�1�,j � Q �� T H S P� P� �K������� S � H �[��] [ۘ[
��S���B� [ �B� XY �B� Y] H �۝ [� H� ^ � [ � � \��] UU �N � Y
\]Z]�H��۝ [� U \ H��B� � XY �B� �� H ���

I've tracked it down to the MIMEProcessor, but i can't say that i
quite understand what is going on. In the source message (read from
the socket) there are these lines:

<DATA>
This is a multi-part message in MIME format.
--------------010907060700000706060906
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
</DATA>

This gets picked out by the following lines of MIMEProcess code
(starting at line 218 in my version):

<CODE>
else if (mimeBody.mime == MIME_MULTIPART || mimeBody.mime
== MIME_TEXT) {
if
(capitalized.startsWith(MIMECONTENT_TRANSFER_ENCODING)) {
if (capitalized.indexOf(MIME8BIT)!=-1 &&
(mimeBody.submime == MIME_TEXT || mimeBody.mime == MIME_TEXT) && !
isMessage8bitMIME) {
if (input.indexOf(';')!=-1) {
addDataLine.addDataLine((MIMEBASE64ENCODING
+input.substring(input.indexOf(";"))).getBytes(US_ASCII));
}
else {

addDataLine.addDataLine((MIMEBASE64ENCODING).getBytes(US_ASCII));
}
mimeBody.base64EncodeText = true;
rawTextForEncoding = new ArrayList();
</CODE>

The end result in the serialized message is this:

<DATA>
This is a multi-part message in MIME format.
--------------030602020505000206020506
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
X-MIME-Autoconverted: from 8bit to base64 by rogers.com

DQoNCk9uIDgvMTAvMjAxMCA3OjMzIEFNLCBKZWZmIEtpc2NodWsgd3JvdGU6DQo
+IEhleSBNYW4s
</DATA>

This doesn't seem to get decoded by any email client, including TBird,
Outlook, or BBerry.

Any help is appreciated. Thanks,
Matthew

Matthew Lohbihler

unread,
Aug 11, 2010, 11:48:21 AM8/11/10
to java-ema...@googlegroups.com
Note, boundary ids differ in the two examples because i sent the message about 8 times to track down this code.
Reply all
Reply to author
Forward
0 new messages