diff --git a/k9mail/src/main/java/com/fsck/k9/mailstore/LocalFolder.java b/k9mail/src/main/java/com/fsck/k9/mailstore/LocalFolder.java index 4b71c8646..e2d06dcf4 100644 --- a/k9mail/src/main/java/com/fsck/k9/mailstore/LocalFolder.java +++ b/k9mail/src/main/java/com/fsck/k9/mailstore/LocalFolder.java @@ -652,6 +652,7 @@ public class LocalFolder extends Folder implements Serializable { LocalMessage localMessage = (LocalMessage) message; loadMessageParts(db, localMessage); + localMessage.loadHeadersIfNecessary(); } } } catch (MessagingException e) { diff --git a/k9mail/src/main/java/com/fsck/k9/mailstore/LocalMessage.java b/k9mail/src/main/java/com/fsck/k9/mailstore/LocalMessage.java index ae5f04704..8291692e8 100644 --- a/k9mail/src/main/java/com/fsck/k9/mailstore/LocalMessage.java +++ b/k9mail/src/main/java/com/fsck/k9/mailstore/LocalMessage.java @@ -17,10 +17,7 @@ import com.fsck.k9.mail.Address; import com.fsck.k9.mail.Flag; import com.fsck.k9.mail.Folder; import com.fsck.k9.mail.MessagingException; -import com.fsck.k9.mail.Part; -import com.fsck.k9.mail.internet.MessageExtractor; import com.fsck.k9.mail.internet.MimeMessage; -import com.fsck.k9.mail.internet.MimeUtility; import com.fsck.k9.mailstore.LockableDatabase.DbCallback; import com.fsck.k9.mailstore.LockableDatabase.WrappedException; @@ -453,6 +450,12 @@ public class LocalMessage extends MimeMessage { getFolder().populateHeaders(this); } + void loadHeadersIfNecessary() throws MessagingException { + if (!mHeadersLoaded) { + loadHeaders(); + } + } + @Override public void setHeader(String name, String value) throws MessagingException { if (!mHeadersLoaded)