diff --git a/app/src/main/java/eu/faircode/email/EntityAttachment.java b/app/src/main/java/eu/faircode/email/EntityAttachment.java index ce976a700e..dc4e21bb4c 100644 --- a/app/src/main/java/eu/faircode/email/EntityAttachment.java +++ b/app/src/main/java/eu/faircode/email/EntityAttachment.java @@ -38,6 +38,8 @@ import java.util.List; import java.util.Locale; import java.util.Objects; +import javax.mail.Part; + import static androidx.room.ForeignKey.CASCADE; @Entity( @@ -96,9 +98,14 @@ public class EntityAttachment { public Boolean available = false; public String error; + // Gmail sends inline images as attachments with a name and cid + boolean isInline() { - // Gmail sends inline images as attachments with a name and cid - return (cid != null); + return (Part.INLINE.equals(disposition) || cid != null); + } + + boolean isAttachment() { + return (Part.ATTACHMENT.equals(disposition) || !TextUtils.isEmpty(name)); } boolean isImage() { diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index f5dab193fc..742b364c64 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -6362,7 +6362,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. Element footer = document.createElement("p"); footer.appendElement("br").appendElement("hr"); for (EntityAttachment attachment : attachments) - if (!attachment.isInline()) { + if (attachment.isAttachment()) { hasAttachments = true; Element strong = document.createElement("strong"); strong.text(getString(R.string.title_attachment));