Forge Home


A module to manage OpenDKIM


6,856 latest version

4.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.0.1 (latest)
released Nov 3rd 2016
This version is compatible with:

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'rjpearce-opendkim', '0.0.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add rjpearce-opendkim
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install rjpearce-opendkim --version 0.0.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Tags: opendkim


rjpearce/opendkim — version 0.0.1 Nov 3rd 2016



Puppet module to manage OpenDKIM

Currently only supports Debian/Ubuntu, fork me to support more distributions.

  • opendkim : Main class to install, enable and setup default configuration.
  • opendkim::config : Class to setup OpenDKIM main configuration files.
  • opendkim::socket : Definition to add a new Socket to the /etc/default/opendkim config file.
  • opendkim::domain : Definition to add a new Domain to the /etc/opendkim.conf config file.

Setup your DKIM keys:

openssl genrsa -out 1024
openssl rsa -in -out -pubout -outform PEM
Move the private key file into your own puppet module

Add your public key to a new TXT record in DNS.

Choose a Selector for your public key, eg. 'mail'
Create a TXT record for your domain: => v=DKIM1; k=rsa; p=[THE_CONTENT_OF_THE_PUBLIC_KEY_FILE]

Typical usage:

include 'opendkim'

opendkim::socket { 'listen on loopback on port 8891 - Ubuntu default':
  interface => 'localhost';
opendkim::domain { '':
  private_key_source => 'puppet:///modules/mymodule/',

Configuration options for adding a Socket to OpenDKIM:

  opendkim::socket { 'listen on loopback on port 8891 - Ubuntu default':
    interface => 'localhost';

  opendkim::socket { 'listen on a port 8000':
    type      => 'inet',
    interface => '',
    port      => '8000';

  opendkim::socket { 'listen on a local file socket':
    type => 'file',

  opendkim::socket { 'listen on a local file socket with a custom name':
    type => 'file',
    file => '/var/run/opendkim/my_custom_name.sock';

Configuration options for adding a Domain to OpenDKIM:

opendkim::domain { '':
  private_key_source => 'puppet:///modules/mymodule/',

opendkim::domain { 'example with custom key folder, selector and domain name':
  domain             => '
  private_key_source => 'puppet:///modules/mymodule/',
  selector           => 'duck',
  key_folder         => '/etc/duck';