Server IP : 103.119.228.120 / Your IP : 18.221.59.121 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/share/man/man3/ |
Upload File : |
.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Mail::SpamAssassin::Conf 3" .TH Mail::SpamAssassin::Conf 3 "2015-04-29" "perl v5.16.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Mail::SpamAssassin::Conf \- SpamAssassin configuration file .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& # a comment \& \& rewrite_header Subject *****SPAM***** \& \& full PARA_A_2_C_OF_1618 /Paragraph .a.{0,10}2.{0,10}C. of S. 1618/i \& describe PARA_A_2_C_OF_1618 Claims compliance with senate bill 1618 \& \& header FROM_HAS_MIXED_NUMS From =~ /\ed+[a\-z]+\ed+\eS*@/i \& describe FROM_HAS_MIXED_NUMS From: contains numbers mixed in with letters \& \& score A_HREF_TO_REMOVE 2.0 \& \& lang es describe FROM_FORGED_HOTMAIL Forzado From: simula ser de hotmail.com \& \& lang pt_BR report O programa detetor de Spam ZOE [...] .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" SpamAssassin is configured using traditional UNIX-style configuration files, loaded from the \f(CW\*(C`/usr/share/spamassassin\*(C'\fR and \f(CW\*(C`/etc/mail/spamassassin\*(C'\fR directories. .PP The following web page lists the most important configuration settings used to configure SpamAssassin; novices are encouraged to read it first: .PP .Vb 1 \& http://wiki.apache.org/spamassassin/ImportantInitialConfigItems .Ve .SH "FILE FORMAT" .IX Header "FILE FORMAT" The \f(CW\*(C`#\*(C'\fR character starts a comment, which continues until end of line. \&\fB\s-1NOTE:\s0\fR if the \f(CW\*(C`#\*(C'\fR character is to be used as part of a rule or configuration option, it must be escaped with a backslash. i.e.: \f(CW\*(C`\e#\*(C'\fR .PP Whitespace in the files is not significant, but please note that starting a line with whitespace is deprecated, as we reserve its use for multi-line rule definitions, at some point in the future. .PP Currently, each rule or configuration setting must fit on one-line; multi-line settings are not supported yet. .PP File and directory paths can use \f(CW\*(C`~\*(C'\fR to refer to the user's home directory, but no other shell-style path extensions such as globing or \&\f(CW\*(C`~user/\*(C'\fR are supported. .PP Where appropriate below, default values are listed in parentheses. .SH "USER PREFERENCES" .IX Header "USER PREFERENCES" The following options can be used in both site-wide (\f(CW\*(C`local.cf\*(C'\fR) and user-specific (\f(CW\*(C`user_prefs\*(C'\fR) configuration files to customize how SpamAssassin handles incoming email messages. .SS "\s-1SCORING OPTIONS\s0" .IX Subsection "SCORING OPTIONS" .IP "required_score n.nn (default: 5)" 4 .IX Item "required_score n.nn (default: 5)" Set the score required before a mail is considered spam. \f(CW\*(C`n.nn\*(C'\fR can be an integer or a real number. 5.0 is the default setting, and is quite aggressive; it would be suitable for a single-user setup, but if you're an \s-1ISP\s0 installing SpamAssassin, you should probably set the default to be more conservative, like 8.0 or 10.0. It is not recommended to automatically delete or discard messages marked as spam, as your users \fBwill\fR complain, but if you choose to do so, only delete messages with an exceptionally high score such as 15.0 or higher. This option was previously known as \f(CW\*(C`required_hits\*(C'\fR and that name is still accepted, but is deprecated. .IP "score \s-1SYMBOLIC_TEST_NAME\s0 n.nn [ n.nn n.nn n.nn ]" 4 .IX Item "score SYMBOLIC_TEST_NAME n.nn [ n.nn n.nn n.nn ]" Assign scores (the number of points for a hit) to a given test. Scores can be positive or negative real numbers or integers. \&\f(CW\*(C`SYMBOLIC_TEST_NAME\*(C'\fR is the symbolic name used by SpamAssassin for that test; for example, '\s-1FROM_ENDS_IN_NUMS\s0'. .Sp If only one valid score is listed, then that score is always used for a test. .Sp If four valid scores are listed, then the score that is used depends on how SpamAssassin is being used. The first score is used when both Bayes and network tests are disabled (score set 0). The second score is used when Bayes is disabled, but network tests are enabled (score set 1). The third score is used when Bayes is enabled and network tests are disabled (score set 2). The fourth score is used when Bayes is enabled and network tests are enabled (score set 3). .Sp Setting a rule's score to 0 will disable that rule from running. .Sp If any of the score values are surrounded by parenthesis '()', then all of the scores in the line are considered to be relative to the already set score. ie: '(3)' means increase the score for this rule by 3 points in all score sets. '(3) (0) (3) (0)' means increase the score for this rule by 3 in score sets 0 and 2 only. .Sp If no score is given for a test by the end of the configuration, a default score is assigned: a score of 1.0 is used for all tests, except those whose names begin with 'T_' (this is used to indicate a rule in testing) which receive 0.01. .Sp Note that test names which begin with '_\|_' are indirect rules used to compose meta-match rules and can also act as prerequisites to other rules. They are not scored or listed in the 'tests hit' reports, but assigning a score of 0 to an indirect rule will disable it from running. .SS "\s-1WHITELIST AND BLACKLIST OPTIONS\s0" .IX Subsection "WHITELIST AND BLACKLIST OPTIONS" .IP "whitelist_from user@example.com" 4 .IX Item "whitelist_from user@example.com" Used to whitelist sender addresses which send mail that is often tagged (incorrectly) as spam. .Sp Use of this setting is not recommended, since it blindly trusts the message, which is routinely and easily forged by spammers and phish senders. The recommended solution is to instead use \f(CW\*(C`whitelist_auth\*(C'\fR or other authenticated whitelisting methods, or \f(CW\*(C`whitelist_from_rcvd\*(C'\fR. .Sp Whitelist and blacklist addresses are now file-glob-style patterns, so \&\f(CW\*(C`friend@somewhere.com\*(C'\fR, \f(CW\*(C`*@isp.com\*(C'\fR, or \f(CW\*(C`*.domain.net\*(C'\fR will all work. Specifically, \f(CW\*(C`*\*(C'\fR and \f(CW\*(C`?\*(C'\fR are allowed, but all other metacharacters are not. Regular expressions are not used for security reasons. Matching is case-insensitive. .Sp Multiple addresses per line, separated by spaces, is \s-1OK. \s0 Multiple \&\f(CW\*(C`whitelist_from\*(C'\fR lines are also \s-1OK.\s0 .Sp The headers checked for whitelist addresses are as follows: if \f(CW\*(C`Resent\-From\*(C'\fR is set, use that; otherwise check all addresses taken from the following set of headers: .Sp .Vb 4 \& Envelope\-Sender \& Resent\-Sender \& X\-Envelope\-From \& From .Ve .Sp In addition, the \*(L"envelope sender\*(R" data, taken from the \s-1SMTP\s0 envelope data where this is available, is looked up. See \f(CW\*(C`envelope_sender_header\*(C'\fR. .Sp e.g. .Sp .Vb 2 \& whitelist_from joe@example.com fred@example.com \& whitelist_from *@example.com .Ve .IP "unwhitelist_from user@example.com" 4 .IX Item "unwhitelist_from user@example.com" Used to override a default whitelist_from entry, so for example a distribution whitelist_from can be overridden in a local.cf file, or an individual user can override a whitelist_from entry in their own \f(CW\*(C`user_prefs\*(C'\fR file. The specified email address has to match exactly (although case-insensitively) the address previously used in a whitelist_from line, which implies that a wildcard only matches literally the same wildcard (not 'any' address). .Sp e.g. .Sp .Vb 2 \& unwhitelist_from joe@example.com fred@example.com \& unwhitelist_from *@example.com .Ve .IP "whitelist_from_rcvd addr@lists.sourceforge.net sourceforge.net" 4 .IX Item "whitelist_from_rcvd addr@lists.sourceforge.net sourceforge.net" Works similarly to whitelist_from, except that in addition to matching a sender address, a relay's rDNS name or its \s-1IP\s0 address must match too for the whitelisting rule to fire. The first parameter is a sender's e\-mail address to whitelist, and the second is a string to match the relay's rDNS, or its \s-1IP\s0 address. Matching is case-insensitive. .Sp This second parameter is matched against the TCP-info information field as provided in a \s-1FROM\s0 clause of a trace information (i.e. the Received header field, see \s-1RFC 5321\s0). Only the Received header fields inserted by trusted hosts are considered. This parameter can either be a full hostname, or the domain component of that hostname, or an \s-1IP\s0 address in square brackets. The reverse \s-1DNS\s0 lookup is done by a \s-1MTA,\s0 not by SpamAssassin. .Sp In case of an IPv4 address in brackets, it may be truncated on classful boundaries to cover whole subnets, e.g. \f(CW\*(C`[10.1.2.3]\*(C'\fR, \f(CW\*(C`[10.1.2]\*(C'\fR, \&\f(CW\*(C`[10.1]\*(C'\fR, \f(CW\*(C`[10]\*(C'\fR. \s-1CIDR\s0 notation is currently not supported, nor is IPv6. The matching on \s-1IP\s0 address is mainly provided to cover rare cases where whitelisting of a sending \s-1MTA\s0 is desired which does not have a correct reverse \s-1DNS\s0 configured. .Sp In other words, if the host that connected to your \s-1MX\s0 had an \s-1IP\s0 address 192.0.2.123 that mapped to 'sendinghost.example.org', you should specify \&\f(CW\*(C`sendinghost.example.org\*(C'\fR, or \f(CW\*(C`example.org\*(C'\fR, or \f(CW\*(C`[192.0.2.123]\*(C'\fR or \&\f(CW\*(C`[192.0.2]\*(C'\fR here. .Sp Note that this requires that \f(CW\*(C`internal_networks\*(C'\fR be correct. For simple cases, it will be, but for a complex network you may get better results by setting that parameter. .Sp It also requires that your mail exchangers be configured to perform \s-1DNS\s0 reverse lookups on the connecting host's \s-1IP\s0 address, and to record the result in the generated Received header field according to \s-1RFC 5321.\s0 .Sp e.g. .Sp .Vb 3 \& whitelist_from_rcvd joe@example.com example.com \& whitelist_from_rcvd *@axkit.org sergeant.org \& whitelist_from_rcvd *@axkit.org [192.0.2.123] .Ve .IP "def_whitelist_from_rcvd addr@lists.sourceforge.net sourceforge.net" 4 .IX Item "def_whitelist_from_rcvd addr@lists.sourceforge.net sourceforge.net" Same as \f(CW\*(C`whitelist_from_rcvd\*(C'\fR, but used for the default whitelist entries in the SpamAssassin distribution. The whitelist score is lower, because these are often targets for spammer spoofing. .IP "whitelist_allows_relays user@example.com" 4 .IX Item "whitelist_allows_relays user@example.com" Specify addresses which are in \f(CW\*(C`whitelist_from_rcvd\*(C'\fR that sometimes send through a mail relay other than the listed ones. By default mail with a From address that is in \f(CW\*(C`whitelist_from_rcvd\*(C'\fR that does not match the relay will trigger a forgery rule. Including the address in \&\f(CW\*(C`whitelist_allows_relay\*(C'\fR prevents that. .Sp Whitelist and blacklist addresses are now file-glob-style patterns, so \&\f(CW\*(C`friend@somewhere.com\*(C'\fR, \f(CW\*(C`*@isp.com\*(C'\fR, or \f(CW\*(C`*.domain.net\*(C'\fR will all work. Specifically, \f(CW\*(C`*\*(C'\fR and \f(CW\*(C`?\*(C'\fR are allowed, but all other metacharacters are not. Regular expressions are not used for security reasons. Matching is case-insensitive. .Sp Multiple addresses per line, separated by spaces, is \s-1OK. \s0 Multiple \&\f(CW\*(C`whitelist_allows_relays\*(C'\fR lines are also \s-1OK.\s0 .Sp The specified email address does not have to match exactly the address previously used in a whitelist_from_rcvd line as it is compared to the address in the header. .Sp e.g. .Sp .Vb 2 \& whitelist_allows_relays joe@example.com fred@example.com \& whitelist_allows_relays *@example.com .Ve .IP "unwhitelist_from_rcvd user@example.com" 4 .IX Item "unwhitelist_from_rcvd user@example.com" Used to override a default whitelist_from_rcvd entry, so for example a distribution whitelist_from_rcvd can be overridden in a local.cf file, or an individual user can override a whitelist_from_rcvd entry in their own \f(CW\*(C`user_prefs\*(C'\fR file. .Sp The specified email address has to match exactly the address previously used in a whitelist_from_rcvd line. .Sp e.g. .Sp .Vb 2 \& unwhitelist_from_rcvd joe@example.com fred@example.com \& unwhitelist_from_rcvd *@axkit.org .Ve .IP "blacklist_from user@example.com" 4 .IX Item "blacklist_from user@example.com" Used to specify addresses which send mail that is often tagged (incorrectly) as non-spam, but which the user doesn't want. Same format as \f(CW\*(C`whitelist_from\*(C'\fR. .IP "unblacklist_from user@example.com" 4 .IX Item "unblacklist_from user@example.com" Used to override a default blacklist_from entry, so for example a distribution blacklist_from can be overridden in a local.cf file, or an individual user can override a blacklist_from entry in their own \&\f(CW\*(C`user_prefs\*(C'\fR file. The specified email address has to match exactly the address previously used in a blacklist_from line. .Sp e.g. .Sp .Vb 2 \& unblacklist_from joe@example.com fred@example.com \& unblacklist_from *@spammer.com .Ve .IP "whitelist_to user@example.com" 4 .IX Item "whitelist_to user@example.com" If the given address appears as a recipient in the message headers (Resent-To, To, Cc, obvious envelope recipient, etc.) the mail will be whitelisted. Useful if you're deploying SpamAssassin system-wide, and don't want some users to have their mail filtered. Same format as \f(CW\*(C`whitelist_from\*(C'\fR. .Sp There are three levels of To-whitelisting, \f(CW\*(C`whitelist_to\*(C'\fR, \f(CW\*(C`more_spam_to\*(C'\fR and \f(CW\*(C`all_spam_to\*(C'\fR. Users in the first level may still get some spammish mails blocked, but users in \f(CW\*(C`all_spam_to\*(C'\fR should never get mail blocked. .Sp The headers checked for whitelist addresses are as follows: if \f(CW\*(C`Resent\-To\*(C'\fR or \&\f(CW\*(C`Resent\-Cc\*(C'\fR are set, use those; otherwise check all addresses taken from the following set of headers: .Sp .Vb 12 \& To \& Cc \& Apparently\-To \& Delivered\-To \& Envelope\-Recipients \& Apparently\-Resent\-To \& X\-Envelope\-To \& Envelope\-To \& X\-Delivered\-To \& X\-Original\-To \& X\-Rcpt\-To \& X\-Real\-To .Ve .IP "more_spam_to user@example.com" 4 .IX Item "more_spam_to user@example.com" See above. .IP "all_spam_to user@example.com" 4 .IX Item "all_spam_to user@example.com" See above. .IP "blacklist_to user@example.com" 4 .IX Item "blacklist_to user@example.com" If the given address appears as a recipient in the message headers (Resent-To, To, Cc, obvious envelope recipient, etc.) the mail will be blacklisted. Same format as \f(CW\*(C`blacklist_from\*(C'\fR. .IP "whitelist_auth user@example.com" 4 .IX Item "whitelist_auth user@example.com" Used to specify addresses which send mail that is often tagged (incorrectly) as spam. This is different from \f(CW\*(C`whitelist_from\*(C'\fR and \f(CW\*(C`whitelist_from_rcvd\*(C'\fR in that it first verifies that the message was sent by an authorized sender for the address, before whitelisting. .Sp Authorization is performed using one of the installed sender-authorization schemes: \s-1SPF \s0(using \f(CW\*(C`Mail::SpamAssassin::Plugin::SPF\*(C'\fR), or \s-1DKIM \s0(using \&\f(CW\*(C`Mail::SpamAssassin::Plugin::DKIM\*(C'\fR). Note that those plugins must be active, and working, for this to operate. .Sp Using \f(CW\*(C`whitelist_auth\*(C'\fR is roughly equivalent to specifying duplicate \&\f(CW\*(C`whitelist_from_spf\*(C'\fR, \f(CW\*(C`whitelist_from_dk\*(C'\fR, and \f(CW\*(C`whitelist_from_dkim\*(C'\fR lines for each of the addresses specified. .Sp e.g. .Sp .Vb 2 \& whitelist_auth joe@example.com fred@example.com \& whitelist_auth *@example.com .Ve .IP "def_whitelist_auth user@example.com" 4 .IX Item "def_whitelist_auth user@example.com" Same as \f(CW\*(C`whitelist_auth\*(C'\fR, but used for the default whitelist entries in the SpamAssassin distribution. The whitelist score is lower, because these are often targets for spammer spoofing. .IP "unwhitelist_auth user@example.com" 4 .IX Item "unwhitelist_auth user@example.com" Used to override a \f(CW\*(C`whitelist_auth\*(C'\fR entry. The specified email address has to match exactly the address previously used in a \f(CW\*(C`whitelist_auth\*(C'\fR line. .Sp e.g. .Sp .Vb 2 \& unwhitelist_auth joe@example.com fred@example.com \& unwhitelist_auth *@example.com .Ve .IP "enlist_uri_host (listname) host ..." 4 .IX Item "enlist_uri_host (listname) host ..." Adds one or more host names or domain names to a named list of \s-1URI\s0 domains. The named list can then be consulted through a \fIcheck_uri_host_listed()\fR eval rule implemented by the WLBLEval plugin, which takes the list name as an argument. Parenthesis around a list name are literal \- a required syntax. .Sp Host names may optionally be prefixed by an exclamantion mark '!', which produces false as a result if this entry matches. This makes it easier to exclude some subdomains when their superdomain is listed, for example: .Sp .Vb 1 \& enlist_uri_host (MYLIST) !sub1.example.com !sub2.example.com example.com .Ve .Sp No wildcards are supported, but subdomains do match implicitly. Lists are independent. Search for each named list starts by looking up the full hostname first, then leading fields are progressively stripped off (e.g.: sub.example.com, example.com, com) until a match is found or we run out of fields. The first matching entry (the most specific) determines if a lookup yielded a true (no '!' prefix) or a false (with a '!' prefix) result. .Sp If an \s-1URL\s0 found in a message contains an \s-1IP\s0 address in place of a host name, the given list must specify the exact same \s-1IP\s0 address (instead of a host name) in order to match. .Sp Use the delist_uri_host directive to neutralize previous enlist_uri_host settings. .Sp Enlisting to lists named '\s-1BLACK\s0' and '\s-1WHITE\s0' have their shorthand directives blacklist_uri_host and whitelist_uri_host and corresponding default rules, but the names '\s-1BLACK\s0' and '\s-1WHITE\s0' are otherwise not special or reserved. .IP "delist_uri_host [ (listname) ] host ..." 4 .IX Item "delist_uri_host [ (listname) ] host ..." Removes one or more specified host names from a named list of \s-1URI\s0 domains. Removing an unlisted name is ignored (is not an error). Listname is optional, if specified then just the named list is affected, otherwise hosts are removed from all \s-1URI\s0 host lists created so far. Parenthesis around a list name are a required syntax. .Sp Note that directives in configuration files are processed in sequence, the delist_uri_host only applies to previously listed entries and has no effect on enlisted entries in yet-to-be-processed directives. .Sp For convenience (similarity to the enlist_uri_host directive) hostnames may be prefixed by a an exclamation mark, which is stripped off from each name and has no meaning here. .IP "blacklist_uri_host host-or-domain ..." 4 .IX Item "blacklist_uri_host host-or-domain ..." Is a shorthand for a directive: enlist_uri_host (\s-1BLACK\s0) host ... .Sp Please see directives enlist_uri_host and delist_uri_host for details. .IP "whitelist_uri_host host-or-domain ..." 4 .IX Item "whitelist_uri_host host-or-domain ..." Is a shorthand for a directive: enlist_uri_host (\s-1BLACK\s0) host ... .Sp Please see directives enlist_uri_host and delist_uri_host for details. .SS "\s-1BASIC MESSAGE TAGGING OPTIONS\s0" .IX Subsection "BASIC MESSAGE TAGGING OPTIONS" .IP "rewrite_header { subject | from | to } \s-1STRING\s0" 4 .IX Item "rewrite_header { subject | from | to } STRING" By default, suspected spam messages will not have the \f(CW\*(C`Subject\*(C'\fR, \&\f(CW\*(C`From\*(C'\fR or \f(CW\*(C`To\*(C'\fR lines tagged to indicate spam. By setting this option, the header will be tagged with \f(CW\*(C`STRING\*(C'\fR to indicate that a message is spam. For the From or To headers, this will take the form of an \s-1RFC 2822\s0 comment following the address in parantheses. For the Subject header, this will be prepended to the original subject. Note that you should only use the _REQD_ and _SCORE_ tags when rewriting the Subject header if \f(CW\*(C`report_safe\*(C'\fR is 0. Otherwise, you may not be able to remove the SpamAssassin markup via the normal methods. More information about tags is explained below in the \fB\s-1TEMPLATE TAGS\s0\fR section. .Sp Parentheses are not permitted in \s-1STRING\s0 if rewriting the From or To headers. (They will be converted to square brackets.) .Sp If \f(CW\*(C`rewrite_header subject\*(C'\fR is used, but the message being rewritten does not already contain a \f(CW\*(C`Subject\*(C'\fR header, one will be created. .Sp A null value for \f(CW\*(C`STRING\*(C'\fR will remove any existing rewrite for the specified header. .IP "add_header { spam | ham | all } header_name string" 4 .IX Item "add_header { spam | ham | all } header_name string" Customized headers can be added to the specified type of messages (spam, ham, or \*(L"all\*(R" to add to either). All headers begin with \f(CW\*(C`X\-Spam\-\*(C'\fR (so a \f(CW\*(C`header_name\*(C'\fR Foo will generate a header called X\-Spam-Foo). header_name is restricted to the character set [A\-Za\-z0\-9_\-]. .Sp The order of \f(CW\*(C`add_header\*(C'\fR configuration options is preserved, inserted headers will follow this order of declarations. When combining \f(CW\*(C`add_header\*(C'\fR with \f(CW\*(C`clear_headers\*(C'\fR and \f(CW\*(C`remove_header\*(C'\fR, keep in mind that \f(CW\*(C`add_header\*(C'\fR appends a new header to the current list, after first removing any existing header fields of the same name. Note also that \f(CW\*(C`add_header\*(C'\fR, \f(CW\*(C`clear_headers\*(C'\fR and \f(CW\*(C`remove_header\*(C'\fR may appear in multiple .cf files, which are interpreted in alphabetic order. .Sp \&\f(CW\*(C`string\*(C'\fR can contain tags as explained below in the \fB\s-1TEMPLATE TAGS\s0\fR section. You can also use \f(CW\*(C`\en\*(C'\fR and \f(CW\*(C`\et\*(C'\fR in the header to add newlines and tabulators as desired. A backslash has to be written as \e\e, any other escaped chars will be silently removed. .Sp All headers will be folded if fold_headers is set to \f(CW1\fR. Note: Manually adding newlines via \f(CW\*(C`\en\*(C'\fR disables any further automatic wrapping (ie: long header lines are possible). The lines will still be properly folded (marked as continuing) though. .Sp You can customize existing headers with \fBadd_header\fR (only the specified subset of messages will be changed). .Sp See also \f(CW\*(C`clear_headers\*(C'\fR and \f(CW\*(C`remove_header\*(C'\fR for removing headers. .Sp Here are some examples (these are the defaults, note that Checker-Version can not be changed or removed): .Sp .Vb 4 \& add_header spam Flag _YESNOCAPS_ \& add_header all Status _YESNO_, score=_SCORE_ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_ \& add_header all Level _STARS(*)_ \& add_header all Checker\-Version SpamAssassin _VERSION_ (_SUBVERSION_) on _HOSTNAME_ .Ve .IP "remove_header { spam | ham | all } header_name" 4 .IX Item "remove_header { spam | ham | all } header_name" Headers can be removed from the specified type of messages (spam, ham, or \*(L"all\*(R" to remove from either). All headers begin with \f(CW\*(C`X\-Spam\-\*(C'\fR (so \f(CW\*(C`header_name\*(C'\fR will be appended to \f(CW\*(C`X\-Spam\-\*(C'\fR). .Sp See also \f(CW\*(C`clear_headers\*(C'\fR for removing all the headers at once. .Sp Note that \fBX\-Spam-Checker-Version\fR is not removable because the version information is needed by mail administrators and developers to debug problems. Without at least one header, it might not even be possible to determine that SpamAssassin is running. .IP "clear_headers" 4 .IX Item "clear_headers" Clear the list of headers to be added to messages. You may use this before any \fBadd_header\fR options to prevent the default headers from being added to the message. .Sp \&\f(CW\*(C`add_header\*(C'\fR, \f(CW\*(C`clear_headers\*(C'\fR and \f(CW\*(C`remove_header\*(C'\fR may appear in multiple \&.cf files, which are interpreted in alphabetic order, so \f(CW\*(C`clear_headers\*(C'\fR in a later file will remove all added headers from previously interpreted configuration files, which may or may not be desired. .Sp Note that \fBX\-Spam-Checker-Version\fR is not removable because the version information is needed by mail administrators and developers to debug problems. Without at least one header, it might not even be possible to determine that SpamAssassin is running. .IP "report_safe ( 0 | 1 | 2 ) (default: 1)" 4 .IX Item "report_safe ( 0 | 1 | 2 ) (default: 1)" if this option is set to 1, if an incoming message is tagged as spam, instead of modifying the original message, SpamAssassin will create a new report message and attach the original message as a message/rfc822 \&\s-1MIME\s0 part (ensuring the original message is completely preserved, not easily opened, and easier to recover). .Sp If this option is set to 2, then original messages will be attached with a content type of text/plain instead of message/rfc822. This setting may be required for safety reasons on certain broken mail clients that automatically load attachments without any action by the user. This setting may also make it somewhat more difficult to extract or view the original message. .Sp If this option is set to 0, incoming spam is only modified by adding some \f(CW\*(C`X\-Spam\-\*(C'\fR headers and no changes will be made to the body. In addition, a header named \fBX\-Spam-Report\fR will be added to spam. You can use the \fBremove_header\fR option to remove that header after setting \&\fBreport_safe\fR to 0. .Sp See \fBreport_safe_copy_headers\fR if you want to copy headers from the original mail into tagged messages. .SS "\s-1LANGUAGE OPTIONS\s0" .IX Subsection "LANGUAGE OPTIONS" .IP "ok_locales xx [ yy zz ... ] (default: all)" 4 .IX Item "ok_locales xx [ yy zz ... ] (default: all)" This option is used to specify which locales are considered \s-1OK\s0 for incoming mail. Mail using the \fBcharacter sets\fR that are allowed by this option will not be marked as possibly being spam in a foreign language. .Sp If you receive lots of spam in foreign languages, and never get any non-spam in these languages, this may help. Note that all ISO\-8859\-* character sets, and Windows code page character sets, are always permitted by default. .Sp Set this to \f(CW\*(C`all\*(C'\fR to allow all character sets. This is the default. .Sp The rules \f(CW\*(C`CHARSET_FARAWAY\*(C'\fR, \f(CW\*(C`CHARSET_FARAWAY_BODY\*(C'\fR, and \&\f(CW\*(C`CHARSET_FARAWAY_HEADERS\*(C'\fR are triggered based on how this is set. .Sp Examples: .Sp .Vb 3 \& ok_locales all (allow all locales) \& ok_locales en (only allow English) \& ok_locales en ja zh (allow English, Japanese, and Chinese) .Ve .Sp Note: if there are multiple ok_locales lines, only the last one is used. .Sp Select the locales to allow from the list below: .RS 4 .IP "en \- Western character sets in general" 4 .IX Item "en - Western character sets in general" .PD 0 .IP "ja \- Japanese character sets" 4 .IX Item "ja - Japanese character sets" .IP "ko \- Korean character sets" 4 .IX Item "ko - Korean character sets" .IP "ru \- Cyrillic character sets" 4 .IX Item "ru - Cyrillic character sets" .IP "th \- Thai character sets" 4 .IX Item "th - Thai character sets" .IP "zh \- Chinese (both simplified and traditional) character sets" 4 .IX Item "zh - Chinese (both simplified and traditional) character sets" .RE .RS 4 .RE .IP "normalize_charset ( 0 | 1) (default: 0)" 4 .IX Item "normalize_charset ( 0 | 1) (default: 0)" .PD Whether to decode non\- \s-1UTF\-8\s0 and non-ASCII textual parts and recode them to \s-1UTF\-8\s0 before the text is given over to rules processing. The character set used for attempted decoding is primarily based on a declared character set in a Content-Type header, but if the decoding attempt fails a module Encode::Detect::Detector is consulted (if available) to provide a guess based on the actual text, and decoding is re-attempted. Even if the option is enabled no unnecessary decoding and re-encoding work is done when possible (like with an all-ASCII text with a US-ASCII or extended \s-1ASCII\s0 character set declaration, e.g. \s-1UTF\-8\s0 or ISO\-8859\-nn or Windows-nnnn). .Sp Unicode support in old versions of perl or in a core module Encode is likely to be buggy in places, so if the normalize_charset function is enabled it is advised to stick to more recent versions of perl (preferably 5.12 or later). The module Encode::Detect::Detector is optional, when necessary it will be used if it is available. .SS "\s-1NETWORK TEST OPTIONS\s0" .IX Subsection "NETWORK TEST OPTIONS" .IP "trusted_networks IPaddress[/masklen] ... (default: none)" 4 .IX Item "trusted_networks IPaddress[/masklen] ... (default: none)" What networks or hosts are 'trusted' in your setup. \fBTrusted\fR in this case means that relay hosts on these networks are considered to not be potentially operated by spammers, open relays, or open proxies. A trusted host could conceivably relay spam, but will not originate it, and will not forge header data. \s-1DNS\s0 blacklist checks will never query for hosts on these networks. .Sp See \f(CW\*(C`http://wiki.apache.org/spamassassin/TrustPath\*(C'\fR for more information. .Sp MXes for your domain(s) and internal relays should \fBalso\fR be specified using the \f(CW\*(C`internal_networks\*(C'\fR setting. When there are 'trusted' hosts that are not MXes or internal relays for your domain(s) they should \fBonly\fR be specified in \f(CW\*(C`trusted_networks\*(C'\fR. .Sp The \f(CW\*(C`IPaddress\*(C'\fR can be an IPv4 address (in a dot-quad form), or an IPv6 address optionally enclosed in square brackets. Scoped link-local IPv6 addresses are syntactically recognized but the interface scope is currently ignored (e.g. [fe80::1234%eth0] ) and should be avoided. .Sp If a \f(CW\*(C`/masklen\*(C'\fR is specified, it is considered a CIDR-style 'netmask' length, specified in bits. If it is not specified, but less than 4 octets of an IPv4 address are specified with a trailing dot, an implied netmask length covers all addresses in remaining octets (i.e. implied masklen is /8 or /16 or /24). If masklen is not specified, and there is not trailing dot, then just a single \&\s-1IP\s0 address specified is used, as if the masklen were \f(CW\*(C`/32\*(C'\fR with an IPv4 address, or \f(CW\*(C`/128\*(C'\fR in case of an IPv6 address. .Sp If a network or host address is prefaced by a \f(CW\*(C`!\*(C'\fR the matching network or host will be excluded from the list even if a less specific (shorter netmask length) subnet is later specified in the list. This allows a subset of a wider network to be exempt. In case of specifying overlapping subnets, specify more specific subnets first (tighter matching, i.e. with a longer netmask length), followed by less specific (shorter netmask length) subnets to get predictable results regarless of the search algorithm used \- when Net::Patricia module is installed the search finds the tightest matching entry in the list, while a sequential search as used in absence of the module Net::Patricia will find the first matching entry in the list. .Sp Note: 127.0.0.0/8 and ::1 are always included in trusted_networks, regardless of your config. .Sp Examples: .Sp .Vb 6 \& trusted_networks 192.168.0.0/16 # all in 192.168.*.* \& trusted_networks 192.168. # all in 192.168.*.* \& trusted_networks 212.17.35.15 # just that host \& trusted_networks !10.0.1.5 10.0.1/24 # all in 10.0.1.* but not 10.0.1.5 \& trusted_networks 2001:db8:1::1 !2001:db8:1::/64 2001:db8::/32 \& # 2001:db8::/32 and 2001:db8:1::1/128, except the rest of 2001:db8:1::/64 .Ve .Sp This operates additively, so a \f(CW\*(C`trusted_networks\*(C'\fR line after another one will append new entries to the list of trusted networks. To clear out the existing entries, use \f(CW\*(C`clear_trusted_networks\*(C'\fR. .Sp If \f(CW\*(C`trusted_networks\*(C'\fR is not set and \f(CW\*(C`internal_networks\*(C'\fR is, the value of \f(CW\*(C`internal_networks\*(C'\fR will be used for this parameter. .Sp If neither \f(CW\*(C`trusted_networks\*(C'\fR or \f(CW\*(C`internal_networks\*(C'\fR is set, a basic inference algorithm is applied. This works as follows: .RS 4 .IP "\(bu" 4 If the 'from' host has an \s-1IP\s0 address in a private (\s-1RFC 1918\s0) network range, then it's trusted .IP "\(bu" 4 If there are authentication tokens in the received header, and the previous host was trusted, then this host is also trusted .IP "\(bu" 4 Otherwise this host, and all further hosts, are consider untrusted. .RE .RS 4 .RE .IP "clear_trusted_networks" 4 .IX Item "clear_trusted_networks" Empty the list of trusted networks. .IP "internal_networks IPaddress[/masklen] ... (default: none)" 4 .IX Item "internal_networks IPaddress[/masklen] ... (default: none)" What networks or hosts are 'internal' in your setup. \fBInternal\fR means that relay hosts on these networks are considered to be MXes for your domain(s), or internal relays. This uses the same syntax as \&\f(CW\*(C`trusted_networks\*(C'\fR, above \- see there for details. .Sp This value is used when checking 'dial\-up' or dynamic \s-1IP\s0 address blocklists, in order to detect direct-to-MX spamming. .Sp Trusted relays that accept mail directly from dial-up connections (i.e. are also performing a role of mail submission agents \- \s-1MSA\s0) should not be listed in \f(CW\*(C`internal_networks\*(C'\fR. List them only in \&\f(CW\*(C`trusted_networks\*(C'\fR. .Sp If \f(CW\*(C`trusted_networks\*(C'\fR is set and \f(CW\*(C`internal_networks\*(C'\fR is not, the value of \f(CW\*(C`trusted_networks\*(C'\fR will be used for this parameter. .Sp If neither \f(CW\*(C`trusted_networks\*(C'\fR nor \f(CW\*(C`internal_networks\*(C'\fR is set, no addresses will be considered local; in other words, any relays past the machine where SpamAssassin is running will be considered external. .Sp Every entry in \f(CW\*(C`internal_networks\*(C'\fR must appear in \f(CW\*(C`trusted_networks\*(C'\fR; in other words, \f(CW\*(C`internal_networks\*(C'\fR is always a subset of the trusted set. .Sp Note: 127/8 and ::1 are always included in internal_networks, regardless of your config. .IP "clear_internal_networks" 4 .IX Item "clear_internal_networks" Empty the list of internal networks. .IP "msa_networks IPaddress[/masklen] ... (default: none)" 4 .IX Item "msa_networks IPaddress[/masklen] ... (default: none)" The networks or hosts which are acting as MSAs in your setup (but not also as \s-1MX\s0 relays). This uses the same syntax as \f(CW\*(C`trusted_networks\*(C'\fR, above \- see there for details. .Sp \&\fB\s-1MSA\s0\fR means that the relay hosts on these networks accept mail from your own users and authenticates them appropriately. These relays will never accept mail from hosts that aren't authenticated in some way. Examples of authentication include, \s-1IP\s0 lists, \s-1SMTP AUTH,\s0 POP-before-SMTP, etc. .Sp All relays found in the message headers after the \s-1MSA\s0 relay will take on the same trusted and internal classifications as the \s-1MSA\s0 relay itself, as defined by your \fItrusted_networks\fR and \fIinternal_networks\fR configuration. .Sp For example, if the \s-1MSA\s0 relay is trusted and internal so will all of the relays that precede it. .Sp When using msa_networks to identify an \s-1MSA\s0 it is recommended that you treat that \s-1MSA\s0 as both trusted and internal. When an \s-1MSA\s0 is not included in msa_networks you should treat the \s-1MSA\s0 as trusted but not internal, however if the \s-1MSA\s0 is also acting as an \s-1MX\s0 or intermediate relay you must always treat it as both trusted and internal and ensure that the \s-1MSA\s0 includes visible auth tokens in its Received header to identify submission clients. .Sp \&\fBWarning:\fR Never include an \s-1MSA\s0 that also acts as an \s-1MX \s0(or is also an intermediate relay for an \s-1MX\s0) or otherwise accepts mail from non-authenticated users in msa_networks. Doing so will result in unknown external relays being trusted. .IP "clear_msa_networks" 4 .IX Item "clear_msa_networks" Empty the list of msa networks. .IP "originating_ip_headers header ... (default: X\-Yahoo-Post-IP X\-Originating-IP X\-Apparently-From X\-SenderIP)" 4 .IX Item "originating_ip_headers header ... (default: X-Yahoo-Post-IP X-Originating-IP X-Apparently-From X-SenderIP)" A list of header field names from which an originating \s-1IP\s0 address can be obtained. For example, webmail servers may record a client \s-1IP\s0 address in X\-Originating-IP. .Sp These \s-1IP\s0 addresses are virtually appended into the Received: chain, so they are used in \s-1RBL\s0 checks where appropriate. .Sp Currently the \s-1IP\s0 addresses are not added into X\-Spam\-Relays\-* header fields, but they may be in the future. .IP "clear_originating_ip_headers" 4 .IX Item "clear_originating_ip_headers" Empty the list of 'originating \s-1IP\s0 address' header field names. .IP "always_trust_envelope_sender ( 0 | 1 ) (default: 0)" 4 .IX Item "always_trust_envelope_sender ( 0 | 1 ) (default: 0)" Trust the envelope sender even if the message has been passed through one or more trusted relays. See also \f(CW\*(C`envelope_sender_header\*(C'\fR. .IP "skip_rbl_checks ( 0 | 1 ) (default: 0)" 4 .IX Item "skip_rbl_checks ( 0 | 1 ) (default: 0)" Turning on the skip_rbl_checks setting will disable the DNSEval plugin, which implements Real-time Block List (or: Blackhole List) (\s-1RBL\s0) lookups. .Sp By default, SpamAssassin will run \s-1RBL\s0 checks. Individual blocklists may be disabled selectively by setting a score of a corresponding rule to 0. .Sp See also a related configuration parameter skip_uribl_checks, which controls the \s-1URIDNSBL\s0 plugin (documented in the \s-1URIDNSBL\s0 man page). .IP "dns_available { yes | no | test[: domain1 domain2...] } (default: yes)" 4 .IX Item "dns_available { yes | no | test[: domain1 domain2...] } (default: yes)" Tells SpamAssassin whether \s-1DNS\s0 resolving is available or not. A value \fIyes\fR indicates \s-1DNS\s0 resolving is available, a value \fIno\fR indicates \s-1DNS\s0 resolving is not available \- both of these values apply unconditionally and skip initial \&\s-1DNS\s0 tests, which can be slow or unreliable. .Sp When the option value is a \fItest\fR (with or without arguments), SpamAssassin will query some domain names on the internet during initialization, attempting to determine if \s-1DNS\s0 resolving is working or not. A space-separated list of domain names may be specified explicitly, or left to a built-in default of a dozen or so domain names. From an explicit or a default list a subset of three domain names is picked randomly for checking. The test queries for \&\s-1NS\s0 records of these domain: if at least one query returns a success then SpamAssassin considers \s-1DNS\s0 resolving as available, otherwise not. .Sp The problem is that the test can introduce some startup delay if a network connection is down, and in some cases it can wrongly guess that \s-1DNS\s0 is unavailable because a test connection failed, what causes disabling several DNS-dependent tests. .Sp Please note, the \s-1DNS\s0 test queries for \s-1NS\s0 records, so specify domain names, not host names. .Sp Since version 3.4.0 of SpamAssassin a default setting for option \&\fIdns_available\fR is \fIyes\fR. A default in older versions was \fItest\fR. .IP "dns_server ip-addr-port (default: entries provided by Net::DNS)" 4 .IX Item "dns_server ip-addr-port (default: entries provided by Net::DNS)" Specifies an \s-1IP\s0 address of a \s-1DNS\s0 server, and optionally its port number. The \fIdns_server\fR directive may be specified multiple times, each entry adding to a list of available resolving name servers. The \fIip-addr-port\fR argument can either be an IPv4 or IPv6 address, optionally enclosed in brackets, and optionally followed by a colon and a port number. In absence of a port number a standard port number 53 is assumed. When an IPv6 address is specified along with a port number, the address \fBmust\fR be enclosed in brackets to avoid parsing ambiguity regarding a colon separator. A scoped link-local \s-1IP\s0 address is allowed (assuming underlying modules allow it). .Sp Examples : dns_server 127.0.0.1 dns_server 127.0.0.1:53 dns_server [127.0.0.1]:53 dns_server [::1]:53 dns_server fe80::1%lo0 dns_server [fe80::1%lo0]:53 .Sp In absence of \fIdns_server\fR directives, the list of name servers is provided by Net::DNS module, which typically obtains the list from /etc/resolv.conf, but this may be platform dependent. Please consult the Net::DNS::Resolver documentation for details. .IP "clear_dns_servers" 4 .IX Item "clear_dns_servers" Empty the list of explicitly configured \s-1DNS\s0 servers through a \fIdns_server\fR directive, falling back to Net::DNS \-supplied defaults. .IP "dns_local_ports_permit ranges..." 4 .IX Item "dns_local_ports_permit ranges..." Add the specified ports or ports ranges to the set of allowed port numbers that can be used as local port numbers when sending \s-1DNS\s0 queries to a resolver. .Sp The argument is a whitespace-separated or a comma-separated list of single port numbers n, or port number pairs (i.e. m\-n) delimited by a '\-', representing a range. Allowed port numbers are between 1 and 65535. .Sp Directives \fIdns_local_ports_permit\fR and \fIdns_local_ports_avoid\fR are processed in order in which they appear in configuration files. Each directive adds (or subtracts) its subsets of ports to a current set of available ports. Whatever is left in the set by the end of configuration processing is made available to a \s-1DNS\s0 resolving client code. .Sp If the resulting set of port numbers is empty (see also the directive \&\fIdns_local_ports_none\fR), then SpamAssassin does not apply its ports randomization logic, but instead leaves the operating system to choose a suitable free local port number. .Sp The initial set consists of all port numbers in the range 1024\-65535. Note that system config files already modify the set and remove all the \&\s-1IANA\s0 registered port numbers and some other ranges, so there is rarely a need to adjust the ranges by site-specific directives. .Sp See also directives \fIdns_local_ports_permit\fR and \fIdns_local_ports_none\fR. .IP "dns_local_ports_avoid ranges..." 4 .IX Item "dns_local_ports_avoid ranges..." Remove specified ports or ports ranges from the set of allowed port numbers that can be used as local port numbers when sending \s-1DNS\s0 queries to a resolver. .Sp Please see directive \fIdns_local_ports_permit\fR for details. .IP "dns_local_ports_none" 4 .IX Item "dns_local_ports_none" Is a fast shorthand for: .Sp .Vb 1 \& dns_local_ports_avoid 1\-65535 .Ve .Sp leaving the set of available \s-1DNS\s0 query local port numbers empty. In all respects (apart from speed) it is equivalent to the shown directive, and can be freely mixed with \fIdns_local_ports_permit\fR and \fIdns_local_ports_avoid\fR. .Sp If the resulting set of port numbers is empty, then SpamAssassin does not apply its ports randomization logic, but instead leaves the operating system to choose a suitable free local port number. .Sp See also directives \fIdns_local_ports_permit\fR and \fIdns_local_ports_avoid\fR. .IP "dns_test_interval n (default: 600 seconds)" 4 .IX Item "dns_test_interval n (default: 600 seconds)" If dns_available is set to \fItest\fR, the dns_test_interval time in number of seconds will tell SpamAssassin how often to retest for working \s-1DNS. A\s0 numeric value is optionally suffixed by a time unit (s, m, h, d, w, indicating seconds (default), minutes, hours, days, weeks). .IP "dns_options opts (default: norotate, nodns0x20, edns=4096)" 4 .IX Item "dns_options opts (default: norotate, nodns0x20, edns=4096)" Provides a (whitespace or comma \-separated) list of options applying to \s-1DNS\s0 resolving. Available options are: \fIrotate\fR, \fIdns0x20\fR and \&\fIedns\fR (or \fIedns0\fR). Option name may be negated by prepending a \fIno\fR (e.g. \fInorotate\fR, \fINoEDNS\fR) to counteract a previously enabled option. Option names are not case-sensitive. The \fIdns_options\fR directive may appear in configuration files multiple times, the last setting prevails. .Sp Option \fIedns\fR (or \fIedsn0\fR) may take a value which specifies a requestor's acceptable \s-1UDP\s0 payload size according to \s-1EDNS0\s0 specifications (\s-1RFC 6891,\s0 ex \s-1RFC 2671\s0) e.g. \fIedns=4096\fR. When \s-1EDNS0\s0 is off (\fInoedns\fR or \fIedns=512\fR) a traditional implied \s-1UDP\s0 payload size is 512 bytes, which is also a minimum allowed value for this option. When the option is specified but a value is not provided, a conservative default of 1220 bytes is implied. It is recommended to keep \fIedns\fR enabled when using a local recursive \s-1DNS\s0 server which supports \s-1EDNS0 \s0(like most modern \s-1DNS\s0 servers do), a suitable setting in this case is \fIedns=4096\fR, which is also a default. Allowing \s-1UDP\s0 payload size larger than 512 bytes can avoid truncation of resource records in large \&\s-1DNS\s0 responses (like in \s-1TXT\s0 records of some \s-1SPF\s0 and \s-1DKIM\s0 responses, or when an unreasonable number of A records is published by some domain). The option should be disabled when a recursive \s-1DNS\s0 server is only reachable through non\- \s-1RFC 6891\s0 compliant middleboxes (such as some old-fashioned firewall) which bans \s-1DNS UDP\s0 payload sizes larger than 512 bytes. A suitable value when a non-local recursive \s-1DNS\s0 server is used and a middlebox \fBdoes\fR allow \&\s-1EDNS0\s0 but blocks fragmented \s-1IP\s0 packets is perhaps 1220 bytes, allowing a \&\s-1DNS UDP\s0 packet to fit within a single \s-1IP\s0 packet in most cases (a slightly less conservative range would be 1280\-1410 bytes). .Sp Option \fIrotate\fR causes SpamAssassin to choose a \s-1DNS\s0 server at random from all servers listed in \f(CW\*(C`/etc/resolv.conf\*(C'\fR every \fIdns_test_interval\fR seconds, effectively spreading the load over all currently available \s-1DNS\s0 servers when there are many spamd workers. .Sp Option \fIdns0x20\fR enables randomization of letters in a \s-1DNS\s0 query label according to draft\-vixie\-dnsext\-dns0x20, decreasing a chance of collisions of responses (by chance or by a malicious intent) by increasing spread as provided by a 16\-bit query \s-1ID\s0 and up to 16 bits of a port number, with additional bits as encoded by flipping case (upper/lower) of letters in a query. The number of additional random bits corresponds to the number of letters in a query label. Should work reliably with all mainstream \&\s-1DNS\s0 servers \- do not turn on if you see frequent info messages \&\*(L"dns: no callback for id:\*(R" in the log, or if \s-1RBL\s0 or \s-1URIDNS\s0 lookups do not work for no apparent reason. .IP "dns_query_restriction (allow|deny) domain1 domain2 ..." 4 .IX Item "dns_query_restriction (allow|deny) domain1 domain2 ..." Option allows disabling of rules which would result in a \s-1DNS\s0 query to one of the listed domains. The first argument must be a literal \f(CW\*(C`allow\*(C'\fR or \f(CW\*(C`deny\*(C'\fR, remaining arguments are domains names. .Sp Most \s-1DNS\s0 queries (with some exceptions) are subject to dns_query_restriction. A domain to be queried is successively stripped-off of its leading labels (thus yielding a series of its parent domains), and on each iteration a check is made against an associative array generated by dns_query_restriction options. Search stops at the first match (i.e. the tightest match), and the matching entry with its \f(CW\*(C`allow\*(C'\fR or \f(CW\*(C`deny\*(C'\fR value then controls whether a \&\s-1DNS\s0 query is allowed to be launched. .Sp If no match is found an implicit default is to allow a query. The purpose of an explicit \f(CW\*(C`allow\*(C'\fR entry is to be able to override a previously configured \&\f(CW\*(C`deny\*(C'\fR on the same domain or to override an entry (possibly yet to be configured in subsequent config directives) on one of its parent domains. Thus an 'allow zen.spamhaus.org' with a 'deny spamhaus.org' would permit \&\s-1DNS\s0 queries on a specific \s-1DNS BL\s0 zone but deny queries to other zones under the same parent domain. .Sp Domains are matched case-insensitively, no wildcards are recognized, there should be no leading or trailing dot. .Sp Specifying a block on querying a domain name has a similar effect as setting a score of corresponding \s-1DNSBL\s0 and \s-1URIBL\s0 rules to zero, and can be a handy alternative to hunting for such rules when a site policy does not allow certain \s-1DNS\s0 block lists to be queried. .Sp Example: dns_query_restriction deny dnswl.org surbl.org dns_query_restriction allow zen.spamhaus.org dns_query_restriction deny spamhaus.org mailspike.net spamcop.net .IP "clear_dns_query_restriction" 4 .IX Item "clear_dns_query_restriction" The option removes any entries entered by previous 'dns_query_restriction' options, leaving the list empty, i.e. allowing \s-1DNS\s0 queries for any domain (including any \s-1DNS BL\s0 zone). .SS "\s-1LEARNING OPTIONS\s0" .IX Subsection "LEARNING OPTIONS" .IP "use_learner ( 0 | 1 ) (default: 1)" 4 .IX Item "use_learner ( 0 | 1 ) (default: 1)" Whether to use any machine-learning classifiers with SpamAssassin, such as the default 'BAYES_*' rules. Setting this to 0 will disable use of any and all human-trained classifiers. .IP "use_bayes ( 0 | 1 ) (default: 1)" 4 .IX Item "use_bayes ( 0 | 1 ) (default: 1)" Whether to use the naive-Bayesian-style classifier built into SpamAssassin. This is a master on/off switch for all Bayes-related operations. .IP "use_bayes_rules ( 0 | 1 ) (default: 1)" 4 .IX Item "use_bayes_rules ( 0 | 1 ) (default: 1)" Whether to use rules using the naive-Bayesian-style classifier built into SpamAssassin. This allows you to disable the rules while leaving auto and manual learning enabled. .IP "bayes_auto_learn ( 0 | 1 ) (default: 1)" 4 .IX Item "bayes_auto_learn ( 0 | 1 ) (default: 1)" Whether SpamAssassin should automatically feed high-scoring mails (or low-scoring mails, for non-spam) into its learning systems. The only learning system supported currently is a naive-Bayesian-style classifier. .Sp See the documentation for the \&\f(CW\*(C`Mail::SpamAssassin::Plugin::AutoLearnThreshold\*(C'\fR plugin module for details on how Bayes auto-learning is implemented by default. .IP "bayes_token_sources (default: header visible invisible uri)" 4 .IX Item "bayes_token_sources (default: header visible invisible uri)" Controls which sources in a mail message can contribute tokens (e.g. words, phrases, etc.) to a Bayes classifier. The argument is a space-separated list of keywords: \fIheader\fR, \fIvisible\fR, \fIinvisible\fR, \fIuri\fR, \fImimepart\fR), each of which may be prefixed by a \fIno\fR to indicate its exclusion. Additionally two reserved keywords are allowed: \fIall\fR and \fInone\fR (or: \fInoall\fR). The list of keywords is processed sequentially: a keyword \fIall\fR adds all available keywords to a set being built, a \fInone\fR or \fInoall\fR clears the set, other non-negated keywords are added to the set, and negated keywords are removed from the set. Keywords are case-insensitive. .Sp The default set is: \fIheader\fR \fIvisible\fR \fIinvisible\fR \fIuri\fR, which is equivalent for example to: \fIAll\fR \fINoMIMEpart\fR. The reason why \fImimepart\fR is not currently in a default set is that it is a newer source (introduced with SpamAssassin version 3.4.1) and not much experience has yet been gathered regarding its usefulness. .Sp See also option \f(CW\*(C`bayes_ignore_header\*(C'\fR for a fine-grained control on individual header fields under the umbrella of a more general keyword \fIheader\fR here. .Sp Keywords imply the following data sources: .RS 4 .IP "\fIheader\fR \- tokens collected from a message header section" 4 .IX Item "header - tokens collected from a message header section" .PD 0 .IP "\fIvisible\fR \- words from visible text (plain or \s-1HTML\s0) in a message body" 4 .IX Item "visible - words from visible text (plain or HTML) in a message body" .IP "\fIinvisible\fR \- hidden/invisible text in \s-1HTML\s0 parts of a message body" 4 .IX Item "invisible - hidden/invisible text in HTML parts of a message body" .IP "\fIuri\fR \- URIs collected from a message body" 4 .IX Item "uri - URIs collected from a message body" .IP "\fImimepart\fR \- digests (hashes) of all \s-1MIME\s0 parts (textual or non-textual) of a message, computed after Base64 and quoted-printable decoding, suffixed by their Content-Type" 4 .IX Item "mimepart - digests (hashes) of all MIME parts (textual or non-textual) of a message, computed after Base64 and quoted-printable decoding, suffixed by their Content-Type" .IP "\fIall\fR \- adds all the above keywords to the set being assembled" 4 .IX Item "all - adds all the above keywords to the set being assembled" .IP "\fInone\fR or \fInoall\fR \- removes all keywords from the set" 4 .IX Item "none or noall - removes all keywords from the set" .RE .RS 4 .PD .Sp The \f(CW\*(C`bayes_token_sources\*(C'\fR directive may appear multiple times, its keywords are interpreted sequentially, adding or removing items from the final set as they appear in their order in \f(CW\*(C`bayes_token_sources\*(C'\fR directive(s). .RE .IP "bayes_ignore_header header_name" 4 .IX Item "bayes_ignore_header header_name" If you receive mail filtered by upstream mail systems, like a spam-filtering \s-1ISP\s0 or mailing list, and that service adds new headers (as most of them do), these headers may provide inappropriate cues to the Bayesian classifier, allowing it to take a \*(L"short cut\*(R". To avoid this, list the headers using this setting. Example: .Sp .Vb 2 \& bayes_ignore_header X\-Upstream\-Spamfilter \& bayes_ignore_header X\-Upstream\-SomethingElse .Ve .IP "bayes_ignore_from user@example.com" 4 .IX Item "bayes_ignore_from user@example.com" Bayesian classification and autolearning will not be performed on mail from the listed addresses. Program \f(CW\*(C`sa\-learn\*(C'\fR will also ignore the listed addresses if it is invoked using the \f(CW\*(C`\-\-use\-ignores\*(C'\fR option. One or more addresses can be listed, see \f(CW\*(C`whitelist_from\*(C'\fR. .Sp Spam messages from certain senders may contain many words that frequently occur in ham. For example, one might read messages from a preferred bookstore but also get unwanted spam messages from other bookstores. If the unwanted messages are learned as spam then any messages discussing books, including the preferred bookstore and antiquarian messages would be in danger of being marked as spam. The addresses of the annoying bookstores would be listed. (Assuming they were halfway legitimate and didn't send you mail through myriad affiliates.) .Sp Those who have pieces of spam in legitimate messages or otherwise receive ham messages containing potentially spammy words might fear that some spam messages might be in danger of being marked as ham. The addresses of the spam mailing lists, correspondents, etc. would be listed. .IP "bayes_ignore_to user@example.com" 4 .IX Item "bayes_ignore_to user@example.com" Bayesian classification and autolearning will not be performed on mail to the listed addresses. See \f(CW\*(C`bayes_ignore_from\*(C'\fR for details. .IP "bayes_min_ham_num (Default: 200)" 4 .IX Item "bayes_min_ham_num (Default: 200)" .PD 0 .IP "bayes_min_spam_num (Default: 200)" 4 .IX Item "bayes_min_spam_num (Default: 200)" .PD To be accurate, the Bayes system does not activate until a certain number of ham (non-spam) and spam have been learned. The default is 200 of each ham and spam, but you can tune these up or down with these two settings. .IP "bayes_learn_during_report (Default: 1)" 4 .IX Item "bayes_learn_during_report (Default: 1)" The Bayes system will, by default, learn any reported messages (\f(CW\*(C`spamassassin \-r\*(C'\fR) as spam. If you do not want this to happen, set this option to 0. .IP "bayes_sql_override_username" 4 .IX Item "bayes_sql_override_username" Used by BayesStore::SQL storage implementation. .Sp If this options is set the BayesStore::SQL module will override the set username with the value given. This could be useful for implementing global or group bayes databases. .IP "bayes_use_hapaxes (default: 1)" 4 .IX Item "bayes_use_hapaxes (default: 1)" Should the Bayesian classifier use hapaxes (words/tokens that occur only once) when classifying? This produces significantly better hit-rates. .IP "bayes_journal_max_size (default: 102400)" 4 .IX Item "bayes_journal_max_size (default: 102400)" SpamAssassin will opportunistically sync the journal and the database. It will do so once a day, but will sync more often if the journal file size goes above this setting, in bytes. If set to 0, opportunistic syncing will not occur. .IP "bayes_expiry_max_db_size (default: 150000)" 4 .IX Item "bayes_expiry_max_db_size (default: 150000)" What should be the maximum size of the Bayes tokens database? When expiry occurs, the Bayes system will keep either 75% of the maximum value, or 100,000 tokens, whichever has a larger value. 150,000 tokens is roughly equivalent to a 8Mb database file. .IP "bayes_auto_expire (default: 1)" 4 .IX Item "bayes_auto_expire (default: 1)" If enabled, the Bayes system will try to automatically expire old tokens from the database. Auto-expiry occurs when the number of tokens in the database surpasses the bayes_expiry_max_db_size value. If a bayes datastore backend does not implement individual key/value expirations, the setting is silently ignored. .IP "bayes_token_ttl (default: 3w, i.e. 3 weeks)" 4 .IX Item "bayes_token_ttl (default: 3w, i.e. 3 weeks)" Time-to-live / expiration time in seconds for tokens kept in a Bayes database. A numeric value is optionally suffixed by a time unit (s, m, h, d, w, indicating seconds (default), minutes, hours, days, weeks). .Sp If bayes_auto_expire is true and a Bayes datastore backend supports it (currently only Redis), this setting controls deletion of expired tokens from a bayes database. The value is observed on a best-effort basis, exact timing promises are not necessarily kept. If a bayes datastore backend does not implement individual key/value expirations, the setting is silently ignored. .IP "bayes_seen_ttl (default: 8d, i.e. 8 days)" 4 .IX Item "bayes_seen_ttl (default: 8d, i.e. 8 days)" Time-to-live / expiration time in seconds for 'seen' entries (i.e. mail message digests with their status) kept in a Bayes database. A numeric value is optionally suffixed by a time unit (s, m, h, d, w, indicating seconds (default), minutes, hours, days, weeks). .Sp If bayes_auto_expire is true and a Bayes datastore backend supports it (currently only Redis), this setting controls deletion of expired 'seen' entries from a bayes database. The value is observed on a best-effort basis, exact timing promises are not necessarily kept. If a bayes datastore backend does not implement individual key/value expirations, the setting is silently ignored. .IP "bayes_learn_to_journal (default: 0)" 4 .IX Item "bayes_learn_to_journal (default: 0)" If this option is set, whenever SpamAssassin does Bayes learning, it will put the information into the journal instead of directly into the database. This lowers contention for locking the database to execute an update, but will also cause more access to the journal and cause a delay before the updates are actually committed to the Bayes database. .SS "\s-1MISCELLANEOUS OPTIONS\s0" .IX Subsection "MISCELLANEOUS OPTIONS" .IP "time_limit n (default: 300)" 4 .IX Item "time_limit n (default: 300)" Specifies a limit on elapsed time in seconds that SpamAssassin is allowed to spend before providing a result. The value may be fractional and must not be negative, zero is interpreted as unlimited. The default is 300 seconds for consistency with the spamd default setting of \-\-timeout\-child . .Sp This is a best-effort advisory setting, processing will not be abruptly aborted at an arbitrary point in processing when the time limit is exceeded, but only on reaching one of locations in the program flow equipped with a time test. Currently equipped with the test are the main checking loop, asynchronous \s-1DNS\s0 lookups, plugins which are calling external programs. Rule evaluation is guarded by starting a timer (alarm) on each set of compiled rules. .Sp When a message is passed to Mail::SpamAssassin::parse, a deadline time is established as a sum of current time and the \f(CW\*(C`time_limit\*(C'\fR setting. .Sp This deadline may also be specified by a caller through an option \&'master_deadline' in \f(CW$suppl_attrib\fR on a call to \fIparse()\fR, possibly providing a more accurate deadline taking into account past and expected future processing of a message in a mail filtering setup. If both the config option as well as a 'master_deadline' option in a call are provided, the shorter time limit of the two is used (since version 3.3.2). Note that spamd (and possibly third-party callers of SpamAssassin) will supply the 'master_deadline' option in a call based on its \-\-timeout\-child option (or equivalent), unlike the command line \f(CW\*(C`spamassassin\*(C'\fR, which has no such command line option. .Sp When a time limit is exceeded, most of the remaining tests will be skipped, as well as auto-learning. Whatever tests fired so far will determine the final score. The behaviour is similar to short-circuiting with attribute 'on', as implemented by a Shortcircuit plugin. A synthetic hit on a rule named \&\s-1TIME_LIMIT_EXCEEDED\s0 with a near-zero default score is generated, so that the report will reflect the event. A score for \s-1TIME_LIMIT_EXCEEDED\s0 may be provided explicitly in a configuration file, for example to achieve whitelisting or blacklisting effect for messages with long processing times. .Sp The \f(CW\*(C`time_limit\*(C'\fR option is a useful protection against excessive processing time on certain degenerate or unusually long or complex mail messages, as well as against some DoS attacks. It is also needed in time-critical pre-queue filtering setups (e.g. milter, proxy, integration with \s-1MTA\s0), where message processing must finish before a \s-1SMTP\s0 client times out. \s-1RFC 5321\s0 prescribes in section 4.5.3.2.6 the '\s-1DATA\s0 Termination' time limit of 10 minutes, although it is not unusual to see some \s-1SMTP\s0 clients abort sooner on waiting for a response. A sensible \f(CW\*(C`time_limit\*(C'\fR for a pre-queue filtering setup is maybe 50 seconds, assuming that clients are willing to wait at least a minute. .IP "lock_method type" 4 .IX Item "lock_method type" Select the file-locking method used to protect database files on-disk. By default, SpamAssassin uses an NFS-safe locking method on \s-1UNIX\s0; however, if you are sure that the database files you'll be using for Bayes and \s-1AWL\s0 storage will never be accessed over \s-1NFS,\s0 a non-NFS-safe locking system can be selected. .Sp This will be quite a bit faster, but may risk file corruption if the files are ever accessed by multiple clients at once, and one or more of them is accessing them through an \s-1NFS\s0 filesystem. .Sp Note that different platforms require different locking systems. .Sp The supported locking systems for \f(CW\*(C`type\*(C'\fR are as follows: .RS 4 .IP "\fInfssafe\fR \- an NFS-safe locking system" 4 .IX Item "nfssafe - an NFS-safe locking system" .PD 0 .ie n .IP "\fIflock\fR \- simple \s-1UNIX \s0""flock()"" locking" 4 .el .IP "\fIflock\fR \- simple \s-1UNIX \s0\f(CWflock()\fR locking" 4 .IX Item "flock - simple UNIX flock() locking" .ie n .IP "\fIwin32\fR \- Win32 locking using ""sysopen (..., O_CREAT|O_EXCL)""." 4 .el .IP "\fIwin32\fR \- Win32 locking using \f(CWsysopen (..., O_CREAT|O_EXCL)\fR." 4 .IX Item "win32 - Win32 locking using sysopen (..., O_CREAT|O_EXCL)." .RE .RS 4 .PD .Sp nfssafe and flock are only available on \s-1UNIX,\s0 and win32 is only available on Windows. By default, SpamAssassin will choose either nfssafe or win32 depending on the platform in use. .RE .IP "fold_headers ( 0 | 1 ) (default: 1)" 4 .IX Item "fold_headers ( 0 | 1 ) (default: 1)" By default, headers added by SpamAssassin will be whitespace folded. In other words, they will be broken up into multiple lines instead of one very long one and each continuation line will have a tabulator prepended to mark it as a continuation of the preceding one. .Sp The automatic wrapping can be disabled here. Note that this can generate very long lines. \s-1RFC 2822\s0 required that header lines do not exceed 998 characters (not counting the final \s-1CRLF\s0). .IP "report_safe_copy_headers header_name ..." 4 .IX Item "report_safe_copy_headers header_name ..." If using \f(CW\*(C`report_safe\*(C'\fR, a few of the headers from the original message are copied into the wrapper header (From, To, Cc, Subject, Date, etc.) If you want to have other headers copied as well, you can add them using this option. You can specify multiple headers on the same line, separated by spaces, or you can just use multiple lines. .IP "envelope_sender_header Name-Of-Header" 4 .IX Item "envelope_sender_header Name-Of-Header" SpamAssassin will attempt to discover the address used in the '\s-1MAIL FROM:\s0' phase of the \s-1SMTP\s0 transaction that delivered this message, if this data has been made available by the \s-1SMTP\s0 server. This is used in the \f(CW\*(C`EnvelopeFrom\*(C'\fR pseudo-header, and for various rules such as \s-1SPF\s0 checking. .Sp By default, various MTAs will use different headers, such as the following: .Sp .Vb 4 \& X\-Envelope\-From \& Envelope\-Sender \& X\-Sender \& Return\-Path .Ve .Sp SpamAssassin will attempt to use these, if some heuristics (such as the header placement in the message, or the absence of fetchmail signatures) appear to indicate that they are safe to use. However, it may choose the wrong headers in some mailserver configurations. (More discussion of this can be found in bug 2142 and bug 4747 in the SpamAssassin BugZilla.) .Sp To avoid this heuristic failure, the \f(CW\*(C`envelope_sender_header\*(C'\fR setting may be helpful. Name the header that your \s-1MTA\s0 or \s-1MDA\s0 adds to messages containing the address used at the \s-1MAIL FROM\s0 step of the \s-1SMTP\s0 transaction. .Sp If the header in question contains \f(CW\*(C`<\*(C'\fR or \f(CW\*(C`>\*(C'\fR characters at the start and end of the email address in the right-hand side, as in the \s-1SMTP\s0 transaction, these will be stripped. .Sp If the header is not found in a message, or if it's value does not contain an \&\f(CW\*(C`@\*(C'\fR sign, SpamAssassin will issue a warning in the logs and fall back to its default heuristics. .Sp (Note for \s-1MTA\s0 developers: we would prefer if the use of a single header be avoided in future, since that precludes 'downstream' spam scanning. \&\f(CW\*(C`http://wiki.apache.org/spamassassin/EnvelopeSenderInReceived\*(C'\fR details a better proposal, storing the envelope sender at each hop in the \f(CW\*(C`Received\*(C'\fR header.) .Sp example: .Sp .Vb 1 \& envelope_sender_header X\-SA\-Exim\-Mail\-From .Ve .IP "describe \s-1SYMBOLIC_TEST_NAME\s0 description ..." 4 .IX Item "describe SYMBOLIC_TEST_NAME description ..." Used to describe a test. This text is shown to users in the detailed report. .Sp Note that test names which begin with '_\|_' are reserved for meta-match sub-rules, and are not scored or listed in the 'tests hit' reports. .Sp Also note that by convention, rule descriptions should be limited in length to no more than 50 characters. .IP "report_charset \s-1CHARSET \s0(default: unset)" 4 .IX Item "report_charset CHARSET (default: unset)" Set the \s-1MIME\s0 Content-Type charset used for the text/plain report which is attached to spam mail messages. .IP "report ...some text for a report..." 4 .IX Item "report ...some text for a report..." Set the report template which is attached to spam mail messages. See the \&\f(CW\*(C`10_default_prefs.cf\*(C'\fR configuration file in \f(CW\*(C`/usr/share/spamassassin\*(C'\fR for an example. .Sp If you change this, try to keep it under 78 columns. Each \f(CW\*(C`report\*(C'\fR line appends to the existing template, so use \f(CW\*(C`clear_report_template\*(C'\fR to restart. .Sp Tags can be included as explained above. .IP "clear_report_template" 4 .IX Item "clear_report_template" Clear the report template. .IP "report_contact ...text of contact address..." 4 .IX Item "report_contact ...text of contact address..." Set what _CONTACTADDRESS_ is replaced with in the above report text. By default, this is 'the administrator of that system', since the hostname of the system the scanner is running on is also included. .IP "report_hostname ...hostname to use..." 4 .IX Item "report_hostname ...hostname to use..." Set what _HOSTNAME_ is replaced with in the above report text. By default, this is determined dynamically as whatever the host running SpamAssassin calls itself. .IP "unsafe_report ...some text for a report..." 4 .IX Item "unsafe_report ...some text for a report..." Set the report template which is attached to spam mail messages which contain a non\-text/plain part. See the \f(CW\*(C`10_default_prefs.cf\*(C'\fR configuration file in \&\f(CW\*(C`/usr/share/spamassassin\*(C'\fR for an example. .Sp Each \f(CW\*(C`unsafe\-report\*(C'\fR line appends to the existing template, so use \&\f(CW\*(C`clear_unsafe_report_template\*(C'\fR to restart. .Sp Tags can be used in this template (see above for details). .IP "clear_unsafe_report_template" 4 .IX Item "clear_unsafe_report_template" Clear the unsafe_report template. .IP "mbox_format_from_regex" 4 .IX Item "mbox_format_from_regex" Set a specific regular expression to be used for mbox file From separators. .Sp For example, this setting will allow sa-learn to process emails stored in a kmail 2 mbox: .Sp mbox_format_from_regex /^From \eS+ ?[[:upper:]][[:lower:]]{2}(?:, \ed\ed [[:upper:]][[:lower:]]{2} \ed{4} [0\-2]\ed:\ed\ed:\ed\ed [+\-]\ed{4}| [[:upper:]][[:lower:]]{2} [ 1\-3]\ed [ 0\-2]\ed:\ed\ed:\ed\ed \ed{4})/ .IP "parse_dkim_uris ( 0 | 1 ) (default: 0)" 4 .IX Item "parse_dkim_uris ( 0 | 1 ) (default: 0)" If this option is set to 1 and the message contains \s-1DKIM\s0 headers, the headers will be parsed for URIs to process alongside URIs found in the body with some rules and moduels (ex. \s-1URIDNSBL\s0) .SH "RULE DEFINITIONS AND PRIVILEGED SETTINGS" .IX Header "RULE DEFINITIONS AND PRIVILEGED SETTINGS" These settings differ from the ones above, in that they are considered \&'privileged'. Only users running \f(CW\*(C`spamassassin\*(C'\fR from their procmailrc's or forward files, or sysadmins editing a file in \f(CW\*(C`/etc/mail/spamassassin\*(C'\fR, can use them. \f(CW\*(C`spamd\*(C'\fR users cannot use them in their \f(CW\*(C`user_prefs\*(C'\fR files, for security and efficiency reasons, unless \f(CW\*(C`allow_user_rules\*(C'\fR is enabled (and then, they may only add rules from below). .IP "allow_user_rules ( 0 | 1 ) (default: 0)" 4 .IX Item "allow_user_rules ( 0 | 1 ) (default: 0)" This setting allows users to create rules (and only rules) in their \&\f(CW\*(C`user_prefs\*(C'\fR files for use with \f(CW\*(C`spamd\*(C'\fR. It defaults to off, because this could be a severe security hole. It may be possible for users to gain root level access if \f(CW\*(C`spamd\*(C'\fR is run as root. It is \s-1NOT\s0 a good idea, unless you have some other way of ensuring that users' tests are safe. Don't use this unless you are certain you know what you are doing. Furthermore, this option causes spamassassin to recompile all the tests each time it processes a message for a user with a rule in his/her \f(CW\*(C`user_prefs\*(C'\fR file, which could have a significant effect on server load. It is not recommended. .Sp Note that it is not currently possible to use \f(CW\*(C`allow_user_rules\*(C'\fR to modify an existing system rule from a \f(CW\*(C`user_prefs\*(C'\fR file with \f(CW\*(C`spamd\*(C'\fR. .IP "redirector_pattern /pattern/modifiers" 4 .IX Item "redirector_pattern /pattern/modifiers" A regex pattern that matches both the redirector site portion, and the target site portion of a \s-1URI.\s0 .Sp Note: The target \s-1URI\s0 portion must be surrounded in parentheses and no other part of the pattern may create a backreference. .Sp Example: http://chkpt.zdnet.com/chkpt/whatever/spammer.domain/yo/dude .Sp .Vb 1 \& redirector_pattern /^https?:\e/\e/(?:opt\e.)?chkpt\e.zdnet\e.com\e/chkpt\e/\ew+\e/(.*)$/i .Ve .IP "header \s-1SYMBOLIC_TEST_NAME\s0 header op /pattern/modifiers [if\-unset: \s-1STRING\s0]" 4 .IX Item "header SYMBOLIC_TEST_NAME header op /pattern/modifiers [if-unset: STRING]" Define a test. \f(CW\*(C`SYMBOLIC_TEST_NAME\*(C'\fR is a symbolic test name, such as \&'\s-1FROM_ENDS_IN_NUMS\s0'. \f(CW\*(C`header\*(C'\fR is the name of a mail header field, such as 'Subject', 'To', 'From', etc. Header field names are matched case-insensitively (conforming to \s-1RFC 5322\s0 section 1.2.2), except for all-capitals metaheader fields such as \s-1ALL, MESSAGEID,\s0 ALL-TRUSTED. .Sp Appending a modifier \f(CW\*(C`:raw\*(C'\fR to a header field name will inhibit decoding of quoted-printable or base\-64 encoded strings, and will preserve all whitespace inside the header string. The \f(CW\*(C`:raw\*(C'\fR may also be applied to pseudo-headers e.g. \f(CW\*(C`ALL:raw\*(C'\fR will return a pristine (unmodified) header section. .Sp Appending a modifier \f(CW\*(C`:addr\*(C'\fR to a header field name will cause everything except the first email address to be removed from the header field. It is mainly applicable to header fields 'From', 'Sender', 'To', 'Cc' along with their 'Resent\-*' counterparts, and the 'Return\-Path'. .Sp Appending a modifier \f(CW\*(C`:name\*(C'\fR to a header field name will cause everything except the first display name to be removed from the header field. It is mainly applicable to header fields containing a single mail address: 'From', \&'Sender', along with their 'Resent\-From' and 'Resent\-Sender' counterparts. .Sp It is syntactically permitted to append more than one modifier to a header field name, although currently most combinations achieve no additional effect, for example \f(CW\*(C`From:addr:raw\*(C'\fR or \f(CW\*(C`From:raw:addr\*(C'\fR is currently the same as \&\f(CW\*(C`From:addr\*(C'\fR . .Sp For example, appending \f(CW\*(C`:addr\*(C'\fR to a header name will result in example@foo in all of the following cases: .RS 4 .IP "example@foo" 4 .IX Item "example@foo" .PD 0 .IP "example@foo (Foo Blah)" 4 .IX Item "example@foo (Foo Blah)" .IP "example@foo, example@bar" 4 .IX Item "example@foo, example@bar" .IP "display: example@foo (Foo Blah), example@bar ;" 4 .IX Item "display: example@foo (Foo Blah), example@bar ;" .IP "Foo Blah <example@foo>" 4 .IX Item "Foo Blah <example@foo>" .ie n .IP """Foo Blah"" <example@foo>" 4 .el .IP "``Foo Blah'' <example@foo>" 4 .IX Item "Foo Blah <example@foo>" .ie n .IP """'Foo Blah'"" <example@foo>" 4 .el .IP "``'Foo Blah''' <example@foo>" 4 .IX Item "'Foo Blah' <example@foo>" .RE .RS 4 .PD .Sp For example, appending \f(CW\*(C`:name\*(C'\fR to a header name will result in \*(L"Foo Blah\*(R" (without quotes) in all of the following cases: .IP "example@foo (Foo Blah)" 4 .IX Item "example@foo (Foo Blah)" .PD 0 .IP "example@foo (Foo Blah), example@bar" 4 .IX Item "example@foo (Foo Blah), example@bar" .IP "display: example@foo (Foo Blah), example@bar ;" 4 .IX Item "display: example@foo (Foo Blah), example@bar ;" .IP "Foo Blah <example@foo>" 4 .IX Item "Foo Blah <example@foo>" .ie n .IP """Foo Blah"" <example@foo>" 4 .el .IP "``Foo Blah'' <example@foo>" 4 .IX Item "Foo Blah <example@foo>" .ie n .IP """'Foo Blah'"" <example@foo>" 4 .el .IP "``'Foo Blah''' <example@foo>" 4 .IX Item "'Foo Blah' <example@foo>" .RE .RS 4 .PD .Sp There are several special pseudo-headers that can be specified: .ie n .IP """ALL"" can be used to mean the text of all the message's headers. Note that all whitespace inside the headers, at line folds, is currently compressed into a single space (' ') character. To obtain a pristine (unmodified) header section, use ""ALL:raw"" \- the :raw modifier is documented above." 4 .el .IP "\f(CWALL\fR can be used to mean the text of all the message's headers. Note that all whitespace inside the headers, at line folds, is currently compressed into a single space (' ') character. To obtain a pristine (unmodified) header section, use \f(CWALL:raw\fR \- the :raw modifier is documented above." 4 .IX Item "ALL can be used to mean the text of all the message's headers. Note that all whitespace inside the headers, at line folds, is currently compressed into a single space (' ') character. To obtain a pristine (unmodified) header section, use ALL:raw - the :raw modifier is documented above." .PD 0 .ie n .IP """ToCc"" can be used to mean the contents of both the 'To' and 'Cc' headers." 4 .el .IP "\f(CWToCc\fR can be used to mean the contents of both the 'To' and 'Cc' headers." 4 .IX Item "ToCc can be used to mean the contents of both the 'To' and 'Cc' headers." .ie n .IP """EnvelopeFrom"" is the address used in the '\s-1MAIL FROM:\s0' phase of the \s-1SMTP\s0 transaction that delivered this message, if this data has been made available by the \s-1SMTP\s0 server. See ""envelope_sender_header"" for more information on how to set this." 4 .el .IP "\f(CWEnvelopeFrom\fR is the address used in the '\s-1MAIL FROM:\s0' phase of the \s-1SMTP\s0 transaction that delivered this message, if this data has been made available by the \s-1SMTP\s0 server. See \f(CWenvelope_sender_header\fR for more information on how to set this." 4 .IX Item "EnvelopeFrom is the address used in the 'MAIL FROM:' phase of the SMTP transaction that delivered this message, if this data has been made available by the SMTP server. See envelope_sender_header for more information on how to set this." .ie n .IP """MESSAGEID"" is a symbol meaning all Message-Id's found in the message; some mailing list software moves the real 'Message\-Id' to 'Resent\-Message\-Id' or to 'X\-Message\-Id', then uses its own one in the 'Message\-Id' header. The value returned for this symbol is the text from all 3 headers, separated by newlines." 4 .el .IP "\f(CWMESSAGEID\fR is a symbol meaning all Message-Id's found in the message; some mailing list software moves the real 'Message\-Id' to 'Resent\-Message\-Id' or to 'X\-Message\-Id', then uses its own one in the 'Message\-Id' header. The value returned for this symbol is the text from all 3 headers, separated by newlines." 4 .IX Item "MESSAGEID is a symbol meaning all Message-Id's found in the message; some mailing list software moves the real 'Message-Id' to 'Resent-Message-Id' or to 'X-Message-Id', then uses its own one in the 'Message-Id' header. The value returned for this symbol is the text from all 3 headers, separated by newlines." .ie n .IP """X\-Spam\-Relays\-Untrusted"", ""X\-Spam\-Relays\-Trusted"", ""X\-Spam\-Relays\-Internal"" and ""X\-Spam\-Relays\-External"" represent a portable, pre-parsed representation of the message's network path, as recorded in the Received headers, divided into 'trusted' vs 'untrusted' and 'internal' vs 'external' sets. See ""http://wiki.apache.org/spamassassin/TrustedRelays"" for more details." 4 .el .IP "\f(CWX\-Spam\-Relays\-Untrusted\fR, \f(CWX\-Spam\-Relays\-Trusted\fR, \f(CWX\-Spam\-Relays\-Internal\fR and \f(CWX\-Spam\-Relays\-External\fR represent a portable, pre-parsed representation of the message's network path, as recorded in the Received headers, divided into 'trusted' vs 'untrusted' and 'internal' vs 'external' sets. See \f(CWhttp://wiki.apache.org/spamassassin/TrustedRelays\fR for more details." 4 .IX Item "X-Spam-Relays-Untrusted, X-Spam-Relays-Trusted, X-Spam-Relays-Internal and X-Spam-Relays-External represent a portable, pre-parsed representation of the message's network path, as recorded in the Received headers, divided into 'trusted' vs 'untrusted' and 'internal' vs 'external' sets. See http://wiki.apache.org/spamassassin/TrustedRelays for more details." .RE .RS 4 .PD .Sp \&\f(CW\*(C`op\*(C'\fR is either \f(CW\*(C`=~\*(C'\fR (contains regular expression) or \f(CW\*(C`!~\*(C'\fR (does not contain regular expression), and \f(CW\*(C`pattern\*(C'\fR is a valid Perl regular expression, with \&\f(CW\*(C`modifiers\*(C'\fR as regexp modifiers in the usual style. Note that multi-line rules are not supported, even if you use \f(CW\*(C`x\*(C'\fR as a modifier. Also note that the \f(CW\*(C`#\*(C'\fR character must be escaped (\f(CW\*(C`\e#\*(C'\fR) or else it will be considered to be the start of a comment and not part of the regexp. .Sp If the \f(CW\*(C`[if\-unset: STRING]\*(C'\fR tag is present, then \f(CW\*(C`STRING\*(C'\fR will be used if the header is not found in the mail message. .Sp Test names must not start with a number, and must contain only alphanumerics and underscores. It is suggested that lower-case characters not be used, and names have a length of no more than 22 characters, as an informal convention. Dashes are not allowed. .Sp Note that test names which begin with '_\|_' are reserved for meta-match sub-rules, and are not scored or listed in the 'tests hit' reports. Test names which begin with 'T_' are reserved for tests which are undergoing \s-1QA,\s0 and these are given a very low score. .Sp If you add or modify a test, please be sure to run a sanity check afterwards by running \f(CW\*(C`spamassassin \-\-lint\*(C'\fR. This will avoid confusing error messages, or other tests being skipped as a side-effect. .RE .IP "header \s-1SYMBOLIC_TEST_NAME\s0 exists:header_field_name" 4 .IX Item "header SYMBOLIC_TEST_NAME exists:header_field_name" Define a header field existence test. \f(CW\*(C`header_field_name\*(C'\fR is the name of a header field to test for existence. Not to be confused with a test for a nonempty header field body, which can be implemented by a \&\f(CW\*(C`header SYMBOLIC_TEST_NAME header =~ /\eS/\*(C'\fR rule as described above. .IP "header \s-1SYMBOLIC_TEST_NAME\s0 eval:name_of_eval_method([arguments])" 4 .IX Item "header SYMBOLIC_TEST_NAME eval:name_of_eval_method([arguments])" Define a header eval test. \f(CW\*(C`name_of_eval_method\*(C'\fR is the name of a method on the \f(CW\*(C`Mail::SpamAssassin::EvalTests\*(C'\fR object. \f(CW\*(C`arguments\*(C'\fR are optional arguments to the function call. .IP "header \s-1SYMBOLIC_TEST_NAME\s0 eval:check_rbl('set', 'zone' [, 'sub\-test'])" 4 .IX Item "header SYMBOLIC_TEST_NAME eval:check_rbl('set', 'zone' [, 'sub-test'])" Check a \s-1DNSBL \s0(a \s-1DNS\s0 blacklist or whitelist). This will retrieve Received: headers from the message, extract the \s-1IP\s0 addresses, select which ones are \&'untrusted' based on the \f(CW\*(C`trusted_networks\*(C'\fR logic, and query that \s-1DNSBL\s0 zone. There's a few things to note: .RS 4 .IP "duplicated or private IPs" 4 .IX Item "duplicated or private IPs" Duplicated IPs are only queried once and reserved IPs are not queried. Private IPs are those listed in <http://www.iana.org/assignments/ipv4\-address\-space>, <http://duxcw.com/faq/network/privip.htm>, <http://duxcw.com/faq/network/autoip.htm>, or <http://tools.ietf.org/html/rfc5735> as private. .IP "the 'set' argument" 4 .IX Item "the 'set' argument" This is used as a 'zone \s-1ID\s0'. If you want to look up a multiple-meaning zone like \s-1SORBS,\s0 you can then query the results from that zone using it; but all \fIcheck_rbl_sub()\fR calls must use that zone \s-1ID.\s0 .Sp Also, if more than one \s-1IP\s0 address gets a \s-1DNSBL\s0 hit for a particular rule, it does not affect the score because rules only trigger once per message. .IP "the 'zone' argument" 4 .IX Item "the 'zone' argument" This is the root zone of the \s-1DNSBL.\s0 .Sp The domain name is considered to be a fully qualified domain name (i.e. not subject to \s-1DNS\s0 resolver's search or default domain options). No trailing period is needed, and will be removed if specified. .IP "the 'sub\-test' argument" 4 .IX Item "the 'sub-test' argument" This optional argument behaves the same as the sub-test argument in \&\f(CW\*(C`check_rbl_sub()\*(C'\fR below. .IP "selecting all IPs except for the originating one" 4 .IX Item "selecting all IPs except for the originating one" This is accomplished by placing '\-notfirsthop' at the end of the set name. This is useful for querying against \s-1DNS\s0 lists which list dialup \s-1IP\s0 addresses; the first hop may be a dialup, but as long as there is at least one more hop, via their outgoing \s-1SMTP\s0 server, that's legitimate, and so should not gain points. If there is only one hop, that will be queried anyway, as it should be relaying via its outgoing \s-1SMTP\s0 server instead of sending directly to your \s-1MX \s0(mail exchange). .IP "selecting IPs by whether they are trusted" 4 .IX Item "selecting IPs by whether they are trusted" When checking a 'nice' \s-1DNSBL \s0(a \s-1DNS\s0 whitelist), you cannot trust the \s-1IP\s0 addresses in Received headers that were not added by trusted relays. To test the first \s-1IP\s0 address that can be trusted, place '\-firsttrusted' at the end of the set name. That should test the \s-1IP\s0 address of the relay that connected to the most remote trusted relay. .Sp Note that this requires that SpamAssassin know which relays are trusted. For simple cases, SpamAssassin can make a good estimate. For complex cases, you may get better results by setting \f(CW\*(C`trusted_networks\*(C'\fR manually. .Sp In addition, you can test all untrusted \s-1IP\s0 addresses by placing '\-untrusted' at the end of the set name. Important note \*(-- this does \s-1NOT\s0 include the \&\s-1IP\s0 address from the most recent 'untrusted line', as used in '\-firsttrusted' above. That's because we're talking about the trustworthiness of the \&\s-1IP\s0 address data, not the source header line, here; and in the case of the most recent header (the 'firsttrusted'), that data can be trusted. See the Wiki page at \f(CW\*(C`http://wiki.apache.org/spamassassin/TrustedRelays\*(C'\fR for more information on this. .IP "Selecting just the last external \s-1IP\s0" 4 .IX Item "Selecting just the last external IP" By using '\-lastexternal' at the end of the set name, you can select only the external host that connected to your internal network, or at least the last external host with a public \s-1IP.\s0 .RE .RS 4 .RE .IP "header \s-1SYMBOLIC_TEST_NAME\s0 eval:check_rbl_txt('set', 'zone')" 4 .IX Item "header SYMBOLIC_TEST_NAME eval:check_rbl_txt('set', 'zone')" Same as \fIcheck_rbl()\fR, except querying using \s-1IN TXT\s0 instead of \s-1IN A\s0 records. If the zone supports it, it will result in a line of text describing why the \s-1IP\s0 is listed, typically a hyperlink to a database entry. .IP "header \s-1SYMBOLIC_TEST_NAME\s0 eval:check_rbl_sub('set', 'sub\-test')" 4 .IX Item "header SYMBOLIC_TEST_NAME eval:check_rbl_sub('set', 'sub-test')" Create a sub-test for 'set'. If you want to look up a multi-meaning zone like relays.osirusoft.com, you can then query the results from that zone using the zone \s-1ID\s0 from the original query. The sub-test may either be an IPv4 dotted address for RBLs that return multiple A records or a non-negative decimal number to specify a bitmask for RBLs that return a single A record containing a bitmask of results, a SenderBase test beginning with \*(L"sb:\*(R", or (if none of the preceding options seem to fit) a regular expression. .Sp Note: the set name must be exactly the same for as the main query rule, including selections like '\-notfirsthop' appearing at the end of the set name. .IP "body \s-1SYMBOLIC_TEST_NAME\s0 /pattern/modifiers" 4 .IX Item "body SYMBOLIC_TEST_NAME /pattern/modifiers" Define a body pattern test. \f(CW\*(C`pattern\*(C'\fR is a Perl regular expression. Note: as per the header tests, \f(CW\*(C`#\*(C'\fR must be escaped (\f(CW\*(C`\e#\*(C'\fR) or else it is considered the beginning of a comment. .Sp The 'body' in this case is the textual parts of the message body; any non-text \s-1MIME\s0 parts are stripped, and the message decoded from Quoted-Printable or Base\-64\-encoded format if necessary. The message Subject header is considered part of the body and becomes the first paragraph when running the rules. All \s-1HTML\s0 tags and line breaks will be removed before matching. .IP "body \s-1SYMBOLIC_TEST_NAME\s0 eval:name_of_eval_method([args])" 4 .IX Item "body SYMBOLIC_TEST_NAME eval:name_of_eval_method([args])" Define a body eval test. See above. .IP "uri \s-1SYMBOLIC_TEST_NAME\s0 /pattern/modifiers" 4 .IX Item "uri SYMBOLIC_TEST_NAME /pattern/modifiers" Define a uri pattern test. \f(CW\*(C`pattern\*(C'\fR is a Perl regular expression. Note: as per the header tests, \f(CW\*(C`#\*(C'\fR must be escaped (\f(CW\*(C`\e#\*(C'\fR) or else it is considered the beginning of a comment. .Sp The 'uri' in this case is a list of all the URIs in the body of the email, and the test will be run on each and every one of those URIs, adjusting the score if a match is found. Use this test instead of one of the body tests when you need to match a \s-1URI,\s0 as it is more accurately bound to the start/end points of the \s-1URI,\s0 and will also be faster. .IP "rawbody \s-1SYMBOLIC_TEST_NAME\s0 /pattern/modifiers" 4 .IX Item "rawbody SYMBOLIC_TEST_NAME /pattern/modifiers" Define a raw-body pattern test. \f(CW\*(C`pattern\*(C'\fR is a Perl regular expression. Note: as per the header tests, \f(CW\*(C`#\*(C'\fR must be escaped (\f(CW\*(C`\e#\*(C'\fR) or else it is considered the beginning of a comment. .Sp The 'raw body' of a message is the raw data inside all textual parts. The text will be decoded from base64 or quoted-printable encoding, but \s-1HTML\s0 tags and line breaks will still be present. Multiline expressions will need to be used to match strings that are broken by line breaks. .IP "rawbody \s-1SYMBOLIC_TEST_NAME\s0 eval:name_of_eval_method([args])" 4 .IX Item "rawbody SYMBOLIC_TEST_NAME eval:name_of_eval_method([args])" Define a raw-body eval test. See above. .IP "full \s-1SYMBOLIC_TEST_NAME\s0 /pattern/modifiers" 4 .IX Item "full SYMBOLIC_TEST_NAME /pattern/modifiers" Define a full message pattern test. \f(CW\*(C`pattern\*(C'\fR is a Perl regular expression. Note: as per the header tests, \f(CW\*(C`#\*(C'\fR must be escaped (\f(CW\*(C`\e#\*(C'\fR) or else it is considered the beginning of a comment. .Sp The full message is the pristine message headers plus the pristine message body, including all \s-1MIME\s0 data such as images, other attachments, \s-1MIME\s0 boundaries, etc. .IP "full \s-1SYMBOLIC_TEST_NAME\s0 eval:name_of_eval_method([args])" 4 .IX Item "full SYMBOLIC_TEST_NAME eval:name_of_eval_method([args])" Define a full message eval test. See above. .IP "meta \s-1SYMBOLIC_TEST_NAME\s0 boolean expression" 4 .IX Item "meta SYMBOLIC_TEST_NAME boolean expression" Define a boolean expression test in terms of other tests that have been hit or not hit. For example: .Sp meta \s-1META1 TEST1 && \s0!(\s-1TEST2\s0 || \s-1TEST3\s0) .Sp Note that English language operators (\*(L"and\*(R", \*(L"or\*(R") will be treated as rule names, and that there is no \f(CW\*(C`XOR\*(C'\fR operator. .IP "meta \s-1SYMBOLIC_TEST_NAME\s0 boolean arithmetic expression" 4 .IX Item "meta SYMBOLIC_TEST_NAME boolean arithmetic expression" Can also define an arithmetic expression in terms of other tests, with an unhit test having the value \*(L"0\*(R" and a hit test having a nonzero value. The value of a hit meta test is that of its arithmetic expression. The value of a hit eval test is that returned by its method. The value of a hit header, body, rawbody, uri, or full test which has the \*(L"multiple\*(R" tflag is the number of times the test hit. The value of any other type of hit test is \*(L"1\*(R". .Sp For example: .Sp meta \s-1META2 \s0(3 * \s-1TEST1 \- 2\s0 * \s-1TEST2\s0) > 0 .Sp Note that Perl builtins and functions, like \f(CW\*(C`abs()\*(C'\fR, \fBcan't\fR be used, and will be treated as rule names. .Sp If you want to define a meta-rule, but do not want its individual sub-rules to count towards the final score unless the entire meta-rule matches, give the sub-rules names that start with '_\|_' (two underscores). SpamAssassin will ignore these for scoring. .IP "reuse \s-1SYMBOLIC_TEST_NAME\s0 [ \s-1OLD_SYMBOLIC_TEST_NAME_1 ... \s0]" 4 .IX Item "reuse SYMBOLIC_TEST_NAME [ OLD_SYMBOLIC_TEST_NAME_1 ... ]" Defines the name of a test that should be \*(L"reused\*(R" during the scoring process. If a message has an X\-Spam-Status header that shows a hit for this rule or any of the old rule names given, a hit will be added for this rule when \fBmass-check \-\-reuse\fR is used. Examples: .Sp \&\f(CW\*(C`reuse SPF_PASS\*(C'\fR .Sp \&\f(CW\*(C`reuse MY_NET_RULE_V2 MY_NET_RULE_V1\*(C'\fR .Sp The actual logic for reuse tests is done by \&\fBMail::SpamAssassin::Plugin::Reuse\fR. .IP "tflags \s-1SYMBOLIC_TEST_NAME\s0 flags" 4 .IX Item "tflags SYMBOLIC_TEST_NAME flags" Used to set flags on a test. Parameter is a space-separated list of flag names or flag name = value pairs. These flags are used in the score-determination back end system for details of the test's behaviour. Please see \f(CW\*(C`bayes_auto_learn\*(C'\fR for more information about tflag interaction with those systems. The following flags can be set: .RS 4 .IP "net" 4 .IX Item "net" The test is a network test, and will not be run in the mass checking system or if \fB\-L\fR is used, therefore its score should not be modified. .IP "nice" 4 .IX Item "nice" The test is intended to compensate for common false positives, and should be assigned a negative score. .IP "userconf" 4 .IX Item "userconf" The test requires user configuration before it can be used (like language-specific tests). .IP "learn" 4 .IX Item "learn" The test requires training before it can be used. .IP "noautolearn" 4 .IX Item "noautolearn" The test will explicitly be ignored when calculating the score for learning systems. .IP "autolearn_force" 4 .IX Item "autolearn_force" The test will be subject to less stringent autolearn thresholds. .Sp Normally, SpamAssassin will require 3 points from the header and 3 points from the body to be auto-learned as spam. This option keeps the threshold at 6 points total but changes it to have no regard to the source of the points. .IP "noawl" 4 .IX Item "noawl" This flag is specific when using \s-1AWL\s0 plugin. .Sp Normally, \s-1AWL\s0 plugin normalizes scores via auto-whitelist. In some scenarios it works against the system administrator when trying to add some rules to correct miss-classified email. When \s-1AWL\s0 plugin searches the email and finds the noawl flag it will exit without normalizing the score nor storing the value in db. .IP "multiple" 4 .IX Item "multiple" The test will be evaluated multiple times, for use with meta rules. Only affects header, body, rawbody, uri, and full tests. .IP "maxhits=N" 4 .IX Item "maxhits=N" If \fBmultiple\fR is specified, limit the number of hits found to N. If the rule is used in a meta that counts the hits (e.g. _\|_RULENAME > 5), this is a way to avoid wasted extra work (use \*(L"tflags multiple maxhits=6\*(R"). .Sp For example: .Sp .Vb 3 \& uri _\|_KAM_COUNT_URIS /^./ \& tflags _\|_KAM_COUNT_URIS multiple maxhits=16 \& describe _\|_KAM_COUNT_URIS A multiple match used to count URIs in a message \& \& meta _\|_KAM_HAS_0_URIS (_\|_KAM_COUNT_URIS == 0) \& meta _\|_KAM_HAS_1_URIS (_\|_KAM_COUNT_URIS >= 1) \& meta _\|_KAM_HAS_2_URIS (_\|_KAM_COUNT_URIS >= 2) \& meta _\|_KAM_HAS_3_URIS (_\|_KAM_COUNT_URIS >= 3) \& meta _\|_KAM_HAS_4_URIS (_\|_KAM_COUNT_URIS >= 4) \& meta _\|_KAM_HAS_5_URIS (_\|_KAM_COUNT_URIS >= 5) \& meta _\|_KAM_HAS_10_URIS (_\|_KAM_COUNT_URIS >= 10) \& meta _\|_KAM_HAS_15_URIS (_\|_KAM_COUNT_URIS >= 15) .Ve .IP "ips_only" 4 .IX Item "ips_only" This flag is specific to rules invoking an \s-1URIDNSBL\s0 plugin, it is documented there. .IP "domains_only" 4 .IX Item "domains_only" This flag is specific to rules invoking an \s-1URIDNSBL\s0 plugin, it is documented there. .IP "ns" 4 .IX Item "ns" This flag is specific to rules invoking an \s-1URIDNSBL\s0 plugin, it is documented there. .IP "a" 4 .IX Item "a" This flag is specific to rules invoking an \s-1URIDNSBL\s0 plugin, it is documented there. .RE .RS 4 .RE .IP "priority \s-1SYMBOLIC_TEST_NAME\s0 n" 4 .IX Item "priority SYMBOLIC_TEST_NAME n" Assign a specific priority to a test. All tests, except for \s-1DNS\s0 and Meta tests, are run in increasing priority value order (negative priority values are run before positive priority values). The default test priority is 0 (zero). .Sp The values <\-99999999999999> and <\-99999999999998> have a special meaning internally, and should not be used. .SH "ADMINISTRATOR SETTINGS" .IX Header "ADMINISTRATOR SETTINGS" These settings differ from the ones above, in that they are considered 'more privileged' \*(-- even more than the ones in the \fB\s-1PRIVILEGED SETTINGS\s0\fR section. No matter what \f(CW\*(C`allow_user_rules\*(C'\fR is set to, these can never be set from a user's \f(CW\*(C`user_prefs\*(C'\fR file when spamc/spamd is being used. However, all settings can be used by local programs run directly by the user. .IP "version_tag string" 4 .IX Item "version_tag string" This tag is appended to the \s-1SA\s0 version in the X\-Spam-Status header. You should include it when modify your ruleset, especially if you plan to distribute it. A good choice for \fIstring\fR is your last name or your initials followed by a number which you increase with each change. .Sp The version_tag will be lowercased, and any non-alphanumeric or period character will be replaced by an underscore. .Sp e.g. .Sp .Vb 1 \& version_tag myrules1 # version=2.41\-myrules1 .Ve .IP "test \s-1SYMBOLIC_TEST_NAME \s0(ok|fail) Some string to test against" 4 .IX Item "test SYMBOLIC_TEST_NAME (ok|fail) Some string to test against" Define a regression testing string. You can have more than one regression test string per symbolic test name. Simply specify a string that you wish the test to match. .Sp These tests are only run as part of the test suite \- they should not affect the general running of SpamAssassin. .IP "rbl_timeout t [t_min] [zone] (default: 15 3)" 4 .IX Item "rbl_timeout t [t_min] [zone] (default: 15 3)" All \s-1DNS\s0 queries are made at the beginning of a check and we try to read the results at the end. This value specifies the maximum period of time (in seconds) to wait for a \s-1DNS\s0 query. If most of the \s-1DNS\s0 queries have succeeded for a particular message, then SpamAssassin will not wait for the full period to avoid wasting time on unresponsive server(s), but will shrink the timeout according to a percentage of queries already completed. As the number of queries remaining approaches 0, the timeout value will gradually approach a t_min value, which is an optional second parameter and defaults to 0.2 * t. If t is smaller than t_min, the initial timeout is set to t_min. Here is a chart of queries remaining versus the timeout in seconds, for the default 15 second / 3 second timeout setting: .Sp .Vb 2 \& queries left 100% 90% 80% 70% 60% 50% 40% 30% 20% 10% 0% \& timeout 15 14.9 14.5 13.9 13.1 12.0 10.7 9.1 7.3 5.3 3 .Ve .Sp For example, if 20 queries are made at the beginning of a message check and 16 queries have returned (leaving 20%), the remaining 4 queries should finish within 7.3 seconds since their query started or they will be timed out. Note that timed out queries are only aborted when there is nothing else left for SpamAssassin to do \- long evaluation of other rules may grant queries additional time. .Sp If a parameter 'zone' is specified (it must end with a letter, which distinguishes it from other numeric parametrs), then the setting only applies to \s-1DNS\s0 queries against the specified \s-1DNS\s0 domain (host, domain or \&\s-1RBL \s0(sub)zone). Matching is case-insensitive, the actual domain may be a subdomain of the specified zone. .IP "util_rb_tld tld1 tld2 ..." 4 .IX Item "util_rb_tld tld1 tld2 ..." This option maintains list of valid TLDs in the RegistryBoundaries code. TLDs include things like com, net, org, etc. .IP "util_rb_2tld 2tld\-1.tld 2tld\-2.tld ..." 4 .IX Item "util_rb_2tld 2tld-1.tld 2tld-2.tld ..." This option maintains list of valid 2nd\-level TLDs in the RegistryBoundaries code. 2TLDs include things like co.uk, fed.us, etc. .IP "util_rb_3tld 3tld1.some.tld 3tld2.other.tld ..." 4 .IX Item "util_rb_3tld 3tld1.some.tld 3tld2.other.tld ..." This option maintains list of valid 3rd\-level TLDs in the RegistryBoundaries code. 3TLDs include things like demon.co.uk, plc.co.im, etc. .IP "clear_util_rb" 4 .IX Item "clear_util_rb" Empty internal list of valid TLDs (including 2nd and 3rd level) which RegistryBoundaries code uses. Only useful if you want to override the standard lists supplied by sa-update. .IP "bayes_path /path/filename (default: ~/.spamassassin/bayes)" 4 .IX Item "bayes_path /path/filename (default: ~/.spamassassin/bayes)" This is the directory and filename for Bayes databases. Several databases will be created, with this as the base directory and filename, with \f(CW\*(C`_toks\*(C'\fR, \&\f(CW\*(C`_seen\*(C'\fR, etc. appended to the base. The default setting results in files called \f(CW\*(C`~/.spamassassin/bayes_seen\*(C'\fR, \f(CW\*(C`~/.spamassassin/bayes_toks\*(C'\fR, etc. .Sp By default, each user has their own in their \f(CW\*(C`~/.spamassassin\*(C'\fR directory with mode 0700/0600. For system-wide SpamAssassin use, you may want to reduce disk space usage by sharing this across all users. However, Bayes appears to be more effective with individual user databases. .IP "bayes_file_mode (default: 0700)" 4 .IX Item "bayes_file_mode (default: 0700)" The file mode bits used for the Bayesian filtering database files. .Sp Make sure you specify this using the 'x' mode bits set, as it may also be used to create directories. However, if a file is created, the resulting file will not have any execute bits set (the umask is set to 111). The argument is a string of octal digits, it is converted to a numeric value internally. .IP "bayes_store_module Name::Of::BayesStore::Module" 4 .IX Item "bayes_store_module Name::Of::BayesStore::Module" If this option is set, the module given will be used as an alternate to the default bayes storage mechanism. It must conform to the published storage specification (see Mail::SpamAssassin::BayesStore). For example, set this to Mail::SpamAssassin::BayesStore::SQL to use the generic \s-1SQL\s0 storage module. .IP "bayes_sql_dsn DBI::databasetype:databasename:hostname:port" 4 .IX Item "bayes_sql_dsn DBI::databasetype:databasename:hostname:port" Used for BayesStore::SQL storage implementation. .Sp This option give the connect string used to connect to the \s-1SQL\s0 based Bayes storage. .IP "bayes_sql_username" 4 .IX Item "bayes_sql_username" Used by BayesStore::SQL storage implementation. .Sp This option gives the username used by the above \s-1DSN.\s0 .IP "bayes_sql_password" 4 .IX Item "bayes_sql_password" Used by BayesStore::SQL storage implementation. .Sp This option gives the password used by the above \s-1DSN.\s0 .IP "bayes_sql_username_authorized ( 0 | 1 ) (default: 0)" 4 .IX Item "bayes_sql_username_authorized ( 0 | 1 ) (default: 0)" Whether to call the services_authorized_for_username plugin hook in BayesSQL. If the hook does not determine that the user is allowed to use bayes or is invalid then then database will not be initialized. .Sp \&\s-1NOTE:\s0 By default the user is considered invalid until a plugin returns a true value. If you enable this, but do not have a proper plugin loaded, all users will turn up as invalid. .Sp The username passed into the plugin can be affected by the bayes_sql_override_username config option. .IP "user_scores_dsn DBI:databasetype:databasename:hostname:port" 4 .IX Item "user_scores_dsn DBI:databasetype:databasename:hostname:port" If you load user scores from an \s-1SQL\s0 database, this will set the \s-1DSN\s0 used to connect. Example: \f(CW\*(C`DBI:mysql:spamassassin:localhost\*(C'\fR .Sp If you load user scores from an \s-1LDAP\s0 directory, this will set the \s-1DSN\s0 used to connect. You have to write the \s-1DSN\s0 as an \s-1LDAP URL,\s0 the components being the host and port to connect to, the base \s-1DN\s0 for the search, the scope of the search (base, one or sub), the single attribute being the multivalued attribute used to hold the configuration data (space separated pairs of key and value, just as in a file) and finally the filter being the expression used to filter out the wanted username. Note that the filter expression is being used in a sprintf statement with the username as the only parameter, thus is can hold a single _\|_USERNAME_\|_ expression. This will be replaced with the username. .Sp Example: \f(CW\*(C`ldap://localhost:389/dc=koehntopp,dc=de?saconfig?uid=_\|_USERNAME_\|_\*(C'\fR .IP "user_scores_sql_username username" 4 .IX Item "user_scores_sql_username username" The authorized username to connect to the above \s-1DSN.\s0 .IP "user_scores_sql_password password" 4 .IX Item "user_scores_sql_password password" The password for the database username, for the above \s-1DSN.\s0 .IP "user_scores_sql_custom_query query" 4 .IX Item "user_scores_sql_custom_query query" This option gives you the ability to create a custom \s-1SQL\s0 query to retrieve user scores and preferences. In order to work correctly your query should return two values, the preference name and value, in that order. In addition, there are several \*(L"variables\*(R" that you can use as part of your query, these variables will be substituted for the current values right before the query is run. The current allowed variables are: .RS 4 .IP "_TABLE_" 4 .IX Item "_TABLE_" The name of the table where user scores and preferences are stored. Currently hardcoded to userpref, to change this value you need to create a new custom query with the new table name. .IP "_USERNAME_" 4 .IX Item "_USERNAME_" The current user's username. .IP "_MAILBOX_" 4 .IX Item "_MAILBOX_" The portion before the @ as derived from the current user's username. .IP "_DOMAIN_" 4 .IX Item "_DOMAIN_" The portion after the @ as derived from the current user's username, this value may be null. .RE .RS 4 .Sp The query must be one continuous line in order to parse correctly. .Sp Here are several example queries, please note that these are broken up for easy reading, in your config it should be one continuous line. .IP "Current default query:" 4 .IX Item "Current default query:" \&\f(CW\*(C`SELECT preference, value FROM _TABLE_ WHERE username = _USERNAME_ OR username = \*(Aq@GLOBAL\*(Aq ORDER BY username ASC\*(C'\fR .IP "Use global and then domain level defaults:" 4 .IX Item "Use global and then domain level defaults:" \&\f(CW\*(C`SELECT preference, value FROM _TABLE_ WHERE username = _USERNAME_ OR username = \*(Aq@GLOBAL\*(Aq OR username = \*(Aq@~\*(Aq||_DOMAIN_ ORDER BY username ASC\*(C'\fR .IP "Maybe global prefs should override user prefs:" 4 .IX Item "Maybe global prefs should override user prefs:" \&\f(CW\*(C`SELECT preference, value FROM _TABLE_ WHERE username = _USERNAME_ OR username = \*(Aq@GLOBAL\*(Aq ORDER BY username DESC\*(C'\fR .RE .RS 4 .RE .IP "user_scores_ldap_username" 4 .IX Item "user_scores_ldap_username" This is the Bind \s-1DN\s0 used to connect to the \s-1LDAP\s0 server. It defaults to the empty string (""), allowing anonymous binding to work. .Sp Example: \f(CW\*(C`cn=master,dc=koehntopp,dc=de\*(C'\fR .IP "user_scores_ldap_password" 4 .IX Item "user_scores_ldap_password" This is the password used to connect to the \s-1LDAP\s0 server. It defaults to the empty string (""). .IP "user_scores_fallback_to_global (default: 1)" 4 .IX Item "user_scores_fallback_to_global (default: 1)" Fall back to global scores and settings if userprefs can't be loaded from \s-1SQL\s0 or \s-1LDAP,\s0 instead of passing the message through unprocessed. .IP "loadplugin PluginModuleName [/path/module.pm]" 4 .IX Item "loadplugin PluginModuleName [/path/module.pm]" Load a SpamAssassin plugin module. The \f(CW\*(C`PluginModuleName\*(C'\fR is the perl module name, used to create the plugin object itself. .Sp \&\f(CW\*(C`/path/to/module.pm\*(C'\fR is the file to load, containing the module's perl code; if it's specified as a relative path, it's considered to be relative to the current configuration file. If it is omitted, the module will be loaded using perl's search path (the \f(CW@INC\fR array). .Sp See \f(CW\*(C`Mail::SpamAssassin::Plugin\*(C'\fR for more details on writing plugins. .IP "tryplugin PluginModuleName [/path/module.pm]" 4 .IX Item "tryplugin PluginModuleName [/path/module.pm]" Same as \f(CW\*(C`loadplugin\*(C'\fR, but silently ignored if the .pm file cannot be found in the filesystem. .IP "ignore_always_matching_regexps (Default: 0)" 4 .IX Item "ignore_always_matching_regexps (Default: 0)" Ignore any rule which contains a regexp which always matches. Currently only catches regexps which contain '||', or which begin or end with a '|'. Also ignore rules with \f(CW\*(C`some\*(C'\fR combinatorial explosions. .SH "PREPROCESSING OPTIONS" .IX Header "PREPROCESSING OPTIONS" .IP "include filename" 4 .IX Item "include filename" Include configuration lines from \f(CW\*(C`filename\*(C'\fR. Relative paths are considered relative to the current configuration file or user preferences file. .IP "if (boolean perl expression)" 4 .IX Item "if (boolean perl expression)" Used to support conditional interpretation of the configuration file. Lines between this and a corresponding \f(CW\*(C`else\*(C'\fR or \f(CW\*(C`endif\*(C'\fR line will be ignored unless the expression evaluates as true (in the perl sense; that is, defined and non\-0 and non-empty string). .Sp The conditional accepts a limited subset of perl for security \*(-- just enough to perform basic arithmetic comparisons. The following input is accepted: .RS 4 .IP "numbers, whitespace, arithmetic operations and grouping" 4 .IX Item "numbers, whitespace, arithmetic operations and grouping" Namely these characters and ranges: .Sp .Vb 1 \& ( ) \- + * / _ . , < = > ! ~ 0\-9 whitespace .Ve .IP "version" 4 .IX Item "version" This will be replaced with the version number of the currently-running SpamAssassin engine. Note: The version used is in the internal SpamAssassin version format which is \f(CW\*(C`x.yyyzzz\*(C'\fR, where x is major version, y is minor version, and z is maintenance version. So 3.0.0 is \f(CW3.000000\fR, and 3.4.80 is \f(CW3.004080\fR. .IP "perl_version" 4 .IX Item "perl_version" (Introduced in 3.4.1) This will be replaced with the version number of the currently-running perl engine. Note: The version used is in the $] version format which is \f(CW\*(C`x.yyyzzz\*(C'\fR, where x is major version, y is minor version, and z is maintenance version. So 5.8.8 is \f(CW5.008008\fR, and 5.10.0 is \&\f(CW5.010000\fR. Use to protect rules that incorporate \s-1RE\s0 syntax elements introduced in later versions of perl, such as the \f(CW\*(C`++\*(C'\fR non-backtracking match introduced in perl 5.10. For example: .Sp .Vb 5 \& # Avoid lint error on older perl installs \& # Check SA version first to avoid warnings on checking perl_version on older SA \& if version > 3.004001 && perl_version >= 5.018000 \& body INVALID_RE_SYNTAX_IN_PERL_BEFORE_5_18 /(?[ \ep{Thai} & \ep{Digit} ])/ \& endif .Ve .Sp Note that the above will still generate a warning on perl older than 5.10.0; to avoid that warning do this instead: .Sp .Vb 4 \& # Avoid lint error on older perl installs \& if can(Mail::SpamAssassin::Conf::perl_min_version_5010000) \& body INVALID_RE_SYNTAX_IN_PERL_5_8 /\ew++/ \& endif .Ve .Sp Warning: a \fIcan()\fR test is only defined for perl 5.10.0! .IP "plugin(Name::Of::Plugin)" 4 .IX Item "plugin(Name::Of::Plugin)" This is a function call that returns \f(CW1\fR if the plugin named \&\f(CW\*(C`Name::Of::Plugin\*(C'\fR is loaded, or \f(CW\*(C`undef\*(C'\fR otherwise. .IP "has(Name::Of::Package::function_name)" 4 .IX Item "has(Name::Of::Package::function_name)" This is a function call that returns \f(CW1\fR if the perl package named \&\f(CW\*(C`Name::Of::Package\*(C'\fR includes a function called \f(CW\*(C`function_name\*(C'\fR, or \f(CW\*(C`undef\*(C'\fR otherwise. Note that packages can be SpamAssassin plugins or built-in classes, there's no difference in this respect. Internally this invokes UNIVERSAL::can. .IP "can(Name::Of::Package::function_name)" 4 .IX Item "can(Name::Of::Package::function_name)" This is a function call that returns \f(CW1\fR if the perl package named \&\f(CW\*(C`Name::Of::Package\*(C'\fR includes a function called \f(CW\*(C`function_name\*(C'\fR \&\fBand\fR that function returns a true value when called with no arguments, otherwise \f(CW\*(C`undef\*(C'\fR is returned. .Sp Is similar to \f(CW\*(C`has\*(C'\fR, except that it also calls the named function, testing its return value (unlike the perl function UNIVERSAL::can). This makes it possible for a 'feature' function to determine its result value at run time. .RE .RS 4 .Sp If the end of a configuration file is reached while still inside a \&\f(CW\*(C`if\*(C'\fR scope, a warning will be issued, but parsing will restart on the next file. .Sp For example: .Sp .Vb 3 \& if (version > 3.000000) \& header MY_FOO ... \& endif \& \& loadplugin MyPlugin plugintest.pm \& \& if plugin (MyPlugin) \& header MY_PLUGIN_FOO eval:check_for_foo() \& score MY_PLUGIN_FOO 0.1 \& endif .Ve .RE .IP "ifplugin PluginModuleName" 4 .IX Item "ifplugin PluginModuleName" An alias for \f(CW\*(C`if plugin(PluginModuleName)\*(C'\fR. .IP "else" 4 .IX Item "else" Used to support conditional interpretation of the configuration file. Lines between this and a corresponding \f(CW\*(C`endif\*(C'\fR line, will be ignored unless the conditional expression evaluates as false (in the perl sense; that is, not defined and not 0 and non-empty string). .IP "require_version n.nnnnnn" 4 .IX Item "require_version n.nnnnnn" Indicates that the entire file, from this line on, requires a certain version of SpamAssassin to run. If a different (older or newer) version of SpamAssassin tries to read the configuration from this file, it will output a warning instead, and ignore it. .Sp Note: The version used is in the internal SpamAssassin version format which is \&\f(CW\*(C`x.yyyzzz\*(C'\fR, where x is major version, y is minor version, and z is maintenance version. So 3.0.0 is \f(CW3.000000\fR, and 3.4.80 is \f(CW3.004080\fR. .SH "TEMPLATE TAGS" .IX Header "TEMPLATE TAGS" The following \f(CW\*(C`tags\*(C'\fR can be used as placeholders in certain options. They will be replaced by the corresponding value when they are used. .PP Some tags can take an argument (in parentheses). The argument is optional, and the default is shown below. .PP .Vb 10 \& _YESNO_ "Yes" for spam, "No" for nonspam (=ham) \& _YESNO(spam_str,ham_str)_ returns the first argument ("Yes" if missing) \& for spam, and the second argument ("No" if missing) for ham \& _YESNOCAPS_ "YES" for spam, "NO" for nonspam (=ham) \& _YESNOCAPS(spam_str,ham_str)_ same as _YESNO(...)_, but uppercased \& _SCORE(PAD)_ message score, if PAD is included and is either spaces or \& zeroes, then pad scores with that many spaces or zeroes \& (default, none) ie: _SCORE(0)_ makes 2.4 become 02.4, \& _SCORE(00)_ is 002.4. 12.3 would be 12.3 and 012.3 \& respectively. \& _REQD_ message threshold \& _VERSION_ version (eg. 3.0.0 or 3.1.0\-r26142\-foo1) \& _SUBVERSION_ sub\-version/code revision date (eg. 2004\-01\-10) \& _RULESVERSION_ comma\-separated list of rules versions, retrieved from \& an \*(Aq# UPDATE version\*(Aq comment in rules files; if there is \& more than one set of rules (update channels) the order \& is unspecified (currently sorted by names of files); \& _HOSTNAME_ hostname of the machine the mail was processed on \& _REMOTEHOSTNAME_ hostname of the machine the mail was sent from, only \& available with spamd \& _REMOTEHOSTADDR_ ip address of the machine the mail was sent from, only \& available with spamd \& _BAYES_ bayes score \& _TOKENSUMMARY_ number of new, neutral, spammy, and hammy tokens found \& _BAYESTC_ number of new tokens found \& _BAYESTCLEARNED_ number of seen tokens found \& _BAYESTCSPAMMY_ number of spammy tokens found \& _BAYESTCHAMMY_ number of hammy tokens found \& _HAMMYTOKENS(N)_ the N most significant hammy tokens (default, 5) \& _SPAMMYTOKENS(N)_ the N most significant spammy tokens (default, 5) \& _DATE_ rfc\-2822 date of scan \& _STARS(*)_ one "*" (use any character) for each full score point \& (note: limited to 50 \*(Aqstars\*(Aq) \& _SENDERDOMAIN_ a domain name of the envelope sender address, lowercased \& _AUTHORDOMAIN_ a domain name of the author address (the From header \& field), lowercased; note that RFC 5322 allows a mail \& message to have multiple authors \- currently only the \& domain name of the first email address is returned \& _RELAYSTRUSTED_ relays used and deemed to be trusted (see the \& \*(AqX\-Spam\-Relays\-Trusted\*(Aq pseudo\-header) \& _RELAYSUNTRUSTED_ relays used that can not be trusted (see the \& \*(AqX\-Spam\-Relays\-Untrusted\*(Aq pseudo\-header) \& _RELAYSINTERNAL_ relays used and deemed to be internal (see the \& \*(AqX\-Spam\-Relays\-Internal\*(Aq pseudo\-header) \& _RELAYSEXTERNAL_ relays used and deemed to be external (see the \& \*(AqX\-Spam\-Relays\-External\*(Aq pseudo\-header) \& _LASTEXTERNALIP_ IP address of client in the external\-to\-internal \& SMTP handover \& _LASTEXTERNALRDNS_ reverse\-DNS of client in the external\-to\-internal \& SMTP handover \& _LASTEXTERNALHELO_ HELO string used by client in the external\-to\-internal \& SMTP handover \& _AUTOLEARN_ autolearn status ("ham", "no", "spam", "disabled", \& "failed", "unavailable") \& _AUTOLEARNSCORE_ portion of message score used by autolearn \& _TESTS(,)_ tests hit separated by "," (or other separator) \& _TESTSSCORES(,)_ as above, except with scores appended (eg. AWL=\-3.0,...) \& _SUBTESTS(,)_ subtests (start with "_\|_") hit separated by "," \& (or other separator) \& _DCCB_ DCC\*(Aqs "Brand" \& _DCCR_ DCC\*(Aqs results \& _PYZOR_ Pyzor results \& _RBL_ full results for positive RBL queries in DNS URI format \& _LANGUAGES_ possible languages of mail \& _PREVIEW_ content preview \& _REPORT_ terse report of tests hit (for header reports) \& _SUMMARY_ summary of tests hit for standard report (for body reports) \& _CONTACTADDRESS_ contents of the \*(Aqreport_contact\*(Aq setting \& _HEADER(NAME)_ includes the value of a message header. value is the same \& as is found for header rules (see elsewhere in this doc) \& _TIMING_ timing breakdown report \& _ADDEDHEADERHAM_ resulting header fields as requested by add_header for spam \& _ADDEDHEADERSPAM_ resulting header fields as requested by add_header for ham \& _ADDEDHEADER_ same as ADDEDHEADERHAM for ham or ADDEDHEADERSPAM for spam .Ve .PP If a tag reference uses the name of a tag which is not in this list or defined by a loaded plugin, the reference will be left intact and not replaced by any value. .PP The \f(CW\*(C`HAMMYTOKENS\*(C'\fR and \f(CW\*(C`SPAMMYTOKENS\*(C'\fR tags have an optional second argument which specifies a format. See the \fB\s-1HAMMYTOKENS/SPAMMYTOKENS TAG FORMAT\s0\fR section, below, for details. .SS "\s-1HAMMYTOKENS/SPAMMYTOKENS TAG FORMAT\s0" .IX Subsection "HAMMYTOKENS/SPAMMYTOKENS TAG FORMAT" The \f(CW\*(C`HAMMYTOKENS\*(C'\fR and \f(CW\*(C`SPAMMYTOKENS\*(C'\fR tags have an optional second argument which specifies a format: \f(CW\*(C`_SPAMMYTOKENS(N,FMT)_\*(C'\fR, \f(CW\*(C`_HAMMYTOKENS(N,FMT)_\*(C'\fR The following formats are available: .IP "short" 4 .IX Item "short" Only the tokens themselves are listed. \&\fIFor example, preference file entry:\fR .Sp \&\f(CW\*(C`add_header all Spammy _SPAMMYTOKENS(2,short)_\*(C'\fR .Sp \&\fIResults in message header:\fR .Sp \&\f(CW\*(C`X\-Spam\-Spammy: remove.php, UD:jpg\*(C'\fR .Sp Indicating that the top two spammy tokens found are \f(CW\*(C`remove.php\*(C'\fR and \f(CW\*(C`UD:jpg\*(C'\fR. (The token itself follows the last colon, the text before the colon indicates something about the token. \&\f(CW\*(C`UD\*(C'\fR means the token looks like it might be part of a domain name.) .IP "compact" 4 .IX Item "compact" The token probability, an abbreviated declassification distance (see example), and the token are listed. \&\fIFor example, preference file entry:\fR .Sp \&\f(CW\*(C`add_header all Spammy _SPAMMYTOKENS(2,compact)_\*(C'\fR .Sp \&\fIResults in message header:\fR .Sp \&\f(CW\*(C`0.989\-6\-\-remove.php, 0.988\-+\-\-UD:jpg\*(C'\fR .Sp Indicating that the probabilities of the top two tokens are 0.989 and 0.988, respectively. The first token has a declassification distance of 6, meaning that if the token had appeared in at least 6 more ham messages it would not be considered spammy. The \f(CW\*(C`+\*(C'\fR for the second token indicates a declassification distance greater than 9. .IP "long" 4 .IX Item "long" Probability, declassification distance, number of times seen in a ham message, number of times seen in a spam message, age and the token are listed. .Sp \&\fIFor example, preference file entry:\fR .Sp \&\f(CW\*(C`add_header all Spammy _SPAMMYTOKENS(2,long)_\*(C'\fR .Sp \&\fIResults in message header:\fR .Sp \&\f(CW\*(C`X\-Spam\-Spammy: 0.989\-6\-\-0h\-4s\-\-4d\-\-remove.php, 0.988\-33\-\-2h\-25s\-\-1d\-\-UD:jpg\*(C'\fR .Sp In addition to the information provided by the compact option, the long option shows that the first token appeared in zero ham messages and four spam messages, and that it was last seen four days ago. The second token appeared in two ham messages, 25 spam messages and was last seen one day ago. (Unlike the \f(CW\*(C`compact\*(C'\fR option, the long option shows declassification distances that are greater than 9.) .SH "LOCALI[SZ]ATION" .IX Header "LOCALI[SZ]ATION" A line starting with the text \f(CW\*(C`lang xx\*(C'\fR will only be interpreted if the user is in that locale, allowing test descriptions and templates to be set for that language. .PP The locales string should specify either both the language and country, e.g. \&\f(CW\*(C`lang pt_BR\*(C'\fR, or just the language, e.g. \f(CW\*(C`lang de\*(C'\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\f(CW\*(C`Mail::SpamAssassin\*(C'\fR \&\f(CW\*(C`spamassassin\*(C'\fR \&\f(CW\*(C`spamd\*(C'\fR