mpaperno / spampd

SpamPD - Spam Proxy Daemon. A spam-filtering SMTP/LMTP proxy server using SpamAssassin in Perl. Since 2002.
GNU General Public License v3.0
34 stars 10 forks source link

Unix ports #12

Closed Kritzefitz closed 7 years ago

Kritzefitz commented 7 years ago

Adds the ability to listen on and relay to UNIX sockets. They can be used by setting --port or --relayport to the path of the socket suffixed by '|unix' .

This fixes #11

mpaperno commented 7 years ago

Hello @Kritzefitz, thanks for the PR.

Assuming this all works (I have no way to test it right now), my only concern/question is whether "overloading" the port/relayport parameters is really appropriate here. Perhaps it would be better to create new params for the socket address(es)? I think it could avoid some confusion and make cleaner code. What do you think?

Kritzefitz commented 7 years ago

I can totally understand you concerns. I mostly overloaded the port option for this, because it was easier than introducing new options and Net::Server conveniently already takes UNIX sockets through the port option.

While the current solution works in simple development tests, I noticed (unfortunately after writing this PR) that my solution doesn't allow creating the socket with a specific owner and permissions, which makes it unsuitable for production environments. Unfortunately the Net::Server's documentation isn't overly verbose regarding UNIX sockets, so I don't know if it supports creating them with specific permissions.

So overall I think the current PR should not be merged (yet).

Kritzefitz commented 7 years ago

I'll close this for now and re-open when I got my changes in a usable state.