Closed ikedas closed 1 year ago
Note that, with Linux, Go 1.16 or later is required, as earlier releases haven't implemented syscall.Set[ug]id()
.
Sorry, I would rather not have this in the library:
I understand. I'll withdraw this PR.
BTW I'm planning another PR adding netutil.LimitListener()
to avoid congestion. Should I also forgo this?
As a rule of thumb, if net/http
doesn't do it, go-smtp probably shouldn't do it either. Library users can easily drop privileges or use a LimitListener
if they want to.
I see. @emersion , thank you for advice. This PR is withdrawn.
On many systems listening well-known ports needs root privileges. This PR allows the server to drop privileges if it can listen on the port. Also, this allows to set the mode of the UNIX domain socket file.
The new fields
Username
,Groupname
andSocketMode
are introduced tosmtp.Server
.This PR may conflict with PR #212.