mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
do autoconfig only when no advanced options are entered
the advanced options are not used anyway later, but prevent imap/smtp connections from being altered. nb: we want to stop altering when some advanced options are entered, however, we want to do this probaby not depending on autoconfig.
This commit is contained in:
committed by
dignifiedquire
parent
408e9946af
commit
84963e198e
@@ -121,7 +121,6 @@ impl Context {
|
|||||||
async fn configure(ctx: &Context, imap: &mut Imap, param: &mut LoginParam) -> Result<()> {
|
async fn configure(ctx: &Context, imap: &mut Imap, param: &mut LoginParam) -> Result<()> {
|
||||||
let mut param_autoconfig: Option<LoginParam> = None;
|
let mut param_autoconfig: Option<LoginParam> = None;
|
||||||
let mut keep_flags = 0;
|
let mut keep_flags = 0;
|
||||||
let mut use_autoconfig = true;
|
|
||||||
|
|
||||||
// Read login parameters from the database
|
// Read login parameters from the database
|
||||||
progress!(ctx, 1);
|
progress!(ctx, 1);
|
||||||
@@ -170,18 +169,15 @@ async fn configure(ctx: &Context, imap: &mut Imap, param: &mut LoginParam) -> Re
|
|||||||
// got parameters from our provider-database, skip Autoconfig, preserve the OAuth2 setting
|
// got parameters from our provider-database, skip Autoconfig, preserve the OAuth2 setting
|
||||||
param_autoconfig = Some(new_param);
|
param_autoconfig = Some(new_param);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// advanced parameters entered by the user: skip Autoconfig
|
|
||||||
use_autoconfig = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if param_autoconfig.is_none() {
|
if param_autoconfig.is_none() {
|
||||||
param_autoconfig = get_autoconfig(ctx, param, ¶m_domain, ¶m_addr_urlencoded).await;
|
param_autoconfig =
|
||||||
|
get_autoconfig(ctx, param, ¶m_domain, ¶m_addr_urlencoded).await;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// C. Do we have any autoconfig result?
|
// C. Do we have any autoconfig result?
|
||||||
progress!(ctx, 500);
|
progress!(ctx, 500);
|
||||||
if use_autoconfig {
|
|
||||||
if let Some(ref cfg) = param_autoconfig {
|
if let Some(ref cfg) = param_autoconfig {
|
||||||
info!(ctx, "Got autoconfig: {}", &cfg);
|
info!(ctx, "Got autoconfig: {}", &cfg);
|
||||||
if !cfg.mail_user.is_empty() {
|
if !cfg.mail_user.is_empty() {
|
||||||
@@ -198,7 +194,6 @@ async fn configure(ctx: &Context, imap: &mut Imap, param: &mut LoginParam) -> Re
|
|||||||
// it is used to later to prevent trying variations of port/server/logins
|
// it is used to later to prevent trying variations of port/server/logins
|
||||||
}
|
}
|
||||||
param.server_flags |= keep_flags;
|
param.server_flags |= keep_flags;
|
||||||
}
|
|
||||||
|
|
||||||
// Step 3: Fill missing fields with defaults
|
// Step 3: Fill missing fields with defaults
|
||||||
if param.mail_server.is_empty() {
|
if param.mail_server.is_empty() {
|
||||||
|
|||||||
Reference in New Issue
Block a user