čtvrtek 27. listopadu 2025

Fixing OpenDKIM Signing After Upgrading Ubuntu 18.04 LTS → 24.04 LTS

 (prispevek zformuloval GPT chatbot na zaklade mych velmi strucnych poznamek)

After a long-planned upgrade from Ubuntu 18 LTS straight to Ubuntu 24 LTS, I discovered that outgoing e-mail was no longer being signed with OpenDKIM. What followed was a small adventure involving masked services, silent failures, and a missing package. Here is the full story for anyone who runs into the same issue.

1. First symptoms: DKIM signing stopped working

Right after the upgrade, outgoing mail lost its DKIM signatures.
A look into /var/log/mail.log showed a clear clue:

postfix/smtpd[153304]: warning: connect to Milter service inet:localhost:8892: Connection refused

Port 8892, where OpenDKIM normally listens, was not responding:

# ss -tuln | grep 8892 (no output)

So the DKIM milter was simply not running.

2. Trying to start OpenDKIM — and finding it masked

My next step was obvious: check the service.

# systemctl start opendkim Failed to start opendkim.service: Unit opendkim.service is masked.

Status confirmed it:

# systemctl status opendkim opendkim.service Loaded: masked (Reason: Unit opendkim.service is masked.) Active: inactive (dead)

Why the upgrade masked the service is unclear, but unmasking is straightforward:

# systemctl unmask opendkim # systemctl start opendkim

This time the service started—at least according to systemd.
But DKIM signatures were still missing.

3. Adding debug logging

To see what was going on, I enabled more verbose logging by adding to /etc/opendkim.conf:

SyslogSuccess yes LogWhy yes

After that:

# systemctl restart opendkim

The service looked healthy, no visible errors... but still no signs of DKIM signing.

4. The surprising discovery: OpenDKIM wasn’t installed (!?)

Running locate gave the final hint:

# locate opendkim opendkim:

It essentially returned nothing.
At this point it became clear: the service files were present, but the actual OpenDKIM binary was not installed (a side effect of the distribution jump).

A quick explicit install solved everything:

# apt install opendkim

And — voilà — DKIM signing immediately started working again.

5. Conclusion

Upgrading directly from Ubuntu 18 → 24 can leave some services in a strange state. In my case:

  • opendkim.service was masked after the upgrade

  • The service files survived, but the binary package was missing

  • Postfix failed to talk to the milter (Connection refused)

  • Installing OpenDKIM manually restored full functionality

Žádné komentáře:

Okomentovat