diff --git a/melib/src/conf.rs b/melib/src/conf.rs index 27b287d5..706897be 100644 --- a/melib/src/conf.rs +++ b/melib/src/conf.rs @@ -107,11 +107,15 @@ impl MailboxConf { } } -pub(in crate::conf) fn false_val() -> bool { +pub fn true_val() -> bool { + true +} + +pub fn false_val() -> bool { false } -pub(in crate::conf) fn none() -> Option { +pub fn none() -> Option { None } diff --git a/melib/src/smtp.rs b/melib/src/smtp.rs index 4a83bd79..345dc9b1 100644 --- a/melib/src/smtp.rs +++ b/melib/src/smtp.rs @@ -173,22 +173,33 @@ pub struct SmtpServerConf { /// Configured SMTP extensions to use #[derive(Debug, Clone, Serialize, Deserialize)] pub struct SmtpExtensionSupport { + #[serde(default = "crate::conf::true_val")] pipelining: bool, + #[serde(default = "crate::conf::true_val")] chunking: bool, //Essentially, the PRDR extension to SMTP allows (but does not require) an SMTP server to //issue multiple responses after a message has been transferred, by mutual consent of the //client and server. SMTP clients that support the PRDR extension then use the expanded //responses as supplemental data to the responses that were received during the earlier //envelope exchange. + #[serde(default = "crate::conf::true_val")] prdr: bool, + #[serde(default = "crate::conf::false_val")] binarymime: bool, //Resources: //- http://www.postfix.org/SMTPUTF8_README.html + #[serde(default = "crate::conf::true_val")] smtputf8: bool, + #[serde(default = "crate::conf::true_val")] auth: bool, + #[serde(default = "default_dsn")] dsn_notify: Option>, } +fn default_dsn() -> Option> { + Some("FAILURE".into()) +} + impl Default for SmtpExtensionSupport { fn default() -> Self { Self {