"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/Mail/SpamAssassin/Conf.pm" between
Mail-SpamAssassin-3.4.4.tar.bz2 and Mail-SpamAssassin-3.4.5.tar.bz2

About: SpamAssassin is a mail filter that uses a wide range of heuristic tests on mail headers and body text to identify "spam" (also known as unsolicited commercial email) incl. Bayesian (statistical) spam filter and several internet-based realtime blacklists.

Conf.pm  (Mail-SpamAssassin-3.4.4.tar.bz2):Conf.pm  (Mail-SpamAssassin-3.4.5.tar.bz2)
skipping to change at line 320 skipping to change at line 320
=cut =cut
push (@cmds, { push (@cmds, {
setting => 'whitelist_from', setting => 'whitelist_from',
type => $CONF_TYPE_ADDRLIST, type => $CONF_TYPE_ADDRLIST,
}); });
=item unwhitelist_from user@example.com =item unwhitelist_from user@example.com
Used to override a default whitelist_from entry, so for example a distribution Used to remove 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 whitelist_from can be overridden in a local.cf file, or an individual user can
override a whitelist_from entry in their own C<user_prefs> file. override a whitelist_from entry in their own C<user_prefs> file.
The specified email address has to match exactly (although case-insensitively) The specified email address has to match exactly (although case-insensitively)
the address previously used in a whitelist_from line, which implies that a the address previously used in a whitelist_from line, which implies that a
wildcard only matches literally the same wildcard (not 'any' address). wildcard only matches literally the same wildcard (not 'any' address).
e.g. e.g.
unwhitelist_from joe@example.com fred@example.com unwhitelist_from joe@example.com fred@example.com
unwhitelist_from *@example.com unwhitelist_from *@example.com
skipping to change at line 461 skipping to change at line 461
=cut =cut
push (@cmds, { push (@cmds, {
setting => 'whitelist_allows_relays', setting => 'whitelist_allows_relays',
type => $CONF_TYPE_ADDRLIST, type => $CONF_TYPE_ADDRLIST,
}); });
=item unwhitelist_from_rcvd user@example.com =item unwhitelist_from_rcvd user@example.com
Used to override a default whitelist_from_rcvd entry, so for example a Used to remove a default whitelist_from_rcvd or def_whitelist_from_rcvd
distribution whitelist_from_rcvd can be overridden in a local.cf file, entry, so for example a distribution whitelist_from_rcvd can be overridden
or an individual user can override a whitelist_from_rcvd entry in in a local.cf file, or an individual user can override a whitelist_from_rcvd
their own C<user_prefs> file. entry in their own C<user_prefs> file.
The specified email address has to match exactly the address previously The specified email address has to match exactly the address previously
used in a whitelist_from_rcvd line. used in a whitelist_from_rcvd line.
e.g. e.g.
unwhitelist_from_rcvd joe@example.com fred@example.com unwhitelist_from_rcvd joe@example.com fred@example.com
unwhitelist_from_rcvd *@axkit.org unwhitelist_from_rcvd *@axkit.org
=cut =cut
skipping to change at line 508 skipping to change at line 508
=cut =cut
push (@cmds, { push (@cmds, {
setting => 'blacklist_from', setting => 'blacklist_from',
type => $CONF_TYPE_ADDRLIST, type => $CONF_TYPE_ADDRLIST,
}); });
=item unblacklist_from user@example.com =item unblacklist_from user@example.com
Used to override a default blacklist_from entry, so for example a Used to remove a default blacklist_from entry, so for example a
distribution blacklist_from can be overridden in a local.cf file, or distribution blacklist_from can be overridden in a local.cf file, or
an individual user can override a blacklist_from entry in their own an individual user can override a blacklist_from entry in their own
C<user_prefs> file. The specified email address has to match exactly C<user_prefs> file. The specified email address has to match exactly
the address previously used in a blacklist_from line. the address previously used in a blacklist_from line.
e.g. e.g.
unblacklist_from joe@example.com fred@example.com unblacklist_from joe@example.com fred@example.com
unblacklist_from *@spammer.com unblacklist_from *@spammer.com
skipping to change at line 634 skipping to change at line 634
type => $CONF_TYPE_ADDRLIST, type => $CONF_TYPE_ADDRLIST,
}); });
push (@cmds, { push (@cmds, {
setting => 'def_whitelist_auth', setting => 'def_whitelist_auth',
type => $CONF_TYPE_ADDRLIST, type => $CONF_TYPE_ADDRLIST,
}); });
=item unwhitelist_auth user@example.com =item unwhitelist_auth user@example.com
Used to override a C<whitelist_auth> entry. The specified email address has to Used to remove a C<whitelist_auth> or C<def_whitelist_auth> entry. The
match exactly the address previously used in a C<whitelist_auth> line. specified email address has to match exactly the address previously used.
e.g. e.g.
unwhitelist_auth joe@example.com fred@example.com unwhitelist_auth joe@example.com fred@example.com
unwhitelist_auth *@example.com unwhitelist_auth *@example.com
=cut =cut
push (@cmds, { push (@cmds, {
command => 'unwhitelist_auth', setting => 'unwhitelist_auth',
setting => 'whitelist_auth',
type => $CONF_TYPE_ADDRLIST, type => $CONF_TYPE_ADDRLIST,
code => \&Mail::SpamAssassin::Conf::Parser::remove_addrlist_value code => sub {
my ($self, $key, $value, $line) = @_;
unless (defined $value && $value !~ /^$/) {
return $MISSING_REQUIRED_VALUE;
}
unless ($value =~ /^(?:\S+(?:\s+\S+)*)$/) {
return $INVALID_VALUE;
}
$self->{parser}->remove_from_addrlist('whitelist_auth',
split (/\s+/, $value));
$self->{parser}->remove_from_addrlist('def_whitelist_auth',
split (/\s+/, $value));
}
}); });
=item enlist_uri_host (listname) host ... =item enlist_uri_host (listname) host ...
Adds one or more host names or domain names to a named list of URI domains. Adds one or more host names or domain names to a named list of URI domains.
The named list can then be consulted through a check_uri_host_listed() The named list can then be consulted through a check_uri_host_listed()
eval rule implemented by the WLBLEval plugin, which takes the list name as 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. an argument. Parenthesis around a list name are literal - a required syntax.
Host names may optionally be prefixed by an exclamation mark '!', which Host names may optionally be prefixed by an exclamation mark '!', which
skipping to change at line 910 skipping to change at line 921
Add a prefix in emails Subject if a rule is matched. Add a prefix in emails Subject if a rule is matched.
To enable this option "rewrite_header Subject" config To enable this option "rewrite_header Subject" config
option must be enabled as well. option must be enabled as well.
The check C<if can(Mail::SpamAssassin::Conf::feature_subjprefix)> The check C<if can(Mail::SpamAssassin::Conf::feature_subjprefix)>
should be used to silence warnings in previous should be used to silence warnings in previous
SpamAssassin versions. SpamAssassin versions.
To be able to use this feature a C<add_header all Subjprefix _SUBJPREFIX_> To be able to use this feature a C<add_header all Subjprefix _SUBJPREFIX_>
configuration line could be needed on some setups. configuration line could be needed when the glue between the MTA and SpamAssassi
n
rewrites the email content.
Here is an example on how to use this feature:
rewrite_header Subject *****SPAM*****
add_header all Subjprefix _SUBJPREFIX_
body OLEMACRO_MALICE eval:check_olemacro_malice()
describe OLEMACRO_MALICE Dangerous Office Macro
score OLEMACRO_MALICE 5.0
if can(Mail::SpamAssassin::Conf::feature_subjprefix)
subjprefix OLEMACRO_MALICE [VIRUS]
endif
=cut =cut
push (@cmds, { push (@cmds, {
command => 'subjprefix', command => 'subjprefix',
setting => 'subjprefix', setting => 'subjprefix',
is_frequent => 1, is_frequent => 1,
type => $CONF_TYPE_HASH_KEY_VALUE, type => $CONF_TYPE_HASH_KEY_VALUE,
}); });
skipping to change at line 1241 skipping to change at line 1264
return $INVALID_VALUE; return $INVALID_VALUE;
} }
unless (eval 'require Encode') { unless (eval 'require Encode') {
$self->{parser}->lint_warn("config: normalize_charset requires Encode "); $self->{parser}->lint_warn("config: normalize_charset requires Encode ");
$self->{normalize_charset} = 0; $self->{normalize_charset} = 0;
return $INVALID_VALUE; return $INVALID_VALUE;
} }
} }
}); });
=item body_part_scan_size (default: 50000)
Per mime-part scan size limit in bytes for "body" type rules.
The decoded/stripped mime-part is truncated approx to this size.
Helps scanning large messages safely, so it's not necessary to
skip them completely. Disabled with 0.
=cut
push (@cmds, {
setting => 'body_part_scan_size',
is_admin => 1,
default => 50000,
type => $CONF_TYPE_NUMERIC,
});
=item rawbody_part_scan_size (default: 500000)
Like body_part_scan_size, for "rawbody" type rules.
=cut
push (@cmds, {
setting => 'rawbody_part_scan_size',
is_admin => 1,
default => 500000,
type => $CONF_TYPE_NUMERIC,
});
=back =back
=head2 NETWORK TEST OPTIONS =head2 NETWORK TEST OPTIONS
=over 4 =over 4
=item trusted_networks IPaddress[/masklen] ... (default: none) =item trusted_networks IPaddress[/masklen] ... (default: none)
What networks or hosts are 'trusted' in your setup. B<Trusted> in this case What networks or hosts are 'trusted' in your setup. B<Trusted> in this case
means that relay hosts on these networks are considered to not be potentially means that relay hosts on these networks are considered to not be potentially
skipping to change at line 2843 skipping to change at line 2837
=over 4 =over 4
=item example@foo =item example@foo
=item example@foo (Foo Blah) =item example@foo (Foo Blah)
=item example@foo, example@bar =item example@foo, example@bar
=item display: example@foo (Foo Blah), example@bar ; =item display: example@foo (Foo Blah), example@bar ;
=item Foo Blah <example@foo> =item Foo Blah E<lt>example@fooE<gt>
=item "Foo Blah" <example@foo> =item "Foo Blah" E<lt>example@fooE<gt>
=item "'Foo Blah'" <example@foo> =item "'Foo Blah'" E<lt>example@fooE<gt>
=back =back
For example, appending C<:name> to a header name will result in "Foo Blah" For example, appending C<:name> to a header name will result in "Foo Blah"
(without quotes) in all of the following cases: (without quotes) in all of the following cases:
=over 4 =over 4
=item example@foo (Foo Blah) =item example@foo (Foo Blah)
=item example@foo (Foo Blah), example@bar =item example@foo (Foo Blah), example@bar
=item display: example@foo (Foo Blah), example@bar ; =item display: example@foo (Foo Blah), example@bar ;
=item Foo Blah <example@foo> =item Foo Blah E<lt>example@fooE<gt>
=item "Foo Blah" <example@foo> =item "Foo Blah" E<lt>example@fooE<gt>
=item "'Foo Blah'" <example@foo> =item "'Foo Blah'" E<lt>example@fooE<gt>
=back =back
There are several special pseudo-headers that can be specified: There are several special pseudo-headers that can be specified:
=over 4 =over 4
=item C<ALL> can be used to mean the text of all the message's headers. =item C<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 Note that all whitespace inside the headers, at line folds, is currently
compressed into a single space (' ') character. To obtain a pristine compressed into a single space (' ') character. To obtain a pristine
skipping to change at line 2958 skipping to change at line 2952
headers from the message, extract the IP addresses, select which ones are headers from the message, extract the IP addresses, select which ones are
'untrusted' based on the C<trusted_networks> logic, and query that DNSBL 'untrusted' based on the C<trusted_networks> logic, and query that DNSBL
zone. There's a few things to note: zone. There's a few things to note:
=over 4 =over 4
=item duplicated or private IPs =item duplicated or private IPs
Duplicated IPs are only queried once and reserved IPs are not queried. Duplicated IPs are only queried once and reserved IPs are not queried.
Private IPs are those listed in Private IPs are those listed in
<https://www.iana.org/assignments/ipv4-address-space>, C<https://www.iana.org/assignments/ipv4-address-space>,
<http://duxcw.com/faq/network/privip.htm>, C<http://duxcw.com/faq/network/privip.htm>,
<http://duxcw.com/faq/network/autoip.htm>, or C<http://duxcw.com/faq/network/autoip.htm>, or
<https://tools.ietf.org/html/rfc5735> as private. C<https://tools.ietf.org/html/rfc5735> as private.
=item the 'set' argument =item the 'set' argument
This is used as a 'zone ID'. If you want to look up a multiple-meaning zone This is used as a 'zone ID'. If you want to look up a multiple-meaning zone
like SORBS, you can then query the results from that zone using it; like SORBS, you can then query the results from that zone using it;
but all check_rbl_sub() calls must use that zone ID. but all check_rbl_sub() calls must use that zone ID.
Also, if more than one IP address gets a DNSBL hit for a particular rule, it Also, if more than one IP address gets a DNSBL hit for a particular rule, it
does not affect the score because rules only trigger once per message. does not affect the score because rules only trigger once per message.
skipping to change at line 3277 skipping to change at line 3271
Can also define an arithmetic expression in terms of other tests, Can also define an arithmetic expression in terms of other tests,
with an unhit test having the value "0" and a hit test having a with an unhit test having the value "0" and a hit test having a
nonzero value. The value of a hit meta test is that of its arithmetic 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 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 method. The value of a hit header, body, rawbody, uri, or full test
which has the "multiple" tflag is the number of times the test hit. which has the "multiple" tflag is the number of times the test hit.
The value of any other type of hit test is "1". The value of any other type of hit test is "1".
For example: For example:
meta META2 (3 * TEST1 - 2 * TEST2) > 0 meta META2 (3 * TEST1 - 2 * TEST2) E<gt> 0
Note that Perl builtins and functions, like C<abs()>, B<can't> be Note that Perl builtins and functions, like C<abs()>, B<can't> be
used, and will be treated as rule names. used, and will be treated as rule names.
If you want to define a meta-rule, but do not want its individual sub-rules to 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 count towards the final score unless the entire meta-rule matches, give the
sub-rules names that start with '__' (two underscores). SpamAssassin will sub-rules names that start with '__' (two underscores). SpamAssassin will
ignore these for scoring. ignore these for scoring.
=item meta SYMBOLIC_TEST_NAME ... rules_matching(RULEGLOB) ... =item meta SYMBOLIC_TEST_NAME ... rules_matching(RULEGLOB) ...
skipping to change at line 3421 skipping to change at line 3415
value in db. value in db.
=item multiple =item multiple
The test will be evaluated multiple times, for use with meta rules. The test will be evaluated multiple times, for use with meta rules.
Only affects header, body, rawbody, uri, and full tests. Only affects header, body, rawbody, uri, and full tests.
=item maxhits=N =item maxhits=N
If B<multiple> is specified, limit the number of hits found to N. If B<multiple> 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), If the rule is used in a meta that counts the hits (e.g. __RULENAME E<gt> 5),
this is a way to avoid wasted extra work (use "tflags multiple maxhits=6"). this is a way to avoid wasted extra work (use "tflags multiple maxhits=6").
For example: For example:
uri __KAM_COUNT_URIS /^./ uri __KAM_COUNT_URIS /^./
tflags __KAM_COUNT_URIS multiple maxhits=16 tflags __KAM_COUNT_URIS multiple maxhits=16
describe __KAM_COUNT_URIS A multiple match used to count URIs in a message 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_0_URIS (__KAM_COUNT_URIS == 0)
meta __KAM_HAS_1_URIS (__KAM_COUNT_URIS >= 1) meta __KAM_HAS_1_URIS (__KAM_COUNT_URIS >= 1)
skipping to change at line 3482 skipping to change at line 3476
type => $CONF_TYPE_HASH_KEY_VALUE, type => $CONF_TYPE_HASH_KEY_VALUE,
}); });
=item priority SYMBOLIC_TEST_NAME n =item priority SYMBOLIC_TEST_NAME n
Assign a specific priority to a test. All tests, except for DNS and Meta Assign a specific priority to a test. All tests, except for DNS and Meta
tests, are run in increasing priority value order (negative priority values tests, are run in increasing priority value order (negative priority values
are run before positive priority values). The default test priority is 0 are run before positive priority values). The default test priority is 0
(zero). (zero).
The values <-99999999999999> and <-99999999999998> have a special meaning The values C<-99999999999999> and C<-99999999999998> have a special meaning
internally, and should not be used. internally, and should not be used.
=cut =cut
push (@cmds, { push (@cmds, {
setting => 'priority', setting => 'priority',
is_priv => 1, is_priv => 1,
type => $CONF_TYPE_HASH_KEY_VALUE, type => $CONF_TYPE_HASH_KEY_VALUE,
code => sub { code => sub {
my ($self, $key, $value, $line) = @_; my ($self, $key, $value, $line) = @_;
skipping to change at line 3575 skipping to change at line 3569
is_admin => 1, is_admin => 1,
code => sub { code => sub {
return unless defined $COLLECT_REGRESSION_TESTS; return unless defined $COLLECT_REGRESSION_TESTS;
my ($self, $key, $value, $line) = @_; my ($self, $key, $value, $line) = @_;
local ($1,$2,$3); local ($1,$2,$3);
if ($value !~ /^(\S+)\s+(ok|fail)\s+(.*)$/) { return $INVALID_VALUE; } if ($value !~ /^(\S+)\s+(ok|fail)\s+(.*)$/) { return $INVALID_VALUE; }
$self->{parser}->add_regression_test($1, $2, $3); $self->{parser}->add_regression_test($1, $2, $3);
} }
}); });
=item body_part_scan_size (default: 50000)
Per mime-part scan size limit in bytes for "body" type rules.
The decoded/stripped mime-part is truncated approx to this size.
Helps scanning large messages safely, so it's not necessary to
skip them completely. Disabled with 0.
=cut
push (@cmds, {
setting => 'body_part_scan_size',
is_admin => 1,
default => 50000,
type => $CONF_TYPE_NUMERIC,
});
=item rawbody_part_scan_size (default: 500000)
Like body_part_scan_size, for "rawbody" type rules.
=cut
push (@cmds, {
setting => 'rawbody_part_scan_size',
is_admin => 1,
default => 500000,
type => $CONF_TYPE_NUMERIC,
});
=item rbl_timeout t [t_min] [zone] (default: 15 3) =item rbl_timeout t [t_min] [zone] (default: 15 3)
All DNS queries are made at the beginning of a check and we try to read All DNS 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 the results at the end. This value specifies the maximum period of time
(in seconds) to wait for a DNS query. If most of the DNS queries have (in seconds) to wait for a DNS query. If most of the DNS queries have
succeeded for a particular message, then SpamAssassin will not wait for succeeded for a particular message, then SpamAssassin will not wait for
the full period to avoid wasting time on unresponsive server(s), but will the full period to avoid wasting time on unresponsive server(s), but will
shrink the timeout according to a percentage of queries already completed. shrink the timeout according to a percentage of queries already completed.
As the number of queries remaining approaches 0, the timeout value will As the number of queries remaining approaches 0, the timeout value will
gradually approach a t_min value, which is an optional second parameter gradually approach a t_min value, which is an optional second parameter
skipping to change at line 4349 skipping to change at line 4372
_HEADER(NAME)_ includes the value of a message header. value is the same _HEADER(NAME)_ includes the value of a message header. value is the same
as is found for header rules (see elsewhere in this doc) as is found for header rules (see elsewhere in this doc)
_TIMING_ timing breakdown report _TIMING_ timing breakdown report
_ADDEDHEADERHAM_ resulting header fields as requested by add_header for spam _ADDEDHEADERHAM_ resulting header fields as requested by add_header for spam
_ADDEDHEADERSPAM_ resulting header fields as requested by add_header for ham _ADDEDHEADERSPAM_ resulting header fields as requested by add_header for ham
_ADDEDHEADER_ same as ADDEDHEADERHAM for ham or ADDEDHEADERSPAM for spam _ADDEDHEADER_ same as ADDEDHEADERHAM for ham or ADDEDHEADERSPAM for spam
If a tag reference uses the name of a tag which is not in this list or defined 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 by a loaded plugin, the reference will be left intact and not replaced by any
value. value.
All template tag names should be restricted to the character set [A-Za-z0-9(,)].
Additional, plugin specific, template tags can be found in the documentation for Additional, plugin specific, template tags can be found in the documentation for
the following plugins: the following plugins:
L<Mail::SpamAssassin::Plugin::ASN> L<Mail::SpamAssassin::Plugin::ASN>
L<Mail::SpamAssassin::Plugin::AWL> L<Mail::SpamAssassin::Plugin::AWL>
L<Mail::SpamAssassin::Plugin::TxRep> L<Mail::SpamAssassin::Plugin::TxRep>
The C<HAMMYTOKENS> and C<SPAMMYTOKENS> tags have an optional second argument The C<HAMMYTOKENS> and C<SPAMMYTOKENS> tags have an optional second argument
which specifies a format. See the B<HAMMYTOKENS/SPAMMYTOKENS TAG FORMAT> which specifies a format. See the B<HAMMYTOKENS/SPAMMYTOKENS TAG FORMAT>
 End of changes. 20 change blocks. 
54 lines changed or deleted 79 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)