Added POP3 option to leave messages on server

This commit is contained in:
M66B
2019-09-25 13:26:56 +02:00
parent 8e245517f3
commit 13997a0848
9 changed files with 1904 additions and 12 deletions

View File

@@ -85,8 +85,6 @@ public class MailService implements AutoCloseable {
properties.put("mail." + protocol + ".writetimeout", Integer.toString(WRITE_TIMEOUT)); // one thread overhead
properties.put("mail." + protocol + ".timeout", Integer.toString(READ_TIMEOUT));
//properties.put("mail." + protocol + ".rsetbeforequit", "true");
} else if ("imap".equals(protocol) || "imaps".equals(protocol)) {
// https://javaee.github.io/javamail/docs/api/com/sun/mail/imap/package-summary.html#properties
properties.put("mail." + protocol + ".ssl.checkserveridentity", checkserveridentity);
@@ -158,6 +156,10 @@ public class MailService implements AutoCloseable {
properties.put("mail." + protocol + ".separatestoreconnection", "true");
}
void setLeaveOnServer(boolean keep) {
properties.put("mail." + protocol + ".rsetbeforequit", Boolean.toString(keep));
}
public void connect(EntityAccount account) throws MessagingException {
String password = connect(account.host, account.port, account.auth_type, account.user, account.password);
if (password != null) {