Fixed cross account move without msgid

This commit is contained in:
M66B 2021-03-10 18:12:44 +01:00
parent 8e909de0b6
commit 07071a46d5
2 changed files with 7 additions and 10 deletions

View File

@ -953,17 +953,9 @@ class Core {
Log.i(folder.name + " reading " + file);
try (InputStream is = new BufferedInputStream(new FileInputStream(file))) {
imessage = new MimeMessage(isession, is);
}
// Check message ID to check raw message file content
MessageHelper helper = new MessageHelper(imessage, context);
String msgid = helper.getMessageID();
if (TextUtils.isEmpty(message.msgid) || !Objects.equals(message.msgid, msgid)) {
String msg = "Inconsistent msgid=" + message.msgid + "/" + msgid;
Log.e(msg);
throw new IllegalArgumentException(msg);
imessage = new MimeMessageEx(isession, is, message.msgid);
}
imessage.saveChanges();
}
db.message().setMessageRaw(message.id, true);

View File

@ -35,6 +35,11 @@ public class MimeMessageEx extends MimeMessage {
this.msgid = msgid;
}
MimeMessageEx(Session session, InputStream is, String msgid) throws MessagingException {
super(session, is);
this.msgid = msgid;
}
MimeMessageEx(Session session, InputStream is, MimeMessage original) throws MessagingException {
super(session, is);
this.original = original;