Skip to content

Instantly share code, notes, and snippets.

@desttinghim
Last active January 10, 2018 22:11
Show Gist options
  • Save desttinghim/e92f4435042a9f0580427e72440a8614 to your computer and use it in GitHub Desktop.
Save desttinghim/e92f4435042a9f0580427e72440a8614 to your computer and use it in GitHub Desktop.

DESCRIPTION

This call retrieves the contents of the z= tag in the signature. This must be called after opendkim.get_signature.

ARGUMENTS

Type: undefined

RETURN VALUES

  • throws an error if
    • The function was called before opendkim.get_signature()
  • returns an array of the headers in the z= tag

NOTES

  • If there is no z= tag, an empty array is returned.

EXAMPLE

try {
  var opendkim = new OpenDKIM();

  opendkim.verify({id: undefined});
  opendkim.chunk({
    message: message,
    length: message.length
  });
  opendkim.chunk_end();
  opendkim.get_signature();
  var zheaders = opendkim.ohdrs();
  for (var i = 0; i < zheaders.length; i++) {
    console.log(zheaders[i]);
  }
} catch (err) {
  console.log(err);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment