From 1b05261a97814c62629a84f0c8134d066a6ead63 Mon Sep 17 00:00:00 2001 From: Benjamin Gamard Date: Sat, 3 Mar 2018 17:33:57 +0100 Subject: [PATCH] inbox service imap(s) timeouts --- .../java/com/sismics/docs/core/service/InboxService.java | 9 +++++++++ docs-web/src/main/webapp/src/locale/en.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs-core/src/main/java/com/sismics/docs/core/service/InboxService.java b/docs-core/src/main/java/com/sismics/docs/core/service/InboxService.java index 4985c1cb..a94b5777 100644 --- a/docs-core/src/main/java/com/sismics/docs/core/service/InboxService.java +++ b/docs-core/src/main/java/com/sismics/docs/core/service/InboxService.java @@ -155,6 +155,15 @@ public class InboxService extends AbstractScheduledService { isSsl ? "javax.net.ssl.SSLSocketFactory" : "javax.net.DefaultSocketFactory"); properties.setProperty("mail.imap.socketFactory.fallback", "true"); properties.setProperty("mail.imap.socketFactory.port", port); + if (isSsl) { + properties.put("mail.imaps.connectiontimeout", 30000); + properties.put("mail.imaps.timeout", 30000); + properties.put("mail.imaps.writetimeout", 30000); + } else { + properties.put("mail.imap.connectiontimeout", 30000); + properties.put("mail.imap.timeout", 30000); + properties.put("mail.imap.writetimeout", 30000); + } Session session = Session.getDefaultInstance(properties); diff --git a/docs-web/src/main/webapp/src/locale/en.json b/docs-web/src/main/webapp/src/locale/en.json index 3ee7890a..2b9e11e4 100644 --- a/docs-web/src/main/webapp/src/locale/en.json +++ b/docs-web/src/main/webapp/src/locale/en.json @@ -364,7 +364,7 @@ }, "inbox": { "title": "Inbox scanning", - "message": "By enabling this feature, the system will scan the specified inbox every 15 minutes for unread emails and automatically import them.
After importing an email, it will be marked as read.
Configuration settings for Gmail, Outlook.com, Yahoo.", + "message": "By enabling this feature, the system will scan the specified inbox every minute for unread emails and automatically import them.
After importing an email, it will be marked as read.
Configuration settings for Gmail, Outlook.com, Yahoo.", "enabled": "Enable inbox scanning", "hostname": "IMAP hostname", "port": "IMAP port (143 or 993)",