Mail::SpamAssassin::Conf::Parser(3pm) | User Contributed Perl Documentation | Mail::SpamAssassin::Conf::Parser(3pm) |
Mail::SpamAssassin::Conf::Parser - parse SpamAssassin configuration
(see Mail::SpamAssassin)
Mail::SpamAssassin is a module to identify spam using text analysis and several internet-based realtime blocklists.
This class is used internally by SpamAssassin to parse its configuration files. Please refer to the "Mail::SpamAssassin" documentation for public interfaces.
This is the structure of a config-setting block. Each is a hashref which may contain these keys:
- $CONF_TYPE_NOARGS: must not have any argument, like "clear_headers" - $CONF_TYPE_STRING: string - $CONF_TYPE_NUMERIC: numeric value (float or int) - $CONF_TYPE_BOOL: boolean (0/no or 1/yes) - $CONF_TYPE_TEMPLATE: template, like "report" - $CONF_TYPE_ADDRLIST: list of mail addresses, like "welcomelist_from" - $CONF_TYPE_HASH_KEY_VALUE: hash key/value pair, like "describe" or tflags - $CONF_TYPE_STRINGLIST list of strings, stored as an array - $CONF_TYPE_IPADDRLIST list of IP addresses, stored as an array of SA::NetSet - $CONF_TYPE_DURATION a nonnegative time interval in seconds - a numeric value (float or int), optionally suffixed by a time unit (s, m, h, d, w), seconds are implied if unit is missing
If this is set, and a 'code' block does not already exist, a 'code' block is assigned based on the type.
In addition, the SpamAssassin test suite will validate that the settings do not 'leak' between users.
Note that $CONF_TYPE_HASH_KEY_VALUE-type settings require that the value be non-empty, otherwise they'll produce a warning message.
There are two special return values that the code subroutine may return to signal that there is an error in the configuration:
$Mail::SpamAssassin::Conf::MISSING_REQUIRED_VALUE -- this setting requires that a value be set, but one was not provided.
$Mail::SpamAssassin::Conf::INVALID_VALUE -- this setting requires a value from a set of 'valid' values, but the user provided an invalid one.
$Mail::SpamAssassin::Conf::INVALID_HEADER_FIELD_NAME -- this setting requires a syntactically valid header field name, but the user provided an invalid one.
Any other values -- including "undef" -- returned from the subroutine are considered to mean 'success'.
It is good practice to set a 'type', if possible, describing how your settings are stored on the Conf object; this allows the SpamAssassin test suite to validate that the settings do not 'leak' between users.
2024-04-12 | perl v5.38.2 |