mirror of
https://github.com/sismics/docs.git
synced 2024-11-21 21:47:57 +01:00
Add support for STARTTLS for Inbox Scanning (#682)
This commit is contained in:
parent
dd36e08d7d
commit
bd0cde7e87
@ -40,6 +40,7 @@ public enum ConfigType {
|
||||
INBOX_ENABLED,
|
||||
INBOX_HOSTNAME,
|
||||
INBOX_PORT,
|
||||
INBOX_STARTTLS,
|
||||
INBOX_USERNAME,
|
||||
INBOX_PASSWORD,
|
||||
INBOX_FOLDER,
|
||||
|
@ -159,6 +159,7 @@ public class InboxService extends AbstractScheduledService {
|
||||
String port = ConfigUtil.getConfigStringValue(ConfigType.INBOX_PORT);
|
||||
properties.put("mail.imap.host", ConfigUtil.getConfigStringValue(ConfigType.INBOX_HOSTNAME));
|
||||
properties.put("mail.imap.port", port);
|
||||
properties.setProperty("mail.imap.starttls.enable", ConfigUtil.getConfigStringValue(ConfigType.INBOX_STARTTLS).toString());
|
||||
boolean isSsl = "993".equals(port);
|
||||
properties.put("mail.imap.ssl.enable", String.valueOf(isSsl));
|
||||
properties.setProperty("mail.imap.socketFactory.class",
|
||||
|
@ -1 +1 @@
|
||||
db.version=27
|
||||
db.version=28
|
@ -0,0 +1,2 @@
|
||||
insert into T_CONFIG(CFG_ID_C, CFG_VALUE_C) values('INBOX_STARTTLS', 'false');
|
||||
update T_CONFIG set CFG_VALUE_C = '28' where CFG_ID_C = 'DB_VERSION';
|
@ -1,3 +1,3 @@
|
||||
api.current_version=${project.version}
|
||||
api.min_version=1.0
|
||||
db.version=27
|
||||
db.version=28
|
@ -334,6 +334,7 @@ public class AppResource extends BaseResource {
|
||||
Boolean deleteImported = ConfigUtil.getConfigBooleanValue(ConfigType.INBOX_DELETE_IMPORTED);
|
||||
Config hostnameConfig = configDao.getById(ConfigType.INBOX_HOSTNAME);
|
||||
Config portConfig = configDao.getById(ConfigType.INBOX_PORT);
|
||||
Boolean starttls = ConfigUtil.getConfigBooleanValue(ConfigType.INBOX_STARTTLS);
|
||||
Config usernameConfig = configDao.getById(ConfigType.INBOX_USERNAME);
|
||||
Config passwordConfig = configDao.getById(ConfigType.INBOX_PASSWORD);
|
||||
Config folderConfig = configDao.getById(ConfigType.INBOX_FOLDER);
|
||||
@ -353,6 +354,7 @@ public class AppResource extends BaseResource {
|
||||
} else {
|
||||
response.add("port", Integer.valueOf(portConfig.getValue()));
|
||||
}
|
||||
response.add("starttls", starttls);
|
||||
if (usernameConfig == null) {
|
||||
response.addNull("username");
|
||||
} else {
|
||||
@ -425,6 +427,7 @@ public class AppResource extends BaseResource {
|
||||
@FormParam("deleteImported") Boolean deleteImported,
|
||||
@FormParam("hostname") String hostname,
|
||||
@FormParam("port") String portStr,
|
||||
@FormParam("starttls") Boolean starttls,
|
||||
@FormParam("username") String username,
|
||||
@FormParam("password") String password,
|
||||
@FormParam("folder") String folder,
|
||||
@ -439,6 +442,7 @@ public class AppResource extends BaseResource {
|
||||
if (!Strings.isNullOrEmpty(portStr)) {
|
||||
ValidationUtil.validateInteger(portStr, "port");
|
||||
}
|
||||
ValidationUtil.validateRequired(starttls, "starttls");
|
||||
|
||||
// Just update the changed configuration
|
||||
ConfigDao configDao = new ConfigDao();
|
||||
@ -451,6 +455,7 @@ public class AppResource extends BaseResource {
|
||||
if (!Strings.isNullOrEmpty(portStr)) {
|
||||
configDao.update(ConfigType.INBOX_PORT, portStr);
|
||||
}
|
||||
configDao.update(ConfigType.INBOX_STARTTLS, starttls.toString());
|
||||
if (!Strings.isNullOrEmpty(username)) {
|
||||
configDao.update(ConfigType.INBOX_USERNAME, username);
|
||||
}
|
||||
|
@ -440,6 +440,7 @@
|
||||
"enabled": "Durchsuchen des Posteingangs aktivieren",
|
||||
"hostname": "IMAP-Server",
|
||||
"port": "IMAP-Port (143 oder 993)",
|
||||
"starttls": "Verwende STARTTLS",
|
||||
"username": "IMAP-Benutzername",
|
||||
"password": "IMAP-Passwort",
|
||||
"folder": "IMAP-Ordner",
|
||||
@ -449,6 +450,8 @@
|
||||
"test_success": "Die Verbindung zum Posteingang war erfolgreich ({{ count }} <strong>ungelesene</strong> {{ count > 1 ? 'Nachrichten' : 'Nachricht' }})",
|
||||
"test_fail": "Beim Verbinden mit dem Posteingang ist ein Fehler aufgetreten, bitte überprüfen Sie die Einstellungen",
|
||||
"saved": "IMAP-Konfiguration erfolgreich gespeichert"
|
||||
"autoTagsEnabled": "Automatisches Hinzufügen von Tags aus der mit # markierten Betreffzeile",
|
||||
"deleteImported": "Importierte Nachrichten aus Mailbox löschen"
|
||||
},
|
||||
"monitoring": {
|
||||
"background_tasks": "Hintergrundaufgaben",
|
||||
|
@ -440,6 +440,7 @@
|
||||
"enabled": "Enable inbox scanning",
|
||||
"hostname": "IMAP hostname",
|
||||
"port": "IMAP port (143 or 993)",
|
||||
"starttls": "Enable STARTTLS",
|
||||
"username": "IMAP username",
|
||||
"password": "IMAP password",
|
||||
"folder": "IMAP folder",
|
||||
|
@ -45,6 +45,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="inboxStarttls">{{ 'settings.inbox.starttls' | translate }}</label>
|
||||
<div class="col-sm-7">
|
||||
<input name="starttls" type="checkbox" id="inboxStarttls" ng-model="inbox.starttls" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="inboxUsername">{{ 'settings.inbox.username' | translate }}</label>
|
||||
<div class="col-sm-7">
|
||||
|
Loading…
Reference in New Issue
Block a user