You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
James
3e397a6f66
|
3 months ago | |
---|---|---|
LICENSE | 4 years ago | |
README.md | 6 months ago | |
context.go | 3 months ago | |
example_smtpd_test.go | 3 months ago | |
go.mod | 3 months ago | |
go.sum | 3 months ago | |
smtd.go | 3 months ago | |
smtp.go | 3 months ago |
README.md
smtpd
smtp server
使用者需实现SmtpServerConfigure
接口
type SmtpServerConfigure interface {
GetConfig() *lib.ServerConfig
func (this *SmtpConf) Auth(username string, password string) string
func TakeOff(email *smtpd.Mail)
}
准备妥当后只需构建一个 smtpd 实例并监听即可
smtpServer := smtpd.New(&SmtpConf {})
ln, err := smtpd.Socket(":10025")
if nil != err {
log.Println(err)
}
smtpServer.Listen(ln)