Improved empty message check

This commit is contained in:
M66B
2020-04-18 09:44:16 +02:00
parent f7dff578af
commit 64885369e2
2 changed files with 16 additions and 7 deletions

View File

@@ -1458,6 +1458,20 @@ public class MessageHelper {
return (html.size() == 0);
}
boolean hasBody() throws MessagingException {
List<Part> all = new ArrayList<>();
all.addAll(plain);
all.addAll(html);
if (all.size() == 0)
return true;
for (Part p : all)
if (p.getSize() > 0)
return true;
return false;
}
Long getBodySize() throws MessagingException {
Long size = null;