aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-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()