Added option for insecure IMAP

This commit is contained in:
Michael Vogel 2019-11-26 23:27:20 +01:00
parent 16d2f11b40
commit 3ed196fd9c
2 changed files with 13 additions and 2 deletions

View file

@ -829,7 +829,13 @@ function settings_content(App $a)
$tpl = Renderer::getMarkupTemplate('settings/connectors.tpl'); $tpl = Renderer::getMarkupTemplate('settings/connectors.tpl');
$mail_disabled_message = (($mail_disabled) ? L10n::t('Email access is disabled on this site.') : ''); $mail_disabled_message = ($mail_disabled ? L10n::t('Email access is disabled on this site.') : '');
$ssl_options = ['TLS' => 'TLS', 'SSL' => 'SSL'];
if (Config::get('system', 'insecure_imap')) {
$ssl_options['notls'] = L10n::t('None');
}
$o .= Renderer::replaceMacros($tpl, [ $o .= Renderer::replaceMacros($tpl, [
'$form_security_token' => BaseModule::getFormSecurityToken("settings_connectors"), '$form_security_token' => BaseModule::getFormSecurityToken("settings_connectors"),
@ -859,7 +865,7 @@ function settings_content(App $a)
'$mail_disabled' => $mail_disabled_message, '$mail_disabled' => $mail_disabled_message,
'$mail_server' => ['mail_server', L10n::t('IMAP server name:'), $mail_server, ''], '$mail_server' => ['mail_server', L10n::t('IMAP server name:'), $mail_server, ''],
'$mail_port' => ['mail_port', L10n::t('IMAP port:'), $mail_port, ''], '$mail_port' => ['mail_port', L10n::t('IMAP port:'), $mail_port, ''],
'$mail_ssl' => ['mail_ssl', L10n::t('Security:'), strtoupper($mail_ssl), '', [/*'notls' => L10n::t('None'),*/ 'TLS' => 'TLS', 'SSL' => 'SSL']], '$mail_ssl' => ['mail_ssl', L10n::t('Security:'), strtoupper($mail_ssl), '', $ssl_options],
'$mail_user' => ['mail_user', L10n::t('Email login name:'), $mail_user, ''], '$mail_user' => ['mail_user', L10n::t('Email login name:'), $mail_user, ''],
'$mail_pass' => ['mail_pass', L10n::t('Email password:'), '', ''], '$mail_pass' => ['mail_pass', L10n::t('Email password:'), '', ''],
'$mail_replyto' => ['mail_replyto', L10n::t('Reply-to address:'), $mail_replyto, 'Optional'], '$mail_replyto' => ['mail_replyto', L10n::t('Reply-to address:'), $mail_replyto, 'Optional'],

View file

@ -189,6 +189,11 @@ return [
// For development only. Disables the item cache. // For development only. Disables the item cache.
'ignore_cache' => false, 'ignore_cache' => false,
// insecure_imap (Boolean)
// If enabled, users are allowed to connect to their IMAP servers unencrypted.
// For security reasons this is disabled by default.
'insecure_imap' => false,
// instances_social_key (String) // instances_social_key (String)
// Key to the API of https://instances.social which retrieves data about mastodon servers. // Key to the API of https://instances.social which retrieves data about mastodon servers.
// See https://instances.social/api/token to get an API key. // See https://instances.social/api/token to get an API key.