POP3 download raw messages for existing messages

This commit is contained in:
M66B 2021-09-06 07:59:07 +02:00
parent c640571c4c
commit f633c24959
1 changed files with 21 additions and 0 deletions

View File

@ -2554,6 +2554,27 @@ class Core {
if (msgIdTuple.containsKey(msgid)) {
_new = false;
Log.i(account.name + " POP having " + msgid + "/" + uidl);
if (download_eml)
try {
TupleUidl tuple = msgIdTuple.get(msgid);
if (tuple == null)
continue;
File raw = EntityMessage.getRawFile(context, tuple.id);
if (raw.exists())
continue;
Log.i(account.name + " POP raw " + msgid + "/" + uidl);
try (OutputStream os = new BufferedOutputStream(new FileOutputStream(raw))) {
imessage.writeTo(os);
}
db.message().setMessageRaw(tuple.id, true);
} catch (Throwable ex) {
Log.w(ex);
}
continue;
}