node.js native language binding to libopendkim
git clone [email protected]:godsflaw/node-opendkim.git
cd node-opendkim
npm install
npm test -- --verbose
npm install --save node-opendkim
npm install --global node-opendkim
node-gyp rebuild
const OpenDKIM = require('node-opendkim');
try {
var opendkim = new OpenDKIM();
opendkim.verify({
id: undefined // optional (default: undefined)
});
// Adding one header at a time, when finished call opendkim.eoh()
var header = 'From: <[email protected]>';
opendkim.header({
header: header,
length: header.length
});
opendkim.eoh();
// Adding body chunks, when finished call opendkim.eom(). This too
// can take many chunks. Do NOT include the terminating DOT.
var body = 'this is a test';
opendkim.body({
body: body,
length: body.length
});
// This does the final validation, and will throw an error if there is one.
opendkim.eom();
} catch (err) {
console.log(err);
}
- OpenDKIM.new(): new instance of OpenDKIM object.
- opendkim.flush_cache(): Flush the key cache.
- opendkim.lib_feature(): Check for supported features.
- opendkim.header(): Process a header.
- opendkim.eoh(): Identify end of headers.
- opendkim.body(): Process a body chunk.
- opendkim.eom(): Identify end of message.
- opendkim.chunk(): Process a message chunk.
- opendkim.chunk_end(): called when done with chunk.
- opendkim.sign(): get ready to sign a message.
- opendkim.verify(): get ready to verify a message.
- opendkim.get_signature(): sets the signature info handle.
- opendkim.sig_getidentity(): get the identity from the signature handle.
- opendkim.sig_getdomain(): get the domain from the signature handle.
- opendkim.sig_getselector(): get the selector from the signature handle.
- opendkim.sig_geterror(): get the error value stored for a specific message.
- opendkim.query_info(): get/set query info.
- opendkim.query_method(): get/set query method.
- opendkim.tmpdir(): get/set tmp dir.
MIT © Christopher Mooney