mirror of
https://github.com/axllent/mailpit.git
synced 2025-04-23 12:18:56 +02:00
Fix: Extract plus addresses from email addresses only, not names
This commit is contained in:
parent
cb34e1f561
commit
5166a761ec
@ -246,24 +246,24 @@ func findTagsInRawMessage(message *[]byte) string {
|
|||||||
func (d DBMailSummary) tagsFromPlusAddresses() string {
|
func (d DBMailSummary) tagsFromPlusAddresses() string {
|
||||||
tags := []string{}
|
tags := []string{}
|
||||||
for _, c := range d.To {
|
for _, c := range d.To {
|
||||||
matches := addressPlusRe.FindAllStringSubmatch(c.String(), 1)
|
matches := addressPlusRe.FindAllStringSubmatch(c.Address, 1)
|
||||||
if len(matches) == 1 {
|
if len(matches) == 1 {
|
||||||
tags = append(tags, strings.Split(matches[0][2], "+")...)
|
tags = append(tags, strings.Split(matches[0][2], "+")...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, c := range d.Cc {
|
for _, c := range d.Cc {
|
||||||
matches := addressPlusRe.FindAllStringSubmatch(c.String(), 1)
|
matches := addressPlusRe.FindAllStringSubmatch(c.Address, 1)
|
||||||
if len(matches) == 1 {
|
if len(matches) == 1 {
|
||||||
tags = append(tags, strings.Split(matches[0][2], "+")...)
|
tags = append(tags, strings.Split(matches[0][2], "+")...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, c := range d.Bcc {
|
for _, c := range d.Bcc {
|
||||||
matches := addressPlusRe.FindAllStringSubmatch(c.String(), 1)
|
matches := addressPlusRe.FindAllStringSubmatch(c.Address, 1)
|
||||||
if len(matches) == 1 {
|
if len(matches) == 1 {
|
||||||
tags = append(tags, strings.Split(matches[0][2], "+")...)
|
tags = append(tags, strings.Split(matches[0][2], "+")...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
matches := addressPlusRe.FindAllStringSubmatch(d.From.String(), 1)
|
matches := addressPlusRe.FindAllStringSubmatch(d.From.Address, 1)
|
||||||
if len(matches) == 1 {
|
if len(matches) == 1 {
|
||||||
tags = append(tags, strings.Split(matches[0][2], "+")...)
|
tags = append(tags, strings.Split(matches[0][2], "+")...)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user