aboutsummaryrefslogtreecommitdiffstats
path: root/worker
diff options
context:
space:
mode:
Diffstat (limited to 'worker')
-rw-r--r--worker/imap/imap.go3
-rw-r--r--worker/lib/parse.go11
-rw-r--r--worker/lib/sort.go3
3 files changed, 3 insertions, 14 deletions
diff --git a/worker/imap/imap.go b/worker/imap/imap.go
index 7afab026..aa1854d6 100644
--- a/worker/imap/imap.go
+++ b/worker/imap/imap.go
@@ -64,8 +64,7 @@ func translateAddresses(addrs []*imap.Address) []*models.Address {
for _, addr := range addrs {
converted = append(converted, &models.Address{
Name: addr.PersonalName,
- Mailbox: addr.MailboxName,
- Host: addr.HostName,
+ Address: addr.Address(),
})
}
return converted
diff --git a/worker/lib/parse.go b/worker/lib/parse.go
index 58327c9b..b003d962 100644
--- a/worker/lib/parse.go
+++ b/worker/lib/parse.go
@@ -205,18 +205,9 @@ func parseAddressList(h *mail.Header, key string) ([]*models.Address, error) {
return nil, err
}
for _, addr := range addrs {
- parts := strings.Split(addr.Address, "@")
- var mbox, host string
- if len(parts) > 1 {
- mbox = strings.Join(parts[0:len(parts)-1], "@")
- host = parts[len(parts)-1]
- } else {
- mbox = addr.Address
- }
converted = append(converted, &models.Address{
Name: addr.Name,
- Mailbox: mbox,
- Host: host,
+ Address: addr.Address,
})
}
return converted, nil
diff --git a/worker/lib/sort.go b/worker/lib/sort.go
index ac8ed072..9d1f50a1 100644
--- a/worker/lib/sort.go
+++ b/worker/lib/sort.go
@@ -1,7 +1,6 @@
package lib
import (
- "fmt"
"sort"
"strings"
@@ -83,7 +82,7 @@ func sortAddresses(messageInfos []*models.MessageInfo, criterion *types.SortCrit
if addr.Name != "" {
return addr.Name
} else {
- return fmt.Sprintf("%s@%s", addr.Mailbox, addr.Host)
+ return addr.Address
}
}
return getName(firstI) < getName(firstJ)