Exemple #1
0
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)
}
Exemple #2
0
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)
}
Exemple #3
0
func (e *fakeEnvelope) AddRecipient(rcpt smtpd.MailAddress) error {
	e.m.To = append(e.m.To, rcpt.Email())
	return nil
}
Exemple #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
}
Exemple #5
0
func onNewMail(c smtpd.Connection, from smtpd.MailAddress) (smtpd.Envelope, error) {
	myMessage.From = from.Email()
	return &env{new(smtpd.BasicEnvelope), myMessage}, nil
}
Exemple #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
}
Exemple #7
0
func (e *Envelope) AddRecipient(rcpt smtpd.MailAddress) error {
	e.msg.To = append(e.msg.To, rcpt.Email())
	return e.BasicEnvelope.AddRecipient(rcpt)
}
Exemple #8
0
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)
}