From 4448eba28a568bbc1f3d29fca70b0099b3e6edae Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Tue, 1 Apr 2025 22:52:38 +0800 Subject: LMTP: Fix error scoping --- lmtp_server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lmtp_server.go b/lmtp_server.go index f16149d..889ed31 100644 --- a/lmtp_server.go +++ b/lmtp_server.go @@ -127,7 +127,8 @@ func (session *lmtpSession) Data(r io.Reader) error { continue } localPart := to[:len(to)-len("@"+config.LMTP.Domain)] - segments, err := pathToSegments(localPart) + var segments []string + segments, err = pathToSegments(localPart) if err != nil { // TODO: Should the entire email fail or should we just // notify them out of band? @@ -159,7 +160,7 @@ func (session *lmtpSession) Data(r io.Reader) error { goto end } default: - err = fmt.Errorf("Emailing any endpoint other than repositories, is not supported yet.") // TODO + err = errors.New("Emailing any endpoint other than repositories, is not supported yet.") // TODO goto end } } -- cgit v1.2.3