From 39f27708bb399ebd3ba5d8c9558d4bc4bfdcf7a0 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Wed, 2 Jul 2025 17:38:27 +0200 Subject: dashboard: forward emails from designated inboxes For some specified inboxes, forward the emails that contain syz commands. Add tests to verify the behavior. --- pkg/email/parser.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg/email/parser.go') diff --git a/pkg/email/parser.go b/pkg/email/parser.go index b748d02c3..9e629ad05 100644 --- a/pkg/email/parser.go +++ b/pkg/email/parser.go @@ -204,7 +204,11 @@ func AddAddrContext(email, context string) (string, error) { if at == -1 { return "", fmt.Errorf("failed to parse %q as email: no @", email) } - result := addr.Address[:at] + "+" + context + addr.Address[at:] + result := addr.Address[:at] + if context != "" { + result += "+" + context + } + result += addr.Address[at:] if addr.Name != "" { addr.Address = result result = addr.String() -- cgit mrf-deployment