4 releases

0.0.4 Apr 13, 2024
0.0.3 Mar 8, 2024
0.0.2 Feb 3, 2024
0.0.1 Jan 3, 2024

#39 in Email

Download history 1/week @ 2023-12-31 5/week @ 2024-01-28 1/week @ 2024-02-04 19/week @ 2024-02-18 12/week @ 2024-02-25 132/week @ 2024-03-03 26/week @ 2024-03-10 1/week @ 2024-03-17 56/week @ 2024-03-31 1/week @ 2024-04-07

61 downloads per month

GPL-3.0-or-later

97KB
2K SLoC

dkimdo

🚧 🚧 🚧

under construction

πŸ— πŸ— πŸ—



dkimdo is a command-line tool for DKIM. Its purpose is to help with common DKIM operations: key generation and key handling, and signing and verifying email messages. DKIM, DomainKeys Identified Mail, is specified in RFC 6376.

Internally, dkimdo is based on the viadkim library.

Installation

The dkimdo command-line tool is a Rust program; install it with Cargo as usual.

For example, use the following command to install the latest version published on crates.io:

cargo install --locked dkimdo

The minimum supported Rust version is 1.71.1.

Usage

Once installed, the dkimdo program can be invoked on the command-line as dkimdo, followed by a command name.

For key handling the following commands are available:

  • dkimdo genkey generates a new signing key and the corresponding DKIM public key record
  • dkimdo keyinfo displays information about an existing local signing key
  • dkimdo query displays information about a DKIM public key record in DNS

For signing and verifying the following commands are available:

  • dkimdo sign signs an email message with a DKIM signature
  • dkimdo verify verifies the DKIM signatures in an email message

All dkimdo commands come with extensive configuration options. See dkimdo help <command> for usage information.

For details, refer to the included manual page dkimdo(1). (You can view the manual page without installing by passing the file path to man: man ./dkimdo.1)

Examples

Generate Ed25519 signing key and DKIM public key record, and print to stdout and stderr:

dkimdo genkey ed25519

Generate 2048-bit RSA signing key:

dkimdo genkey rsa

Generate 1024-bit RSA signing key:

dkimdo genkey --bits 1024 rsa

Generate RSA signing key and store in file key.pem, and also store DKIM public key record in file record.txt:

dkimdo genkey rsa >key.pem 2>record.txt

Generate RSA signing key in file key.pem with permissions 0600:

dkimdo genkey --out-file key.pem rsa

Query DNS for DKIM public key record at default._domainkey.example.com:

dkimdo query example.com default

Query for DKIM public key and check if it corresponds to signing key key.pem:

dkimdo query example.com default key.pem

Sign message msg.eml for domain example.com with selector default, using key key.pem for the signature:

dkimdo sign example.com default key.pem < msg.eml

Verify signatures in message msg.eml:

dkimdo verify < msg.eml

Sign message msg.eml and then verify the resulting message.

dkimdo sign example.com default key.pem < msg.eml | dkimdo verify

Licence

Copyright Β© 2024 David BΓΌrgin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Dependencies

~13–25MB
~371K SLoC