Autoconfig testing

This commit is contained in:
mdecimus
2024-05-09 13:14:18 +02:00
parent 7a25689288
commit 7e8f5fb3e9
2 changed files with 7 additions and 6 deletions

View File

@@ -80,10 +80,11 @@ impl BootManager {
if config_path.is_none() {
let mut args = std::env::args().skip(1);
while let Some(arg) = args
.next()
.and_then(|arg| arg.strip_prefix("--").map(|arg| arg.to_string()))
{
while let Some(arg) = args.next().and_then(|arg| {
arg.strip_prefix("--")
.or_else(|| arg.strip_prefix('-'))
.map(|arg| arg.to_string())
}) {
let (key, value) = if let Some((key, value)) = arg.split_once('=') {
(key.to_string(), Some(value.trim().to_string()))
} else {

View File

@@ -77,18 +77,18 @@ impl JMAP {
"\t\t\t<socketType>{}</socketType>",
if is_tls { "SSL" } else { "STARTTLS" }
);
let _ = writeln!(&mut config, "\t\t\t<username>{account_name}</username>");
let _ = writeln!(
&mut config,
"\t\t\t<authentication>password-cleartext</authentication>"
);
let _ = writeln!(&mut config, "\t\t\t<username>{account_name}</username>");
let _ = writeln!(&mut config, "\t\t</{tag}>");
}
config.push_str("\t</emailProvider>\n");
let _ = writeln!(
&mut config,
"\t<clientConfigUpdate url=\"https://autoconfig.{domain}/.well-known/mail-v1.xml\"/>"
"\t<clientConfigUpdate url=\"https://autoconfig.{domain}/mail/config-v1.1.xml\"></clientConfigUpdate>"
);
config.push_str("</clientConfig>\n");