Bug 276606 - mail/mailman3: there should be a default mailman.cfg
Summary: mail/mailman3: there should be a default mailman.cfg
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Zsolt Udvari
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-25 12:58 UTC by Ekkehard 'Ekki' Gehm
Modified: 2024-06-20 11:32 UTC (History)
4 users (show)

See Also:
einar: maintainer-feedback+


Attachments
Install mailman config file (1.14 KB, patch)
2024-01-29 09:24 UTC, Einar Bjarni Halldórsson
einar: maintainer-approval+
Details | Diff
Add sample config file for mailman3 (2.02 KB, patch)
2024-05-21 09:18 UTC, Einar Bjarni Halldórsson
einar: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ekkehard 'Ekki' Gehm 2024-01-25 12:58:39 UTC
Post msg says:
To initialise Mailman's runtime directories, log files and database
for the first time, run

  service mailman info

You can then start Mailman by running:

  service mailman start



service mailman info than fails with:
$ sudo service mailman oneinfo
Usage: mailman [OPTIONS] COMMAND [ARGS]...
Try 'mailman -h' for help.

Error: Invalid value for '-C' / '--config': File '/usr/local/mailman/etc/mailman.cfg' does not exist.
Comment 1 Ekkehard 'Ekki' Gehm 2024-01-25 13:15:27 UTC
There should be a default mailman.cfg in named directory.

During install, the mailman.cfg gets a patch in the [path.fhs] section. How ever: The default layout is "home".

Also the default MTA is postfix. I would suggest to change that to sendmail for FreeBSD.
Comment 2 Einar Bjarni Halldórsson 2024-01-26 08:53:37 UTC
(In reply to Ekkehard 'Ekki' Gehm from comment #1)

Thanks for pointing that out.

I was thinking of just installing mailman.cfg.sample in %%PREFIX%%/${name}/etc and updating the install message to document that you need to copy the sample config and update it.

The config file comes from upstream, so I would patch it to change the MTA, but since we use postfix in production, I might need some testing to see if the default config is badly wrong.
Comment 3 Ekkehard 'Ekki' Gehm 2024-01-26 14:26:44 UTC
I will try to fix that. 

Mailman would create a default conf. Unfortunately not when started with -C.

I installed mailman3 successfully by hand in a venv last week (without that rust huge rust thing). 

I am a bit time limited right now but will try to write a patch if you want....
Comment 4 Einar Bjarni Halldórsson 2024-01-26 15:27:04 UTC
(In reply to Ekkehard 'Ekki' Gehm from comment #3)

I'm like 80% done with my patch, so I should be able to complete it over the weekend
Comment 5 Einar Bjarni Halldórsson 2024-01-29 09:24:41 UTC
Created attachment 248054 [details]
Install mailman config file

Install a default mailman config file
Comment 6 Einar Bjarni Halldórsson 2024-01-31 09:32:36 UTC
(In reply to Ekkehard 'Ekki' Gehm from comment #1)

My current patch copies the default config to the right path, but it does not change from the default MTA.

Mailman 3 does not include a class for sendmail.

I'm open to a patch that fixes the default mailman.cfg to work with sendmail MTA, or add more details in the INSTALL message.

If this is good for now, I'll nudge a committer to take a look and commit.
Comment 7 Fernando Apesteguía freebsd_committer freebsd_triage 2024-04-03 07:00:25 UTC
(In reply to Einar Bjarni Halldórsson from comment #6)
I think you can use ${ETCDIR} directly for the destination path. It defaults to 
${PREFIX}/etc/${PORTNAME}
Comment 8 Einar Bjarni Halldórsson 2024-04-17 09:08:58 UTC
(In reply to Fernando Apesteguía from comment #7)

But the destination path isn't ${PREFIX}/etc/${PORTNAME}.
mailman3 places files and dirs under ${PREFIX}/${PORTNAME}, so /usr/local/mailman by default and the default config file path is /usr/local/mailman/etc/mailman.cfg
Comment 9 Zsolt Udvari freebsd_committer freebsd_triage 2024-05-20 20:20:02 UTC
Please check your changes with "portlint", "portfmt -D Makefile" and "portclippy Makefile" (ports-mgmt/portlint and ports-mgmt/portfmt ports).
And should bump PORTREVISION too.
Comment 10 Einar Bjarni Halldórsson 2024-05-21 09:18:13 UTC
Created attachment 250850 [details]
Add sample config file for mailman3

Fixed syntax errors reported by portlint and portfmt.
Builds with poudriere on 13.2-RELEASE
Comment 11 Zsolt Udvari freebsd_committer freebsd_triage 2024-06-08 18:51:42 UTC
Thanks.
Now noticed you want install a file /usr/local/mailman/etc. Is it possible install to /usr/local/etc/mailman/? Would be better.

Did you notice PR 254135 and 250362? Let's put those in order first.
Comment 12 Einar Bjarni Halldórsson 2024-06-08 20:18:49 UTC
(In reply to Zsolt Udvari from comment #11)

I've commented on PR 254135 and 250362.

250362 was already fixed and has been closed.
254135 has been partly fixed, but what is left is a duplicate of this issue (default/sample config file missing).

Regarding the path to the config file, the directory layout was put in place by previous maintainer/initial committer, and it places all files under /usr/local/mailman.

I'd like to get this patch committed, and we can create a new PR regarding fixing the directory layout if you want.
Comment 13 Zsolt Udvari freebsd_committer freebsd_triage 2024-06-19 18:09:06 UTC
(In reply to Einar Bjarni Halldórsson from comment #12)
Sorry for late.
I installed py311-mailman but there is no /usr/local/mailman/etc. I think only the rc-script is wrong (see https://cgit.freebsd.org/ports/tree/mail/mailman3/files/mailman.in#n23).
Could you please overwrite your mailman rc-script (mailman/etc/ to etc/mailman/), move your configuration file to /usr/local/etc/mailman/ (from /usr/local/mailman/etc) and check? If it works IMHO only this modification is needed.
Comment 14 Einar Bjarni Halldórsson 2024-06-20 09:46:42 UTC
(In reply to Zsolt Udvari from comment #13)

> I installed py311-mailman but there is no /usr/local/mailman/etc. I think only the rc-script is wrong (see https://cgit.freebsd.org/ports/tree/mail/mailman3/files/mailman.in#n23).

That's the point with this ticket, that there is no sample config installed by the package, and no etc directory created.

Whether that directory is /usr/local/mailman/etc or /usr/local/etc/mailman doesn't matter, we need this patch to actually install the sample config.
Comment 15 Zsolt Udvari freebsd_committer freebsd_triage 2024-06-20 11:32:50 UTC
(In reply to Einar Bjarni Halldórsson from comment #14)
Agree. But we respect the FHS too so the sample config should be in PREFIX/etc/mailman/.