DEV Community

Discussion on: Email Authentication

Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

I created a script for managing DKIM keys on Linux, and I've been using it in prod for about a year now. For me, it's been quite helpful for generating and rotating keys.

CodeMouse92 / dkim_manage

A script to automate most tasks associated with OpenDKIM key rotation.

OpenDKIM Manager

A script to automate most tasks associated with OpenDKIM key rotation.

Credits

  • Written by Jason C. McDonald (@CodeMouse92) for MousePaw Media.
  • Perl code written by Kerin Millar (@kerframil).
  • Additional feedback by Dorian Harmans (@woohooyeah).

Setup

System Requirements

OpenDKIM is designed to work in the Linux BASH (not SH) with minimal dependencies. It works with OpenDKIM, and therefore depends on that being installed on the system. The script also uses Perl for one regex-replacement task.

Installing

We recommend that the dkim_manage file be placed in a dedicated scripts folder, such as /opt/scripts/root_scripts Place dkim_manage into the directory in question, and then change its owner and permissions:

$ chown root:root dkim_manage
$ chmod +x dkim_manage

Next, create a new file in that same folder called domains.conf. (See our example in domains.conf.example) In that file, list each of the domains that OpenDKIM is signing for, one per…

Collapse
 
damcosset profile image
Damien Cosset

Will check it out!