Mail reverse DNS check, what Jarl adds to named.conf, lists one per line

jarld checks the reverse DNS of the public zones' MX and SPF addresses as the internet sees it, every 6 hours (Exposure page, jarl exposure mail, jarl_mail_reverse_dns_ok). The Server options page, jarl option generated and GET /options/generated list what Jarl writes into named.conf by itself; stats.rate_limit_log turns off the query-errors logging. Option lists of three or more elements are shown one per line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adamandClaude Opus 5.5 committed 2026-10-12 21:02:11 +01:00
1 parent d33f573782
commit c27a6c10bd
30 files changed
+1095 -16

No files matched your search

+35
View File
@@ -182,3 +182,38 @@ func writeItemsInline(sb *strings.Builder, items []Item) {
}
}
}
// FormatValueList is FormatValue, except that a value whose block is a
// plain list (no nested blocks) of at least min elements is laid out one
// element per line, for reading: allow-query, exempt-clients, forwarders.
func FormatValueList(name, value string, min int) string {
st, err := ParseOptionValue(name, value)
if err != nil {
return FormatValue(name, value)
}
items := st.Items[1:]
blocks := 0
var list *Block
for _, it := range items {
if it.Block != nil {
blocks++
list = it.Block
}
}
if blocks != 1 || len(list.Stmts) < min || blockHasBlocks(list) {
return FormatValue(name, value)
}
var sb strings.Builder
for _, it := range items {
if it.Block == nil {
sb.WriteString(Compact([]Item{it}) + " ")
continue
}
sb.WriteString("{\n")
for _, s := range list.Stmts {
sb.WriteString("\t" + Compact(s.Items) + ";\n")
}
sb.WriteString("} ")
}
return strings.TrimSpace(sb.String())
}