Handle empty e-mail addresses. Implemented MaxRecipients check. Announce PIPELINING support. Corrected error code on Too Busy error. Implemented DataTimeout for timeouts on DATA. Use textproto.DotReader in handleDATA to implement dot-stuffing. Reset deadlines on old socket in STARTTLS, add new deadlines to new TLS socket.
19 lines
347 B
Go
19 lines
347 B
Go
package smtpd
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
func parseAddress(src string) (string, error) {
|
|
|
|
if src[0] != '<' || src[len(src)-1] != '>' {
|
|
return "", fmt.Errorf("Ill-formatted e-mail address: %s", src)
|
|
}
|
|
|
|
if strings.Count(src, "@") > 1 {
|
|
return "", fmt.Errorf("Ill-formatted e-mail address: %s", src)
|
|
}
|
|
|
|
return src[1 : len(src)-1], nil
|
|
}
|