Because a message is read in via a BufferedReader with
the readLine command
i.e. String line = input.readLine();
in SimpleSmtpServer.handleTransaction
\n or \r characters are stripped from the end of the
line. If the body of the message is a multipart/mixed
mime message this results in a mime message that cannot
be parsed. I have added a quick hacky fix to
SmtpMessage (attached) that simply sticks a newline
onto the line again providing it doesn't already end
with one. This gets my unit test working again but you
might want to do something a bit more intelligent...
Yours Sincerely
Jim Flynn
Applepie Solutions Ltd
http://www.aplpi.com
email:jflynn@aplpi.com
office:+353.91.751262
Unit 30, Industry Support Centre, GMIT, Dublin Rd,
Galway, Ireland.
SmtpMessage file with hacky fix for newline stripping
Logged In: NO
This is a problem we are also facing with Mime messages. It
would be nice if this could be fixed. Meanwhile we have to
change the implementation of SmtpMessage.store method to add
this carriage return back into the body.
57 } else if (SmtpState.DATA_BODY ==
response.getNextState()) {
58 - body.append(params);
58 + body.append(params + "\r\n");
59 }
Benoit d'Oncieu