Bug 259226

Summary: mail/spampd: Fails to start after 2.61 upgrade: "Global symbol "$user" requires explicit package name
Product: Ports & Packages Reporter: bugs.freebsd.org <bugs.freebsd.org>
Component: Individual Port(s)Assignee: Dag-Erling Smørgrav <des>
Status: Closed FIXED    
Severity: Affects Only Me CC: daniel, des, mail
Priority: --- Keywords: needs-patch
Version: LatestFlags: koobs: maintainer-feedback? (des)
koobs: merge-quarterly?
Hardware: amd64   
OS: Any   
See Also: https://github.com/mpaperno/spampd/issues/38
Attachments:
Description Flags
proposed patch none

Description bugs.freebsd.org@deadzone.dk 2021-10-17 12:04:00 UTC
I upgraded my version of SpamPD from 2.53 to 2.61 and then it fails during startup.
It fails with "Global symbol "$user" requires explicit package name (did you forget to declare "my $user"?)"
I have discussed this with mpaperno on github.

https://github.com/mpaperno/spampd/issues/38

This line is in the FreeBSD ports version
 473: user_dir => (getpwnam($user))[7],
But not in the github version.

Right now i'm running with the github version, the only change i have made is to the shebang in the first line.

This change does not seem to be necessary.
Comment 1 mail 2022-01-27 23:47:37 UTC
(In reply to bugs.freebsd.org@deadzone.dk from comment #0)

Same here, just did the same upgrade and encountered the same error.

user_dir is not used in /usr/local/sbin/spampd itself so I deleted the line (473) after which the daemon started fine (looks to function as desired as well)

I didn't investigate whether or not user_dir is passed along to another object/class somewhere so  bugs.freebsd.org@deadzone.dk 's workaround might be better
Comment 2 Daniel Morante 2022-02-22 07:04:58 UTC
Created attachment 232003 [details]
proposed patch

Ran into this myself so I fixed the port to remove the patch file that is no longer needed. Currently using this new revision on my systems, no issues detected (so far).

Build was tested with Poudriere
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-02-24 15:10:30 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a455f124cf1c04c35142f2f9b51d4cefab9adfd3

commit a455f124cf1c04c35142f2f9b51d4cefab9adfd3
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2022-02-24 15:07:55 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2022-02-24 15:07:55 +0000

    mail/spampd: drop user_dir patch and maintainership

    PR:             259226

 mail/spampd/Makefile                     |  3 ++-
 mail/spampd/files/patch-spampd.pl (gone) | 10 ----------
 2 files changed, 2 insertions(+), 11 deletions(-)