POP3 support

This commit is contained in:
M66B
2019-09-19 17:41:26 +02:00
parent 70cce65e61
commit 0604a1b077
24 changed files with 1304 additions and 151 deletions

View File

@@ -103,7 +103,7 @@ public class EntityAccount extends EntityOrder implements Serializable {
public Long last_connected;
String getProtocol() {
return "imap" + (starttls ? "" : "s");
return (pop ? "pop3" : "imap") + (starttls ? "" : "s");
}
static String getNotificationChannelId(long id) {
@@ -146,6 +146,7 @@ public class EntityAccount extends EntityOrder implements Serializable {
JSONObject json = new JSONObject();
json.put("id", id);
json.put("order", order);
json.put("pop", pop);
json.put("host", host);
json.put("starttls", starttls);
json.put("insecure", insecure);
@@ -184,6 +185,9 @@ public class EntityAccount extends EntityOrder implements Serializable {
if (json.has("order"))
account.order = json.getInt("order");
if (json.has("pop"))
account.pop = json.getBoolean("pop");
account.host = json.getString("host");
account.starttls = (json.has("starttls") && json.getBoolean("starttls"));
account.insecure = (json.has("insecure") && json.getBoolean("insecure"));