mirror of
https://github.com/decke/smtprelay.git
synced 2026-04-25 12:55:54 +03:00
[GH-ISSUE #10] Errors returned by smtpd.Server.ListenAndServe() are ignored #4
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/smtprelay#4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JonathonReinhart on GitHub (Feb 15, 2021).
Original GitHub issue: https://github.com/decke/smtprelay/issues/10
Problem
Any errors returned by
ListenAndServe()are ignored.For example, trying to run as an unprivileged user:
The server runs and looks like it is listening, but it is is not (because binding to port 25 is a privileged operation). This is confirmed by looking at
lsof -p $(pidof smtprelay)orss -tnlp.Cause
The cause is simple:
ListenAndServe()is invoked as a goroutine and the return value is lost.@decke commented on GitHub (Feb 16, 2021):
Thanks for the fix!