// EmailFromKey returns the email for this key
172838
func (g *GPG) EmailFromKey(ctx context.Context, id string) string {
	ent := g.findEntity(id)
	if ent == nil || ent.Identities == nil {
		return ""
	}
	for name, id := range ent.Identities {
		if id.UserId == nil {
			return name
		}
		return id.UserId.Email
	}
	return ""
}
279375
func Email() string {
	var email string

	email = getRandValue([]string{"person", "first"}) + getRandValue([]string{"person", "last"})
	email += "@"
	email += getRandValue([]string{"person", "last"}) + "." + getRandValue([]string{"internet", "domain_suffix"})

	return strings.ToLower(email)
}
242980
func KeysFromFile(name string) (string, string, error) {
	file, err := os.Open(name)
	if err != nil {
		return "", "", err
	}
	defer file.Close()

	var secret, access string
	_, err = fmt.Fscan(file, &secret, &access)
	return secret, access, err
}
678721
func (c *Client) Emails(url *url.URL) (emails *EmailsService) {
	emails = &EmailsService{client: c, URL: url}
	return
}
835132
func (db UserDB) GetByEmail(email string) (u *models.User, ok bool) {
	u, ok = db.emails[email]
	return
}
816752
func (s *DeliverabilityTestReport) SetFromEmailAddress(v string) *DeliverabilityTestReport {
	s.FromEmailAddress = &v
	return s
}
1136195
func (s *MailFromAttributes) SetMailFromDomain(v string) *MailFromAttributes {
	s.MailFromDomain = &v
	return s
}
261142
func (s *PutEmailIdentityMailFromAttributesInput) SetMailFromDomain(v string) *PutEmailIdentityMailFromAttributesInput {
	s.MailFromDomain = &v
	return s
}
1328219
func (r *ValidationResult) Key(key string) *ValidationResult {
	if r.Error != nil {
		r.Error.Key = key
	}
	return r
}
428002
func (u *User) Emails() (interface{}, error) {
	urlStr := GetApiBaseURL() + "/user/emails"
	return u.c.execute("GET", urlStr, "")
}
722239
func (s *SourceImportAuthor) GetEmail() string {
	if s == nil || s.Email == nil {
		return ""
	}
	return *s.Email
}
1344528
func (s *DomainsService) GetEmailForward(accountID string, domainIdentifier string, forwardID int64) (*emailForwardResponse, error) {
	path := versioned(emailForwardPath(accountID, domainIdentifier, forwardID))
	forwardResponse := &emailForwardResponse{}

	resp, err := s.client.get(path, forwardResponse)
	if err != nil {
		return nil, err
	}

	forwardResponse.HttpResponse = resp
	return forwardResponse, nil
}
859247
func (n *Node) KiteFromKey() (*protocol.Kite, error) {
	// TODO replace "kites" with KitesPrefix constant
	fields := strings.Split(strings.TrimPrefix(n.Node.Key, "/"), "/")
	if len(fields) != 8 || (len(fields) > 0 && fields[0] != "kites") {
		return nil, fmt.Errorf("kontrol: invalid kite %s", n.Node.Key)
	}

	return &protocol.Kite{
		Username:    fields[1],
		Environment: fields[2],
		Name:        fields[3],
		Version:     fields[4],
		Region:      fields[5],
		Hostname:    fields[6],
		ID:          fields[7],
	}, nil
}
106483
func (w *WebHookAuthor) GetEmail() string {
	if w == nil || w.Email == nil {
		return ""
	}
	return *w.Email
}
262273
func (s *CreateDeliverabilityTestReportInput) SetFromEmailAddress(v string) *CreateDeliverabilityTestReportInput {
	s.FromEmailAddress = &v
	return s
}
807675
func KeyFrom(fields []string, doc Document) Key {
	key := make(Key, 0, len(fields))
	for _, f := range fields {
		if s, ok := doc[f].(String); ok {
			key = append(key, string(s))
		}
	}
	return key
}
1236227
func (service *Service) EmailValidation(w http.ResponseWriter, request *http.Request) {

	service.handleEmailValidation(w, request, false)
}