From b4f50d36d63a94262605ebd2516c72c55dc48d9b Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 21 Oct 2021 10:31:18 +0200 Subject: [PATCH] Cleanup raw message files for IMAP only --- app/src/main/java/eu/faircode/email/WorkerCleanup.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/WorkerCleanup.java b/app/src/main/java/eu/faircode/email/WorkerCleanup.java index 2ec347aeda..19270a6b16 100644 --- a/app/src/main/java/eu/faircode/email/WorkerCleanup.java +++ b/app/src/main/java/eu/faircode/email/WorkerCleanup.java @@ -238,8 +238,11 @@ public class WorkerCleanup extends Worker { long id = Long.parseLong(file.getName().split("\\.")[0]); EntityMessage message = db.message().getMessage(id); if (manual && cleanup_attachments && message != null) { - message.raw = false; - db.message().setMessageRaw(message.id, message.raw); + EntityAccount account = db.account().getAccount(message.account); + if (account != null && account.protocol == EntityAccount.TYPE_IMAP) { + message.raw = false; + db.message().setMessageRaw(message.id, message.raw); + } } if (message == null || message.raw == null || !message.raw) { Log.i("Deleting " + file);