Move strict_tls, max_smtp_rcpt_to from Provider to ProviderOptions

This commit is contained in:
iequidoo
2023-02-16 17:46:28 -03:00
committed by iequidoo
parent 604c4fcb71
commit 3b5227c42a
6 changed files with 39 additions and 139 deletions

View File

@@ -129,13 +129,6 @@ pub struct Provider {
/// Default configuration values to set when provider is configured.
pub config_defaults: Option<Vec<ConfigDefault>>,
/// True if provider is known to use use proper,
/// not self-signed certificates.
pub strict_tls: bool,
/// Maximum number of recipients the provider allows to send a single email to.
pub max_smtp_rcpt_to: Option<u16>,
/// Type of OAuth 2 authorization if provider supports it.
pub oauth2_authorizer: Option<Oauth2Authorizer>,
@@ -144,12 +137,29 @@ pub struct Provider {
}
/// Provider options with good defaults.
#[derive(Debug, Default, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq)]
pub struct ProviderOptions {
/// True if provider is known to use use proper,
/// not self-signed certificates.
pub strict_tls: bool,
/// Maximum number of recipients the provider allows to send a single email to.
pub max_smtp_rcpt_to: Option<u16>,
/// Move messages to the Trash folder instead of marking them "\Deleted".
pub delete_to_trash: bool,
}
impl Default for ProviderOptions {
fn default() -> Self {
Self {
strict_tls: true,
max_smtp_rcpt_to: None,
delete_to_trash: false,
}
}
}
/// Get resolver to query MX records.
///
/// We first try to read the system's resolver from `/etc/resolv.conf`.