mirror of https://github.com/M66B/FairEmail.git
Fixed deleting message/rfc822 attachments
This commit is contained in:
parent
7a648035e7
commit
28a35c25f1
|
@ -126,6 +126,7 @@ import javax.mail.Store;
|
||||||
import javax.mail.StoreClosedException;
|
import javax.mail.StoreClosedException;
|
||||||
import javax.mail.UIDFolder;
|
import javax.mail.UIDFolder;
|
||||||
import javax.mail.internet.AddressException;
|
import javax.mail.internet.AddressException;
|
||||||
|
import javax.mail.internet.ContentType;
|
||||||
import javax.mail.internet.InternetAddress;
|
import javax.mail.internet.InternetAddress;
|
||||||
import javax.mail.internet.MimeBodyPart;
|
import javax.mail.internet.MimeBodyPart;
|
||||||
import javax.mail.internet.MimeMessage;
|
import javax.mail.internet.MimeMessage;
|
||||||
|
@ -2170,6 +2171,15 @@ class Core {
|
||||||
|
|
||||||
multipart.removeBodyPart(i);
|
multipart.removeBodyPart(i);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Can't upload empty message/rfc822
|
||||||
|
ContentType ct = new ContentType(contentType);
|
||||||
|
if ("message/rfc822".equalsIgnoreCase(ct.getBaseType()))
|
||||||
|
contentType = "application/octet-stream";
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
Log.w(ex);
|
||||||
|
}
|
||||||
|
|
||||||
BodyPart placeholderPart = new MimeBodyPart();
|
BodyPart placeholderPart = new MimeBodyPart();
|
||||||
placeholderPart.setContent("", contentType);
|
placeholderPart.setContent("", contentType);
|
||||||
placeholderPart.setFileName(fileName);
|
placeholderPart.setFileName(fileName);
|
||||||
|
|
Loading…
Reference in New Issue