From 96e3e5e33e975c1fc2b39aed1ab9d3492f104e6f Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Sun, 31 Mar 2024 15:30:24 +0200 Subject: [PATCH] make staticcheck happy i don't think it's actually better, but it is helpful to keep the code base free of staticcheck findings. --- smtpserver/server.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/smtpserver/server.go b/smtpserver/server.go index ecd3c52..3c9cd4c 100644 --- a/smtpserver/server.go +++ b/smtpserver/server.go @@ -1687,22 +1687,18 @@ func (c *conn) isSMTPUTF8Required(part *message.Part) bool { return false } - // Check "MAIL FROM" + // Check "MAIL FROM". if hasNonASCII(strings.NewReader(string(c.mailFrom.Localpart))) { return true } - // Check all "RCPT TO" + // Check all "RCPT TO". for _, rcpt := range c.recipients { if hasNonASCII(strings.NewReader(string(rcpt.rcptTo.Localpart))) { return true } } - // Check header in all message parts - if hasNonASCIIPartHeader(part) { - return true - } - - return false + // Check header in all message parts. + return hasNonASCIIPartHeader(part) } // ../rfc/5321:1992 ../rfc/5321:1098