aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/email/parser.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2025-07-02 17:38:27 +0200
committerAleksandr Nogikh <nogikh@google.com>2025-07-03 09:04:38 +0000
commit39f27708bb399ebd3ba5d8c9558d4bc4bfdcf7a0 (patch)
tree9900a34314c58c36ba0292f66cd5463ff0d16bda /pkg/email/parser.go
parent2d7f57714b3b95f27c3159f02b33e17b816f7178 (diff)
dashboard: forward emails from designated inboxes
For some specified inboxes, forward the emails that contain syz commands. Add tests to verify the behavior.
Diffstat (limited to 'pkg/email/parser.go')
-rw-r--r--pkg/email/parser.go6
1 files changed, 5 insertions, 1 deletions
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()