Example #1
0
func (e *env) AddRecipient(rcpt smtpd.MailAddress) error {
	if strings.HasPrefix(rcpt.Email(), "[email protected]") {
		return errors.New("we don't send email to [email protected]")
	}
	e.msg.To[localcount] = rcpt.Email()
	localcount++
	return e.BasicEnvelope.AddRecipient(rcpt)
}
Example #2
0
func (e *env) AddRecipient(rcpt smtpd.MailAddress) error {
	if strings.HasPrefix(rcpt.Email(), "[email protected]") {
		return errors.New("we don't send email to [email protected]")
	}
	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)
}
Example #3
0
File: smtp.go Project: nihao/tsuru
func (e *fakeEnvelope) AddRecipient(rcpt smtpd.MailAddress) error {
	e.m.To = append(e.m.To, rcpt.Email())
	return nil
}
Example #4
0
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
}
Example #5
0
func onNewMail(c smtpd.Connection, from smtpd.MailAddress) (smtpd.Envelope, error) {
	myMessage.From = from.Email()
	return &env{new(smtpd.BasicEnvelope), myMessage}, nil
}
Example #6
0
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
}
Example #7
0
func (e *Envelope) AddRecipient(rcpt smtpd.MailAddress) error {
	e.msg.To = append(e.msg.To, rcpt.Email())
	return e.BasicEnvelope.AddRecipient(rcpt)
}
Example #8
0
func (e *envelope) AddRecipient(rcpt smtpd.MailAddress) error {
	if strings.HasPrefix(rcpt.Email(), "[email protected]") {
		return errors.New("we don't send email to [email protected]")
	}
	return e.BasicEnvelope.AddRecipient(rcpt)
}