Steen Jansdal wrote:
Hi,
This has possibly been asked before, but I cannot find it in the mail archieve.
It seems as there are missing some Carriage Returns after some of the lines in a mail. My Outlook users are getting strange looking mails.
Is this a configuration options that I simply hasn't found?
Steen
Now I've found out that this occurs when HTML-mails or mails with attachments are fetchPOP'ed. Each line in a mail should be terminated with a CR LF (according to RFC2821), but in some cases these are only terminated by a LF.
The mail-server (James 2.1.2) is running on a Linux platform.
Steen
Now I have a patch that fixes the problem. I don't know if it's the right place to fix the problem, but it works.
In the ExtraDotOutputStream class (package org.apache.james.util) the method "write" are patched as follows:
public void write(int b) throws IOException {
// out.write(b); // Remove this lineswitch (b) {
case '.':
out.write(b); // Add this line
if (countLast0A0D == 2) {
// add extra dot
out.write('.');
}
countLast0A0D = 0;
break;
case '\r':
out.write(b); // Add this line
countLast0A0D = 1;
break;
case '\n':
if (countLast0A0D == 1) {
out.write(b); // Add this line
countLast0A0D = 2;
} else {
out.write('\r'); // Add this line
out.write(b);
countLast0A0D = 0;
}
break;
default:
out.write(b); // Add this line
// we're no longer at the start of a line
countLast0A0D = 0;
break;
}
}Steen
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
