about summary refs log tree commit diff stats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/models.go33
1 files changed, 5 insertions, 28 deletions
diff --git a/models/models.go b/models/models.go
index a93db72..bfe0ff3 100644
--- a/models/models.go
+++ b/models/models.go
@@ -3,9 +3,6 @@ package models
 import (
 	"fmt"
 	"io"
-	gomail "net/mail"
-	"regexp"
-	"strings"
 	"time"
 
 	"github.com/emersion/go-message/mail"
@@ -127,34 +124,14 @@ func (bs *BodyStructure) PartAtIndex(index []int) (*BodyStructure, error) {
 type Envelope struct {
 	Date      time.Time
 	Subject   string
-	From      []*Address
-	ReplyTo   []*Address
-	To        []*Address
-	Cc        []*Address
-	Bcc       []*Address
+	From      []*mail.Address
+	ReplyTo   []*mail.Address
+	To        []*mail.Address
+	Cc        []*mail.Address
+	Bcc       []*mail.Address
 	MessageId string
 }
 
-type Address gomail.Address
-
-var atom *regexp.Regexp = regexp.MustCompile("^[a-z0-9!#$%7'*+-/=?^_`{}|~ ]+$")
-
-// String formats the address. If the address's name
-// contains non-ASCII characters it will be quoted but not encoded.
-// Meant for display purposes to the humans, not for sending over the wire.
-func (a *Address) Format() string {
-	if a.Name != "" {
-		if atom.MatchString(a.Name) {
-			return fmt.Sprintf("%s <%s>", a.Name, a.Address)
-		} else {
-			return fmt.Sprintf("\"%s\" <%s>",
-				strings.ReplaceAll(a.Name, "\"", "'"), a.Address)
-		}
-	} else {
-		return fmt.Sprintf("<%s>", a.Address)
-	}
-}
-
 // OriginalMail is helper struct used for reply/forward
 type OriginalMail struct {
 	Date     time.Time
be12410 ^
c5ffb6e1 ^
d44123ca ^
90560d71 ^
c5ffb6e1 ^













76755b28 ^




c5ffb6e1 ^
90560d71 ^
c5ffb6e1 ^
83fcebf3 ^
c5ffb6e1 ^







76755b28 ^




c5ffb6e1 ^
90560d71 ^
c5ffb6e1 ^






76755b28 ^

90560d71 ^
76755b28 ^

9542bb11 ^

76755b28 ^

9542bb11 ^

76755b28 ^



c5ffb6e1 ^
















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100