$linuxjunkies
>

opendkim(8)

OpenDKIM is a milter-based implementation of DKIM (DomainKeys Identified Mail) signing and verification for sendmail and other mail transfer agents.

UbuntuDebianFedoraArch

Synopsis

opendkim [OPTIONS]

Description

OpenDKIM is a cryptographic authentication system that allows mail senders to prove ownership of a message by signing it with a private key, while recipients verify the signature using a public key published in DNS. It integrates with MTAs like sendmail and Postfix via the milter protocol to sign outgoing mail and verify incoming mail.

The daemon reads its configuration from /etc/opendkim.conf and manages DKIM signing based on domain policies, key management, and signature verification rules. It runs as a background service listening on a socket for connections from the MTA.

Common options

FlagWhat it does
-c FILEConfiguration file path (default: /etc/opendkim.conf)
-d DOMAINSpecify domain to sign for (overrides configuration)
-lOperate in local mode, do not fork to background
-p SOCKETMilter socket to listen on (e.g., inet:[email protected])
-P PIDFILEWrite process ID to specified file
-tTest configuration and exit without running daemon
-u USERIDRun daemon as specified user (default: opendkim)
-vVerbose logging to syslog
-xSign all mail (ignore From: header domain restrictions)

Examples

Start OpenDKIM daemon listening on localhost port 8891, running as opendkim user

opendkim -c /etc/opendkim.conf -p inet:[email protected] -u opendkim

Test the configuration file for syntax errors without starting the daemon

opendkim -t -c /etc/opendkim.conf

Run OpenDKIM in foreground with verbose logging for debugging

opendkim -l -v -c /etc/opendkim.conf

Start the OpenDKIM service and enable it for automatic startup

systemctl start opendkim && systemctl enable opendkim

Check recent DKIM signing/verification messages in mail log

grep -i dkim /var/log/maillog | tail -20

Generate DKIM keypair for example.com domain (separate utility)

opendkim-genkey -D /etc/opendkim/keys/example.com -d example.com -s default

Related commands