Download small messages on metered connection only, refactoring, improvements

This commit is contained in:
M66B
2018-09-16 10:44:13 +00:00
parent 5d07791b99
commit 265e7fe88f
17 changed files with 173 additions and 111 deletions

View File

@@ -92,6 +92,8 @@ public class MessageHelper {
//props.put("mail.imaps.compress.strategy", "0");
}
props.put("mail.imaps.fetchsize", Integer.toString(64 * 1024)); // default 16K
// https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html#properties
props.put("mail.smtps.ssl.checkserveridentity", "true");
props.put("mail.smtps.ssl.trust", "*");
@@ -270,6 +272,11 @@ public class MessageHelper {
return null;
}
Integer getSize() throws MessagingException {
int size = imessage.getSize();
return (size < 0 ? null : size);
}
static String getFormattedAddresses(Address[] addresses, boolean full) {
if (addresses == null || addresses.length == 0)
return "";