Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#75259 - [opendkim] wrong default config path

Attached to Project: Community Packages
Opened by Dawid Potocki (dawidpotocki) - Wednesday, 06 July 2022, 14:23 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:04 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

By looking at opendkim.conf(5) we can notice that it is talking
about /usr/etc/opendkim.conf [1] which seems just wrong.

Arch's systemd service file has
ExecStart=/usr/bin/opendkim $OPENDKIM_FILTER
where $OPENDKIM_FILTER set by /etc/conf.d/opendkim
OPENDKIM_FILTER="-x /etc/opendkim/opendkim.conf"

This basically makes OpenDKIM change its config file location from the
default set at build-time to `/etc/opendkim/opendkim.conf`.
This is the location most people would expect to put their configs.

By just running
$ sudo opendkim
we will get this output:
opendkim: milter socket must be specified
(use "-?" for help)
but if we do
$ sudo mkdir /usr/etc
$ echo "blablabla" | sudo tee /usr/etc/opendkim.conf
$ sudo opendkim
we will get this output:
opendkim: /usr/etc/opendkim.conf: configuration error at line 1: unrecognized parameter

This means that OpenDKIM will read the config from this weird location
if we provide no flags and it will not read from the location that the
systemd service would. This leads to a very inconsistent mess.


Solution:

OpenDKIM's ./configure script has --sysconfdir so all we would need to
do to fix this is add it to the PKGBUILD like this:

./configure --prefix=/usr --sbindir=/usr/bin --sysconfdir="/etc/$pkgname" \
--with-db --with-odbx --with-sql-backend --with-openldap

(btw you also need to change git:// in the PKGBUILD to git+https://
cause GitHub disabled git:// [2])

So after rerunning
$ sudo opendkim
we will get again this output:
opendkim: milter socket must be specified
(use "-?" for help)
because the new config file /etc/opendkim/opendkim.conf doesn't exist.
If we create it like we did previously for the previous location
$ echo "blablabla" | sudo tee /etc/opendkim/opendkim.conf
$ sudo opendkim # this requires sudo because /etc/opendkim is 700 and we would get the previous message
we will get:
opendkim: /etc/opendkim/opendkim.conf: configuration error at line 1: unrecognized parameter
just like we expected.

I believe doing this could also allow us to remove /etc/conf.d/opendkim
and $OPENDKIM_FILTER from opendkim.service but I didn't test it.


[1]: https://man.archlinux.org/man/community/opendkim/opendkim.conf.5.en
[2]: https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:04 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/opendkim/issues/2

Loading...