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 9 forks source link

- Fix listening to IP address (8cdc4c6 broke this, leading to error [0])... #18

Closed grembo closed 6 years ago

grembo commented 6 years ago

...by making sure $(relay)socket is only defined if passed.

[0] Could not determine port number from host [*]:unix at line 78 in file /usr/local/lib/perl5/site_perl/Net/Server/Proto.pm

grembo commented 6 years ago

New version requires File::HomeDir to get user dir in a platform independent way, added --setsid option to toggle if setsid should be used (defaults to off as in previous versions)

mpaperno commented 6 years ago

Thanks for the fixes!

I'm a bit torn on this PR as it really should probably be done in separate commits (or 3). The fixes are top priority of course.

--setsid is new option so that shouldn't have any regression issues. :+1:

I'm not entirely sure on SA's user_dir. I do seem to remember that it was omitted for a reason (or was redundant)... I could be wrong and in any case it was a long time (many versions) ago. I'm not even sure if this changes default behavior... what does SA default user_dir to if not specifically passed (but username is)?

SA docs say...

user_dir A directory to use as a 'home directory' for the current user's data, overriding the system default.

Isn't File::HomeDir just getting the system default also (I'm guessing)?

mpaperno commented 6 years ago

P.S. Or perhaps I'm misinterpreting what SA docs mean by "system default?" I thought that would mean username passed to SA, but maybe not?

grembo commented 6 years ago

It doesn't seem to be that simple.

The origin of this patch was here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=88901

Looking at SpamAssassin.pm it does various things, based on ~, HOME and configuration:

@default_userprefs_path = ( '~/.spamassassin/user_prefs', );

@default_userstate_dir = ( '~/.spamassassin', );

If user_dir is set, it's used to override those locations in get_and_set_userstate_dir. Then there's also expand_name later, which uses user_dir or $HOME (and kind of replicates what File::HomeDir does). user_state_dir is also overridden, so this could only be relevant to user_prefs (maybe)?

So to be honest, I'm not sure if this makes any difference or not.

grembo commented 6 years ago

As this isn't entirely clear, I removed userdir for the time being. I'll leave it in the FreeBSD port, to avoid breakage there too. This will allow you to tag the release and me to open a PR for the port. Thanks!

mpaperno commented 6 years ago

Great, thanks!

New release pushed.