inbox service imap(s) timeouts

This commit is contained in:
Benjamin Gamard 2018-03-03 17:33:57 +01:00
parent d55334739c
commit 1b05261a97
2 changed files with 10 additions and 1 deletions

View File

@ -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);

View File

@ -364,7 +364,7 @@
},
"inbox": {
"title": "Inbox scanning",
"message": "By enabling this feature, the system will scan the specified inbox every 15 minutes for <strong>unread</strong> emails and automatically import them.<br/>After importing an email, it will be marked as read.<br/>Configuration settings for <a href=\"https://support.google.com/mail/answer/7126229?hl=en\" target=\"_blank\">Gmail</a>, <a href=\"https://support.office.com/en-us/article/pop-imap-and-smtp-settings-for-outlook-com-d088b986-291d-42b8-9564-9c414e2aa040\" target=\"_blank\">Outlook.com</a>, <a href=\"https://help.yahoo.com/kb/SLN4075.html\" target=\"_blank\">Yahoo</a>.",
"message": "By enabling this feature, the system will scan the specified inbox every minute for <strong>unread</strong> emails and automatically import them.<br/>After importing an email, it will be marked as read.<br/>Configuration settings for <a href=\"https://support.google.com/mail/answer/7126229?hl=en\" target=\"_blank\">Gmail</a>, <a href=\"https://support.office.com/en-us/article/pop-imap-and-smtp-settings-for-outlook-com-d088b986-291d-42b8-9564-9c414e2aa040\" target=\"_blank\">Outlook.com</a>, <a href=\"https://help.yahoo.com/kb/SLN4075.html\" target=\"_blank\">Yahoo</a>.",
"enabled": "Enable inbox scanning",
"hostname": "IMAP hostname",
"port": "IMAP port (143 or 993)",