From 297cf9ca82473ab1e18ff4bbf32036a40e004c68 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 17 Apr 2021 08:00:20 +0200 Subject: [PATCH] Mbox filter carriage returns --- app/src/main/java/eu/faircode/email/FragmentFolders.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentFolders.java b/app/src/main/java/eu/faircode/email/FragmentFolders.java index ec1dbaecd2..62346ab8a7 100644 --- a/app/src/main/java/eu/faircode/email/FragmentFolders.java +++ b/app/src/main/java/eu/faircode/email/FragmentFolders.java @@ -888,7 +888,7 @@ public class FragmentFolders extends FragmentBase { Properties props = MessageHelper.getSessionProperties(); 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 ContentResolver resolver = context.getContentResolver(); try (OutputStream out = new BufferedOutputStream(resolver.openOutputStream(uri))) { @@ -909,16 +909,16 @@ public class FragmentFolders extends FragmentBase { imessage.writeTo(new FilterOutputStream(out) { @Override public void write(int b) throws IOException { - super.write(b); + if (b != 13) + out.write(b); } @Override public void flush() throws IOException { + out.write(10); super.flush(); } }); - - out.write("\n".getBytes()); } }