Skip to content

opendkim.lib_feature()

Christopher Mooney edited this page Oct 27, 2017 · 1 revision

DESCRIPTION

Check if the underlying library supports a specific feature.

For more information:
http://www.opendkim.org/libopendkim/dkim_libfeature.html

ARGUMENTS

Type: String

  • The feature to check for.

RETURN VALUES

  • A boolean indicating if the specific feature is available.

NOTES

Features that can be checked:

String passed to function Description
DKIM_FEATURE_DIFFHEADERS Underlying code required to provide the dkim_diffheaders() facility.
DKIM_FEATURE_PARSE_TIME Underlying code required to provide the dkim_get_msgdate() facility.
DKIM_FEATURE_QUERY_CACHE Underlying code required to do local caching of DNS replies (i.e., key records).
DKIM_FEATURE_SHA256 Underlying code required to do SHA256 hashing when signing or verifying.
DKIM_FEATURE_DNSSEC Underlying code required to conduct DNSSEC evaluation of replies.
DKIM_FEATURE_OVERSIGN Capability to "over-sign" header fields to prevent later addition of signed fields.
  • lib_feature() is a wrapper around lib_feature_obj() which takes an object.
    • Calling lib_feature_obj():
opendkim.lib_feature_obj({
  feature: 'DKIM_FEATURE_DNSSEC'
});

EXAMPLE

try {
  var opendkim = new OpenDKIM();
  
  if (opendkim.lib_feature('DKIM_FEATURE_DIFFHEADERS')) {
    console.log('We have diff headers!');
  } else {
    console.log('Aww, no diff headers. :(');
  }
} catch (err) {
  console.log(err);
}