func (e *env) AddRecipient(rcpt smtpd.MailAddress) error { if strings.HasPrefix(rcpt.Email(), "bad@") { return errors.New("we don't send email to bad@") } e.msg.To[localcount] = rcpt.Email() localcount++ return e.BasicEnvelope.AddRecipient(rcpt) }
func (e *env) AddRecipient(rcpt smtpd.MailAddress) error { if strings.HasPrefix(rcpt.Email(), "bad@") { return errors.New("we don't send email to bad@") } fmt.Println("Typeof to list", reflect.TypeOf(e.msg.To)) e.msg.To = append(e.msg.To, rcpt.Email()) fmt.Println(e.msg.To) // e.msg.To[localcount] = rcpt.Email() // localcount++ return e.BasicEnvelope.AddRecipient(rcpt) }
func (e *fakeEnvelope) AddRecipient(rcpt smtpd.MailAddress) error { e.m.To = append(e.m.To, rcpt.Email()) return nil }
func onNewMail(c smtpd.Connection, from smtpd.MailAddress) (smtpd.Envelope, error) { log.Printf("New mail received from %q", from) myMessage.From = from.Email() return &Envelope{new(smtpd.BasicEnvelope), myMessage}, nil }
func onNewMail(c smtpd.Connection, from smtpd.MailAddress) (smtpd.Envelope, error) { myMessage.From = from.Email() return &env{new(smtpd.BasicEnvelope), myMessage}, nil }
func (s *server) onNewMail(conn smtpd.Connection, from smtpd.MailAddress) (smtpd.Envelope, error) { log.Printf("smtp: new mail from %s", from.Email()) return &env{s: s, from: webfist.NewEmailAddr(from.Email())}, nil }
func (e *Envelope) AddRecipient(rcpt smtpd.MailAddress) error { e.msg.To = append(e.msg.To, rcpt.Email()) return e.BasicEnvelope.AddRecipient(rcpt) }
func (e *envelope) AddRecipient(rcpt smtpd.MailAddress) error { if strings.HasPrefix(rcpt.Email(), "bad@") { return errors.New("we don't send email to bad@") } return e.BasicEnvelope.AddRecipient(rcpt) }