From a5df5c30b62aae0b2f9d54e6f40fab76999c565b Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Sun, 12 Feb 2023 01:27:28 +0100 Subject: templates: fix mboxes function mboxes currently returns the same value that emails. The SplitN API is misleading, to actually split something, the N value must be greater than 1... Fixes: d758441fe0c4 ("templates: add more fields and functions") Signed-off-by: Robin Jarry Acked-by: Moritz Poldrack --- lib/templates/functions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/templates/functions.go') diff --git a/lib/templates/functions.go b/lib/templates/functions.go index 37b014f5..ec11c1c7 100644 --- a/lib/templates/functions.go +++ b/lib/templates/functions.go @@ -145,7 +145,7 @@ func emails(addresses []*mail.Address) []string { func mboxes(addresses []*mail.Address) []string { e := make([]string, len(addresses)) for i, addr := range addresses { - parts := strings.SplitN(addr.Address, "@", 1) + parts := strings.SplitN(addr.Address, "@", 2) e[i] = parts[0] } return e -- cgit