Lines Matching full:email

4 package email  package
21 type Email struct { struct
39 func Parse(r io.Reader, ownEmails []string) (*Email, error) {
42 return nil, fmt.Errorf("failed to read email: %v", err)
46 return nil, fmt.Errorf("failed to parse email header 'From': %v", err)
49 return nil, fmt.Errorf("failed to parse email header 'To': no senders")
58 for _, email := range ownEmails {
59 ownAddrs[email] = true
60 if addr, err := mail.ParseAddress(email); err == nil {
107 email := &Email{
119 return email, nil
122 // AddAddrContext embeds context into local part of the provided email address using '+'.
123 // Returns the resulting email address.
124 func AddAddrContext(email, context string) (string, error) { argument
125 addr, err := mail.ParseAddress(email)
127 return "", fmt.Errorf("failed to parse %q as email: %v", email, err)
131 return "", fmt.Errorf("failed to parse %q as email: no @", email)
141 // RemoveAddrContext extracts context after '+' from the local part of the provided email address.
143 func RemoveAddrContext(email string) (string, string, error) {
144 addr, err := mail.ParseAddress(email)
146 return "", "", fmt.Errorf("failed to parse %q as email: %v", email, err)
150 return "", "", fmt.Errorf("failed to parse %q as email: no @", email)
154 return email, "", nil
161 func CanonicalEmail(email string) string {
162 addr, err := mail.ParseAddress(email)
164 return email
168 return email
176 // extractCommand extracts command to syzbot from email body.
199 // Some email clients split text emails at 80 columns are the transformation is irrevesible.
251 // git-send-email sends emails without Content-Type, let's assume it's text.
258 return nil, nil, fmt.Errorf("failed to parse email header 'Content-Type': %v", err)
271 return nil, nil, fmt.Errorf("failed to read email body: %v", err)
278 return nil, nil, fmt.Errorf("failed to read email body: %v", err)
307 // MergeEmailLists merges several email lists removing duplicates and invalid entries.
315 for _, email := range list {
316 addr, err := mail.ParseAddress(email)