mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Fixed cross account move without msgid
This commit is contained in:
parent
8e909de0b6
commit
07071a46d5
2 changed files with 7 additions and 10 deletions
|
@ -953,17 +953,9 @@ class Core {
|
||||||
|
|
||||||
Log.i(folder.name + " reading " + file);
|
Log.i(folder.name + " reading " + file);
|
||||||
try (InputStream is = new BufferedInputStream(new FileInputStream(file))) {
|
try (InputStream is = new BufferedInputStream(new FileInputStream(file))) {
|
||||||
imessage = new MimeMessage(isession, is);
|
imessage = new MimeMessageEx(isession, is, message.msgid);
|
||||||
}
|
|
||||||
|
|
||||||
// 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.saveChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
db.message().setMessageRaw(message.id, true);
|
db.message().setMessageRaw(message.id, true);
|
||||||
|
|
|
@ -35,6 +35,11 @@ public class MimeMessageEx extends MimeMessage {
|
||||||
this.msgid = msgid;
|
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 {
|
MimeMessageEx(Session session, InputStream is, MimeMessage original) throws MessagingException {
|
||||||
super(session, is);
|
super(session, is);
|
||||||
this.original = original;
|
this.original = original;
|
||||||
|
|
Loading…
Reference in a new issue