Allow placeholders in Autoconfig domain elements

This commit is contained in:
cketti 2023-11-09 23:46:25 +01:00
parent 6b976f5f6b
commit 513bd2cec9
2 changed files with 2 additions and 1 deletions

View file

@ -112,7 +112,7 @@ private class ClientConfigParser(
if (eventType == XmlPullParser.START_TAG) {
when (pullParser.name) {
"domain" -> {
val domain = readText()
val domain = readText().replaceVariables()
if (domain.isValidHostname()) {
domainFound = true
}

View file

@ -112,6 +112,7 @@ class RealAutoconfigParserTest {
@Test
fun `replace variables`() {
val inputStream = minimalConfig.withModifications {
element("domain").text("%EMAILDOMAIN%")
element("incomingServer > hostname").text("%EMAILLOCALPART%.domain.example")
element("outgoingServer > hostname").text("%EMAILLOCALPART%.outgoing.domain.example")
element("outgoingServer > username").text("%EMAILDOMAIN%")