configure: try multiple servers for each protocol

LoginParamNew structure, which contained possible IMAP and SMTP
configurations to try is replaced with uniform vectors of ServerParams
structures. These vectors are initialized from provider database, online
Mozilla or Outlook XML configuration or user entered parameters.

During configuration, vectors of ServerParams are expanded to replace
unknown values with all possible variants, which are tried one by one
until configuration succeeds or all variants for a particular protocol
(IMAP or SMTP) are exhausted.

ServerParams structure is moved into configure submodule, and all
dependencies on it outside of this submodule are removed.
This commit is contained in:
Alexander Krotov
2020-08-23 00:00:00 +03:00
committed by link2xt
parent 927c7eb59d
commit 4481ab18f5
7 changed files with 500 additions and 640 deletions

View File

@@ -19,10 +19,6 @@ use crate::context::Context;
use crate::error::{bail, Error};
use crate::events::EventType;
pub(crate) fn dc_exactly_one_bit_set(v: i32) -> bool {
0 != v && 0 == v & (v - 1)
}
/// Shortens a string to a specified length and adds "[...]" to the
/// end of the shortened string.
#[allow(clippy::indexing_slicing)]