diff --git a/_examples/dkim-proxy/main.go b/_examples/dkim-proxy/main.go index 5e33132..ed2673d 100644 --- a/_examples/dkim-proxy/main.go +++ b/_examples/dkim-proxy/main.go @@ -4,7 +4,6 @@ package main import ( "bytes" "flag" - "io/ioutil" "log" "net/smtp" @@ -60,7 +59,7 @@ func main() { log.Fatalf("DKIM configuration error: %v", err) } - privKey, err = ioutil.ReadFile(*privKeyFile) + privKey, err = io.ReadFile(*privKeyFile) if err != nil { log.Fatalf("Couldn't read private key: %v", err) } diff --git a/envelope.go b/envelope.go index 0fa4fe1..32f4661 100644 --- a/envelope.go +++ b/envelope.go @@ -20,7 +20,6 @@ func (env *Envelope) AddReceivedLine(peer Peer) { tlsDetails := "" tlsVersions := map[uint16]string{ - tls.VersionSSL30: "SSL3.0", tls.VersionTLS10: "TLS1.0", tls.VersionTLS11: "TLS1.1", tls.VersionTLS12: "TLS1.2", diff --git a/example_test.go b/example_test.go index a61241e..2eb172a 100644 --- a/example_test.go +++ b/example_test.go @@ -5,7 +5,7 @@ import ( "net/smtp" "strings" - "github.com/chrj/smtpd" + "git.jmbit.de/jmb/smtpd" ) func ExampleServer() { diff --git a/go.mod b/go.mod index a883ba1..69293f1 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/chrj/smtpd +module git.jmbit.de/jmb/smtpd -go 1.14 +go 1.24 diff --git a/protocol.go b/protocol.go index a047f02..13fbdb0 100644 --- a/protocol.go +++ b/protocol.go @@ -7,7 +7,6 @@ import ( "encoding/base64" "fmt" "io" - "io/ioutil" "net" "net/textproto" "strconv" @@ -288,6 +287,7 @@ func (session *session) handleRCPT(cmd command) { } func (session *session) handleSTARTTLS(cmd command) { + _ = cmd if session.tls { session.reply(502, "Already running in TLS") @@ -334,6 +334,7 @@ func (session *session) handleSTARTTLS(cmd command) { } func (session *session) handleDATA(cmd command) { + _ = cmd if session.envelope == nil || len(session.envelope.Recipients) == 0 { session.reply(502, "Missing RCPT TO command.") @@ -371,7 +372,7 @@ func (session *session) handleDATA(cmd command) { } // Discard the rest and report an error. - _, err = io.Copy(ioutil.Discard, reader) + _, err = io.Copy(io.Discard, reader) if err != nil { // Network error, ignore @@ -390,17 +391,20 @@ func (session *session) handleDATA(cmd command) { } func (session *session) handleRSET(cmd command) { + _ = cmd session.reset() session.reply(250, "Go ahead") return } func (session *session) handleNOOP(cmd command) { + _ = cmd session.reply(250, "Go ahead") return } func (session *session) handleQUIT(cmd command) { + _ = cmd session.reply(221, "OK, bye") session.close() return diff --git a/smtpd.go b/smtpd.go index 852ff30..e60e2a1 100644 --- a/smtpd.go +++ b/smtpd.go @@ -190,7 +190,7 @@ func (srv *Server) Serve(l net.Listener) error { default: } - if ne, ok := e.(net.Error); ok && ne.Temporary() { + if ne, ok := e.(net.Error); ok && ne.Timeout() { time.Sleep(time.Second) continue } diff --git a/smtpd_test.go b/smtpd_test.go index 3f8488a..ad6c251 100644 --- a/smtpd_test.go +++ b/smtpd_test.go @@ -14,7 +14,7 @@ import ( "testing" "time" - "github.com/chrj/smtpd" + "git.jmbit.de/jmb/smtpd" ) var localhostCert = []byte(`-----BEGIN CERTIFICATE-----