dkim_options()

SYNOPSIS
#include <dkim.h>
DKIM_STAT dkim_options(
	DKIM_LIB *lib,
        int op,
        int opt,
        void *data,
        size_t len
);
Sets or retrieves options to alter the behaviour of certain aspects of the library's operation.
DESCRIPTION
Called When dkim_options() can be called at any time after acquiring a library handle from dkim_init().
ARGUMENTS
ArgumentDescription
dkim Library instance handle, returned by dkim_init.
op Either DKIM_OP_SETOPT to set a current library option, or DKIM_OP_GETOPT to retrieve a current library option.
opt One of the following macros, to indicate which library option should be retrieved or changed. Possible values:
Option NameDescription
DKIM_OPTS_FIXEDTIME data refers to a time_t which contains a fixed time specification to use during signature generation.
DKIM_OPTS_FLAGS data refers to an unsigned integer which contains a bitwise-OR of desired flags. See below for the list of known flags.
DKIM_OPTS_QUERYINFO data refers to a string in which query information is stored. See dkim_query_t for more information.
DKIM_OPTS_QUERYMETHOD data refers to a dkim_query_t containing a value which should override any q= value in signatures during verifications.
DKIM_OPTS_SENDERHDRS data refers to an ordered, NULL-terminated array of header names which should be searched when trying to determine the ultimate sender of the message. The default is to check Resent-Sender, Resent-From, Sender and From. The caller's list completely replaces this list. If data refers to a NULL pointer, the default is restored.
DKIM_OPTS_SIGNHDRS data refers to an unordered, NULL-terminated array of header names which are the ones that should be included when signing a message. Wildcarding using the asterisk ("*") character, meaning "match zero or more characters", is permitted. The From header is mandatory and thus implicitly added to any list provided by the caller. The constant default_signhdrs may be specified as the data, whicn contains Sender, Reply-To, Subject, Date, Message-ID, To, Cc, MIME-Version, Content-*, Resent-*, In-Reply-To, References and List-*. The default is to sign all headers. If data refers to a NULL pointer, the default is restored. Attempting DKIM_OP_GETOPT on this option returns an error as it is converted to regular expressions and not currently stored in a useable form.
DKIM_OPTS_SKIPHDRS data refers to an unordered, NULL-terminated array of header names which are the ones that should be skipped when processing a message for signing or verifying. The default is to skip no headers. Wildcarding using the asterisk ("*") character, meaning "match zero or more characters", is permitted. If data refers to a NULL pointer, the default is restored. Attempting DKIM_OP_GETOPT on this option returns an error as it is converted to regular expressions and not currently stored in a useable form.
DKIM_OPTS_TMPDIR data refers to a string which is the directory libdkim should use for creating temporary files.
DKIM_OPTS_TIMEOUT data refers to an unsigned integer indicating the timeout, in seconds, to be used when doing DNS queries to retrieve key and policy records.
DKIM_OPTS_VERSION data refers to an unsigned integer indicating the version of the specification that should be used for signing messages. See below for the list of versions.
data If the operation is DKIM_OP_GETOPT, this specifies the address to which to write the retrieved value. If the operation is DKIM_OP_SETOPT, this specifies the address from which to copy the new option value.
len Number of bytes available for reading/writing at data.
FLAGS When setting or retreiving library flags, the method is to specify a bitwise-OR of flag bits in an unsigned integer. The recognized flags are:
DKIM_LIBFLAGS_KEEPFILES Keep temporary files for manual debugging purposes. (Also requires that DKIM_LIBFLAGS_TMPFILES be set.)
DKIM_LIBFLAGS_SIGNLEN When signing messages, include in the signature the number of bytes that were canonicalized even when a length limit wasn't specified by the caller.
DKIM_LIBFLAGS_TMPFILES Make temporary files for debugging purposes. See dkim_reportinfo() for an example of how this might be useful.
VERSIONS When setting the version of the signing format to use, one of these values should be passed:
DKIM_VERSION_ALLMAN_BASE_00 draft-allman-dkim-base-00 Original specification. Supports "simple" and "nowsp" canonicalizations.
DKIM_VERSION_IETF_BASE_00 draft-ietf-dkim-base-00 First IETF-produced specification. Splits canonicalization so that header and body methods can be specified separately. Removes "nowsp" canonicalization, and adds "relaxed".
DKIM_VERSION_IETF_BASE_01 draft-ietf-dkim-base-01 (the default) Body hash now computed before header hash, and included in the signature header.
DKIM_VERSION_IETF_BASE_02 draft-ietf-dkim-base-02 Version now required in signatures.
DKIM_VERSION_IETF_BASE_10 draft-ietf-dkim-base-10 (default) Numerous updates including more strict version and timestamp checking.
NOTES
  • This function is a local addition to the formal API specification and is experimental only. It may not appear in other implementations.

Copyright (c) 2005-2007 Sendmail, Inc. and its suppliers. All rights reserved.
By using this file, you agree to the terms and conditions set forth in the LICENSE.