mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-25 08:56:02 +03:00
[GH-ISSUE #2768] DKIM key refresh issues #1699
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#1699
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @olaf7 on GitHub (Jan 29, 2023).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/2768
OS: Debian 11 Bullseye (stable)
Manual old (various) upgrades of Modoboa. Currently on version 2.0.3
Database: MariaDB
DKIM keys generated using Modoboa. I expected a path in the database like in (screenshot):
https://github.com/modoboa/modoboa/issues/2208#issuecomment-817108156
However only the name of the PEM file shows. No paths. Keys are stored in: /srv/modoboa/env/instance
A bit messy. Expected location on Debian would have been: /etc/dkimkeys
DKIM keys have been added to DNS.
DKIM signing does not work properly:
The Debian bug report suggested that the cause might be a corrupt key so I regenerated for 1 domain a DKIM key using the old(!) admin interface. I can let the admin panel show the key, so it seems ok, but ...
I decided to restart the opendkim service which failed. It turned out to be that:
@olaf7 commented on GitHub (Jan 29, 2023):
manually running: python manage.py modo manage_dkim_keys
fixed the empty field and refreshed/renewed the file in /srv/modoboa/env/instance
However I still think this is troublesome as in the meantime opendkim can not be restarted (or the server).
Also remains that the PEM files have no path in the DB, the storage location of the files is weird and the signing issues are still there.
The GUI says: SMTP Error: [451] 4.7.0 resource unavailable
But the logfile is more interesting and descriptive.
@tonioo commented on GitHub (Feb 1, 2023):
@olaf7 You should check why the command you ran manually was not called earlier. It is supposed to be run periodically as a cron task (look at /etc/cron.d/modoboa file)
And about keys location, that's something you can configure through the web interface.
@olaf7 commented on GitHub (Feb 17, 2023):
@tonioo , my comment on the restart failure issue is about that there is a time gap between key modification in the DB and the execution of the cron job. In that gap restart will fail. A solution would be if a mutation in the admin panel would result in immediately calling the code from the panel instead of waiting for the cronjob.
It turns out I have multiple issues getting DKIM to work. Here is my feedback on the issue addressed in this ticket:
In my Modoboa installation the DKIM key path was not defined. This results in storage of PEM files in the root of the Modoboa installation (in my case a virtual env owned by user Modoboa) owned by the user running Modoboa (username modoboa in my case). But also in a registry in the database of the filename without a path. This is troublesome by default: postfix will have no idea where to find the PEM files and produces SMTP errors. Maybe Modoboa would warn/error on not valid values for the key-path and incomplete path/filename field entries?
Related to this is that the desired location should be writable by the systemuser running Modoboa where as OpenDKIM wants more restrictive rights and ownership. I do not see how to work around that without manual intervention as sudo will not do the trick:
I manually intervened and copied files to /etc/dkimkeys, did set rights and ownership correctly. Next I added full path to the PEM filename in the database.
Result: