mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
use provider-database only if the user did not enter a server/port/whatever manually; this allows the user to override erroneous choices
This commit is contained in:
committed by
holger krekel
parent
e0499c9552
commit
ce37a8dda2
@@ -147,11 +147,7 @@ pub fn JobConfigureImap(context: &Context) {
|
|||||||
4 => {
|
4 => {
|
||||||
progress!(context, 200);
|
progress!(context, 200);
|
||||||
|
|
||||||
if let Some(new_param) = get_offline_autoconfig(context, ¶m) {
|
if param.mail_server.is_empty()
|
||||||
keep_flags = new_param.server_flags & DC_LP_AUTH_OAUTH2;
|
|
||||||
param_autoconfig = Some(new_param);
|
|
||||||
step_counter = STEP_AFTER_AUTOCONFIG;
|
|
||||||
} else if param.mail_server.is_empty()
|
|
||||||
&& param.mail_port == 0
|
&& param.mail_port == 0
|
||||||
/*&¶m.mail_user.is_empty() -- the user can enter a loginname which is used by autoconfig then */
|
/*&¶m.mail_user.is_empty() -- the user can enter a loginname which is used by autoconfig then */
|
||||||
&& param.send_server.is_empty()
|
&& param.send_server.is_empty()
|
||||||
@@ -160,9 +156,15 @@ pub fn JobConfigureImap(context: &Context) {
|
|||||||
/*&¶m.send_pw.is_empty() -- the password cannot be auto-configured and is no criterion for autoconfig or not */
|
/*&¶m.send_pw.is_empty() -- the password cannot be auto-configured and is no criterion for autoconfig or not */
|
||||||
&& (param.server_flags & !DC_LP_AUTH_OAUTH2) == 0
|
&& (param.server_flags & !DC_LP_AUTH_OAUTH2) == 0
|
||||||
{
|
{
|
||||||
|
// no advanced parameters entered by the user: query provider-database or do Autoconfig
|
||||||
keep_flags = param.server_flags & DC_LP_AUTH_OAUTH2;
|
keep_flags = param.server_flags & DC_LP_AUTH_OAUTH2;
|
||||||
|
if let Some(new_param) = get_offline_autoconfig(context, ¶m) {
|
||||||
|
// got parameters from our provider-database, skip Autoconfig, preserve the OAuth2 setting
|
||||||
|
param_autoconfig = Some(new_param);
|
||||||
|
step_counter = STEP_AFTER_AUTOCONFIG;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Autoconfig is not needed so skip it.
|
// advanced parameters entered by the user: skip Autoconfig
|
||||||
step_counter = STEP_AFTER_AUTOCONFIG;
|
step_counter = STEP_AFTER_AUTOCONFIG;
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
@@ -272,7 +274,6 @@ pub fn JobConfigureImap(context: &Context) {
|
|||||||
}
|
}
|
||||||
// Step 3: Fill missing fields with defaults
|
// Step 3: Fill missing fields with defaults
|
||||||
13 => {
|
13 => {
|
||||||
// if you move this, don't forget to update STEP_3_INDEX, too
|
|
||||||
if param.mail_server.is_empty() {
|
if param.mail_server.is_empty() {
|
||||||
param.mail_server = format!("imap.{}", param_domain,)
|
param.mail_server = format!("imap.{}", param_domain,)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user