Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

dkim-signer

0.2.2 • Public • Published

DKIM Signer

Sign RFC822 messages with DKIM. This module is extracted from mailcomposer.

Usage

// require signer function
var DKIMSign = require("dkim-signer").DKIMSign;
 
// generate a RFC822 message
var rfc822message = "Subject: test\r\n\r\nHello world";
 
// setup DKIM options
var dkimOptions = {
    domainName: "müriaad-polüteism.info",
    keySelector: "dkim",
    privateKey: require("fs").readFileSync("./test_private.pem")
};
 
// generate signature header field
var signature = DKIMSign(rfc822message, dkimOptions);
 
// join signature header field with the message
console.log(signature + "\r\n" + rfc822message);

License

MIT

Install

npm i dkim-signer

DownloadsWeekly Downloads

108,512

Version

0.2.2

License

MIT

Last publish

Collaborators

  • avatar