mirror of https://github.com/M66B/FairEmail.git
Fixed cross account move without msgid
This commit is contained in:
parent
8e909de0b6
commit
07071a46d5
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue