nodemailer-hashcash
v1.0.0
Published
Add hashcash headers for Nodemailer messages
Readme
hashcash plugin for Nodemailer
This plugin adds hashcash headers for the Nodemailer generated e-mail messages.
NB! Generating hashcash values with JavaScript might be very slow (might take even 10s of seconds for a 20 bit hashcash value) and every recipient requires its own unique X-Hashcash header, so do not use this for messages with a large list of recipients.
Install
Install from npm
npm install nodemailer-hashcash --saveUsage
1. Load the hashcash function
var hashcash = require('nodemailer-hashcash');2. Attach it as a 'compile' handler for a nodemailer transport object
nodemailerTransport.use('compile', hashcash(options));Where
- options - is an optional options argument with the following values:
- bits - (defaults to 20) how many bits to calculate
Example
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport();
transporter.use('compile', hashcash());
transporter.sendMail({
from: '[email protected]',
to: '[email protected]',
…
});License
MIT
