Denote end-of-message for a message. When verifying, process signatures in order; when signing, compute all signatures. opendkim.eom()
is called after the entire body of the message has been passed to the API via zero or more calls to opendkim.body()
.
For more information: http://www.opendkim.org/libopendkim/dkim_eom.html
Type: undefined
- Returns opendkim object
- If passed
{testkey: true}
, returns a bool indicating if the key is a test key - On failure, an exception is thrown that indicates the cause of the problem.
- By default, when verifying, this function processes all signatures, in order. If the
DKIM_LIBFLAGS_VERIFYONE
flag is set on the library, then processing will stop after one good signature is found. There may be other signatures before or after that one in the message whose evaluation might be meaningful to the calling application. In that case, the calling application should use the final handling callback (seeopendkim.set_final()
to get an opportunity to process all of the signatures and possibly reorder them as per the application's preference. With the above flag set, this function will use the signatures as reordered by that function (or in arrival order if no reordering is done) and act on the first valid one, or the first one if none are valid.
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: <herp@derp.com>';
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);
}