mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 09:21:49 -05:00
Implement a new davmail.clientSoTimeout setting to adjust or disable connection timeout
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1902 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
d53967aa6e
commit
0c515256d2
@ -152,7 +152,7 @@ public abstract class AbstractServer extends Thread {
|
|||||||
while (true) {
|
while (true) {
|
||||||
clientSocket = serverSocket.accept();
|
clientSocket = serverSocket.accept();
|
||||||
// set default timeout to 5 minutes
|
// set default timeout to 5 minutes
|
||||||
clientSocket.setSoTimeout(300000);
|
clientSocket.setSoTimeout(Settings.getIntProperty("davmail.clientSoTimeout", 300)*1000);
|
||||||
DavGatewayTray.debug(new BundleMessage("LOG_CONNECTION_FROM", clientSocket.getInetAddress(), port));
|
DavGatewayTray.debug(new BundleMessage("LOG_CONNECTION_FROM", clientSocket.getInetAddress(), port));
|
||||||
// only accept localhost connections for security reasons
|
// only accept localhost connections for security reasons
|
||||||
if (Settings.getBooleanProperty("davmail.allowRemote") ||
|
if (Settings.getBooleanProperty("davmail.allowRemote") ||
|
||||||
|
@ -136,6 +136,7 @@ public final class Settings {
|
|||||||
SETTINGS.put("davmail.smtpPort", "1025");
|
SETTINGS.put("davmail.smtpPort", "1025");
|
||||||
SETTINGS.put("davmail.caldavPort", "1080");
|
SETTINGS.put("davmail.caldavPort", "1080");
|
||||||
SETTINGS.put("davmail.ldapPort", "1389");
|
SETTINGS.put("davmail.ldapPort", "1389");
|
||||||
|
SETTINGS.put("davmail.clientSoTimeout", "");
|
||||||
SETTINGS.put("davmail.keepDelay", "30");
|
SETTINGS.put("davmail.keepDelay", "30");
|
||||||
SETTINGS.put("davmail.sentKeepDelay", "90");
|
SETTINGS.put("davmail.sentKeepDelay", "90");
|
||||||
SETTINGS.put("davmail.caldavPastDelay", "90");
|
SETTINGS.put("davmail.caldavPastDelay", "90");
|
||||||
|
@ -70,6 +70,7 @@ public class SettingsFrame extends JFrame {
|
|||||||
|
|
||||||
JCheckBox allowRemoteField;
|
JCheckBox allowRemoteField;
|
||||||
JTextField bindAddressField;
|
JTextField bindAddressField;
|
||||||
|
JTextField clientSoTimeoutField;
|
||||||
JTextField certHashField;
|
JTextField certHashField;
|
||||||
JCheckBox disableUpdateCheck;
|
JCheckBox disableUpdateCheck;
|
||||||
|
|
||||||
@ -372,18 +373,21 @@ public class SettingsFrame extends JFrame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected JPanel getNetworkSettingsPanel() {
|
protected JPanel getNetworkSettingsPanel() {
|
||||||
JPanel networkSettingsPanel = new JPanel(new GridLayout(3, 2));
|
JPanel networkSettingsPanel = new JPanel(new GridLayout(4, 2));
|
||||||
networkSettingsPanel.setBorder(BorderFactory.createTitledBorder(BundleMessage.format("UI_NETWORK")));
|
networkSettingsPanel.setBorder(BorderFactory.createTitledBorder(BundleMessage.format("UI_NETWORK")));
|
||||||
|
|
||||||
allowRemoteField = new JCheckBox();
|
allowRemoteField = new JCheckBox();
|
||||||
allowRemoteField.setSelected(Settings.getBooleanProperty("davmail.allowRemote"));
|
allowRemoteField.setSelected(Settings.getBooleanProperty("davmail.allowRemote"));
|
||||||
|
|
||||||
bindAddressField = new JTextField(Settings.getProperty("davmail.bindAddress"), 15);
|
bindAddressField = new JTextField(Settings.getProperty("davmail.bindAddress"), 15);
|
||||||
|
clientSoTimeoutField = new JTextField(Settings.getProperty("davmail.clientSoTimeout"), 15);;
|
||||||
|
|
||||||
certHashField = new JTextField(Settings.getProperty("davmail.server.certificate.hash"), 15);
|
certHashField = new JTextField(Settings.getProperty("davmail.server.certificate.hash"), 15);
|
||||||
|
|
||||||
addSettingComponent(networkSettingsPanel, BundleMessage.format("UI_BIND_ADDRESS"), bindAddressField,
|
addSettingComponent(networkSettingsPanel, BundleMessage.format("UI_BIND_ADDRESS"), bindAddressField,
|
||||||
BundleMessage.format("UI_BIND_ADDRESS_HELP"));
|
BundleMessage.format("UI_BIND_ADDRESS_HELP"));
|
||||||
|
addSettingComponent(networkSettingsPanel, BundleMessage.format("UI_CLIENT_SO_TIMEOUT"), clientSoTimeoutField,
|
||||||
|
BundleMessage.format("UI_CLIENT_SO_TIMEOUT_HELP"));
|
||||||
addSettingComponent(networkSettingsPanel, BundleMessage.format("UI_ALLOW_REMOTE_CONNECTION"), allowRemoteField,
|
addSettingComponent(networkSettingsPanel, BundleMessage.format("UI_ALLOW_REMOTE_CONNECTION"), allowRemoteField,
|
||||||
BundleMessage.format("UI_ALLOW_REMOTE_CONNECTION_HELP"));
|
BundleMessage.format("UI_ALLOW_REMOTE_CONNECTION_HELP"));
|
||||||
addSettingComponent(networkSettingsPanel, BundleMessage.format("UI_SERVER_CERTIFICATE_HASH"), certHashField,
|
addSettingComponent(networkSettingsPanel, BundleMessage.format("UI_SERVER_CERTIFICATE_HASH"), certHashField,
|
||||||
@ -557,6 +561,7 @@ public class SettingsFrame extends JFrame {
|
|||||||
disableUpdateCheck.setSelected(Settings.getBooleanProperty(("davmail.disableUpdateCheck")));
|
disableUpdateCheck.setSelected(Settings.getBooleanProperty(("davmail.disableUpdateCheck")));
|
||||||
|
|
||||||
caldavEditNotificationsField.setSelected(Settings.getBooleanProperty("davmail.caldavEditNotifications"));
|
caldavEditNotificationsField.setSelected(Settings.getBooleanProperty("davmail.caldavEditNotifications"));
|
||||||
|
clientSoTimeoutField.setText(Settings.getProperty("davmail.clientSoTimeout"));
|
||||||
caldavAlarmSoundField.setText(Settings.getProperty("davmail.caldavAlarmSound"));
|
caldavAlarmSoundField.setText(Settings.getProperty("davmail.caldavAlarmSound"));
|
||||||
forceActiveSyncUpdateCheckBox.setSelected(Settings.getBooleanProperty("davmail.forceActiveSyncUpdate"));
|
forceActiveSyncUpdateCheckBox.setSelected(Settings.getBooleanProperty("davmail.forceActiveSyncUpdate"));
|
||||||
defaultDomainField.setText(Settings.getProperty("davmail.defaultDomain"));
|
defaultDomainField.setText(Settings.getProperty("davmail.defaultDomain"));
|
||||||
@ -695,6 +700,7 @@ public class SettingsFrame extends JFrame {
|
|||||||
Settings.setProperty("davmail.proxyPassword", httpProxyPasswordField.getText());
|
Settings.setProperty("davmail.proxyPassword", httpProxyPasswordField.getText());
|
||||||
|
|
||||||
Settings.setProperty("davmail.bindAddress", bindAddressField.getText());
|
Settings.setProperty("davmail.bindAddress", bindAddressField.getText());
|
||||||
|
Settings.setProperty("davmail.clientSoTimeout", String.valueOf(clientSoTimeoutField.getText()));
|
||||||
Settings.setProperty("davmail.allowRemote", String.valueOf(allowRemoteField.isSelected()));
|
Settings.setProperty("davmail.allowRemote", String.valueOf(allowRemoteField.isSelected()));
|
||||||
Settings.setProperty("davmail.server.certificate.hash", certHashField.getText());
|
Settings.setProperty("davmail.server.certificate.hash", certHashField.getText());
|
||||||
Settings.setProperty("davmail.disableUpdateCheck", String.valueOf(disableUpdateCheck.isSelected()));
|
Settings.setProperty("davmail.disableUpdateCheck", String.valueOf(disableUpdateCheck.isSelected()));
|
||||||
|
@ -183,6 +183,8 @@ UI_KEY_STORE_PASSWORD=Key store password:
|
|||||||
UI_KEY_STORE_PASSWORD_HELP=Key store password
|
UI_KEY_STORE_PASSWORD_HELP=Key store password
|
||||||
UI_KEY_STORE_TYPE=Key store type:
|
UI_KEY_STORE_TYPE=Key store type:
|
||||||
UI_KEY_STORE_TYPE_HELP=Choose key store type
|
UI_KEY_STORE_TYPE_HELP=Choose key store type
|
||||||
|
UI_CLIENT_SO_TIMEOUT=Client connection timeout:
|
||||||
|
UI_CLIENT_SO_TIMEOUT_HELP=Client connection timeout in seconds, 0 to disable timeout, empty for 5 minutes
|
||||||
UI_CLIENT_KEY_STORE=Client key store:
|
UI_CLIENT_KEY_STORE=Client key store:
|
||||||
UI_CLIENT_KEY_STORE_HELP=SSL client certificate key store file path
|
UI_CLIENT_KEY_STORE_HELP=SSL client certificate key store file path
|
||||||
UI_CLIENT_KEY_STORE_PASSWORD=Client key store password:
|
UI_CLIENT_KEY_STORE_PASSWORD=Client key store password:
|
||||||
|
@ -218,6 +218,8 @@ UI_PKCS11_LIBRARY_HELP=Chemin de la librarie PKCS11 (carte
|
|||||||
UI_PKCS11_LIBRARY=Librairie PKCS11 :
|
UI_PKCS11_LIBRARY=Librairie PKCS11 :
|
||||||
UI_PKCS11_CONFIG_HELP=Configuration PKCS11 complémentaire optionnelle (slot, nssArgs, ...)
|
UI_PKCS11_CONFIG_HELP=Configuration PKCS11 complémentaire optionnelle (slot, nssArgs, ...)
|
||||||
UI_PKCS11_CONFIG=Configuration PKCS11 :
|
UI_PKCS11_CONFIG=Configuration PKCS11 :
|
||||||
|
UI_CLIENT_SO_TIMEOUT=Délai d'attente client:
|
||||||
|
UI_CLIENT_SO_TIMEOUT_HELP=Délai d'attente client en secondes, 0 pour désactiver, vide pour 5 minutes
|
||||||
UI_CLIENT_CERTIFICATE=Certificat client (DavMail vers Exchange)
|
UI_CLIENT_CERTIFICATE=Certificat client (DavMail vers Exchange)
|
||||||
UI_LOG_FILE_PATH=Chemin du fichier de traces :
|
UI_LOG_FILE_PATH=Chemin du fichier de traces :
|
||||||
UI_LOG_FILE_SIZE=Taille du fichier de traces :
|
UI_LOG_FILE_SIZE=Taille du fichier de traces :
|
||||||
|
@ -68,6 +68,11 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>10.0.1.2</td>
|
<td>10.0.1.2</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Client connection timeout</td>
|
||||||
|
<td>Client connection timeout in seconds, 0 to disable timeout, empty for 5 minutes</td>
|
||||||
|
<td>300</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</subsection>
|
</subsection>
|
||||||
<subsection name="Encryption">
|
<subsection name="Encryption">
|
||||||
|
@ -53,6 +53,7 @@ davmail.smtpSaveInSent=true
|
|||||||
davmail.server=true
|
davmail.server=true
|
||||||
davmail.server.certificate.hash=
|
davmail.server.certificate.hash=
|
||||||
davmail.bindAddress=
|
davmail.bindAddress=
|
||||||
|
davmail.clientSoTimeout=
|
||||||
davmail.allowRemote=true
|
davmail.allowRemote=true
|
||||||
davmail.disableUpdateCheck=false
|
davmail.disableUpdateCheck=false
|
||||||
log4j.rootLogger=WARN
|
log4j.rootLogger=WARN
|
||||||
|
Loading…
x
Reference in New Issue
Block a user