Mbox filter carriage returns

pull/197/head
M66B 4 years ago
parent 71c512869e
commit 297cf9ca82

@ -888,7 +888,7 @@ public class FragmentFolders extends FragmentBase {
Properties props = MessageHelper.getSessionProperties(); Properties props = MessageHelper.getSessionProperties();
Session isession = Session.getInstance(props, null); Session isession = Session.getInstance(props, null);
// https://www.ietf.org/rfc/rfc4155.txt // https://www.ietf.org/rfc/rfc4155.txt (Appendix A)
// http://qmail.org./man/man5/mbox.html // http://qmail.org./man/man5/mbox.html
ContentResolver resolver = context.getContentResolver(); ContentResolver resolver = context.getContentResolver();
try (OutputStream out = new BufferedOutputStream(resolver.openOutputStream(uri))) { try (OutputStream out = new BufferedOutputStream(resolver.openOutputStream(uri))) {
@ -909,16 +909,16 @@ public class FragmentFolders extends FragmentBase {
imessage.writeTo(new FilterOutputStream(out) { imessage.writeTo(new FilterOutputStream(out) {
@Override @Override
public void write(int b) throws IOException { public void write(int b) throws IOException {
super.write(b); if (b != 13)
out.write(b);
} }
@Override @Override
public void flush() throws IOException { public void flush() throws IOException {
out.write(10);
super.flush(); super.flush();
} }
}); });
out.write("\n".getBytes());
} }
} }

Loading…
Cancel
Save