dkimpy
Node.js wrapper around the Python pip package dkimpy exposing DKIM and ARC signing and verification functions
Table of Contents
Requirements
-
Ensure that you have a Python version of >= 3.5 installed per dkimpy requirements (note that Python v3 is required because of a bug with DNS recursive CNAME lookups on v2.7):
python3 --version -
Install the package dkimpy and authres (
authres
is optional and used for ARC):pip3 install dkimpy authres
Install
npm:
npm install dkimpy
yarn:
yarn add dkimpy
Usage
dkimVerify
const fs = ; const dkimVerify = ; const message = fs; // then/catch usage ; // async/await usageasync { try const result = await console; catch err console; };
The value of result
is a Boolean which indicates if DKIM verification was successful for the first DKIM-Signature
header found on the email.
You can pass a second argument of index
(defaults to 0
, which means it looks for the first DKIM-Signature found).
arcVerify
const fs = ; const arcVerify = ; const message = fs; // then/catch usage ; // async/await usageasync { try const result = await console; catch err console; };
The value of result
is an enumerable String which is one of:
"none"
indicates it does not have an ARC signature"pass"
indicates its ARC signature was verified successfully"fail"
indicates it had an ARC signature and it failed verification
arcSign
const fs = ; const arcSign = ; const message = fs;const selector = 'default'; // default._domainkeyconst domain = 'example.com';const srvId = 'mx.example.com';const privateKeyFile = '/path/to/private.key'; // then/catch usage ; // async/await usageasync { try const result = await console; catch err console; };
The value of result
is a String with the new ARC headers to add to the top of the message (if any).
Contributors
Name | Website |
---|---|
Nick Baugh | http://niftylettuce.com/ |