From 20ec2c8eeb2e071f28358814935a0f56672a9f49 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Tue, 10 Nov 2020 20:27:30 +0100 Subject: compose: use a proper header instead of a string map Prior to this commit, the composer was based on a map[string]string. While this approach was very versatile, it lead to a constant encoding / decoding of addresses and other headers. This commit switches to a different model, where the composer is based on a header. Commands which want to interact with it can simply set some defaults they would like to have. Users can overwrite them however they like. In order to get access to the functions generating / getting the msgid go-message was upgraded. --- config/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config/config.go') diff --git a/config/config.go b/config/config.go index 87d183a..51982d2 100644 --- a/config/config.go +++ b/config/config.go @@ -413,8 +413,10 @@ func (config *AercConfig) LoadConfig(file *ini.File) error { if key == "template-dirs" { continue } + // we want to fail during startup if the templates are not ok + // hence we do a dummy execute here _, err := templates.ParseTemplateFromFile( - val, config.Templates.TemplateDirs, templates.TestTemplateData()) + val, config.Templates.TemplateDirs, templates.DummyData()) if err != nil { return err } -- cgit 1.4.1-2-gfad0