@@ -13,7 +13,7 @@ import (
13
13
)
14
14
15
15
var (
16
- addressPlusRe = regexp .MustCompile (`^(.*){1,}\+(.*)@` )
16
+ addressPlusRe = regexp .MustCompile (`(?U) ^(.*){1,}\+(.*)@` )
17
17
)
18
18
19
19
// SetMessageTags will set the tags for a given database ID
@@ -246,25 +246,25 @@ func (d DBMailSummary) tagsFromPlusAddresses() string {
246
246
tags := []string {}
247
247
for _ , c := range d .To {
248
248
matches := addressPlusRe .FindAllStringSubmatch (c .String (), 1 )
249
- if len (matches ) == 1 && config . ValidTagRegexp . MatchString ( matches [ 0 ][ 2 ]) {
250
- tags = append (tags , matches [0 ][2 ])
249
+ if len (matches ) == 1 {
250
+ tags = append (tags , strings . Split ( matches [0 ][2 ], "+" ) ... )
251
251
}
252
252
}
253
253
for _ , c := range d .Cc {
254
254
matches := addressPlusRe .FindAllStringSubmatch (c .String (), 1 )
255
- if len (matches ) == 1 && config . ValidTagRegexp . MatchString ( matches [ 0 ][ 2 ]) {
256
- tags = append (tags , matches [0 ][2 ])
255
+ if len (matches ) == 1 {
256
+ tags = append (tags , strings . Split ( matches [0 ][2 ], "+" ) ... )
257
257
}
258
258
}
259
259
for _ , c := range d .Bcc {
260
260
matches := addressPlusRe .FindAllStringSubmatch (c .String (), 1 )
261
- if len (matches ) == 1 && config . ValidTagRegexp . MatchString ( matches [ 0 ][ 2 ]) {
262
- tags = append (tags , matches [0 ][2 ])
261
+ if len (matches ) == 1 {
262
+ tags = append (tags , strings . Split ( matches [0 ][2 ], "+" ) ... )
263
263
}
264
264
}
265
265
matches := addressPlusRe .FindAllStringSubmatch (d .From .String (), 1 )
266
- if len (matches ) == 1 && config . ValidTagRegexp . MatchString ( matches [ 0 ][ 2 ]) {
267
- tags = append (tags , matches [0 ][2 ])
266
+ if len (matches ) == 1 {
267
+ tags = append (tags , strings . Split ( matches [0 ][2 ], "+" ) ... )
268
268
}
269
269
270
270
return strings .Join (tags , "," )
0 commit comments