-
Notifications
You must be signed in to change notification settings - Fork 70
/
dnsbl_sc_meta.t
executable file
·58 lines (41 loc) · 1.35 KB
/
dnsbl_sc_meta.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/perl
use lib '.'; use lib 't';
use SATest; sa_t_init("dnsbl_sc_meta");
use constant TEST_ENABLED => conf_bool('run_net_tests');
use constant HAS_NET_DNS => eval { require Net::DNS; };
# bug 3806:
# Do not run this test on non-Linux unices as root, due to a bug
# in Sys::Hostname::Long (which Net::DNS uses.)
use constant IS_LINUX => $^O eq 'linux';
use constant IS_WINDOWS => ($^O =~ /^(mswin|dos|os2)/oi);
use constant AM_ROOT => $< == 0;
use constant DO_RUN => TEST_ENABLED && HAS_NET_DNS &&
!(AM_ROOT &&
!(IS_LINUX || IS_WINDOWS));
use Test;
BEGIN {
plan tests => (DO_RUN ? 2 : 0),
};
exit unless (DO_RUN);
# ---------------------------------------------------------------------------
%patterns = (
q{ DNSBL_TEST_TOP } => 'DNSBL_TEST_TOP',
q{ SC_DNSBL } => 'SC_DNSBL',
);
%anti_patterns = (
);
tstprefs("
loadplugin Mail::SpamAssassin::Plugin::Shortcircuit
rbl_timeout 60
clear_trusted_networks
trusted_networks 127.
trusted_networks 10.
trusted_networks 150.51.53.1
header DNSBL_TEST_TOP eval:check_rbl('test', 'dnsbltest.spamassassin.org.')
tflags DNSBL_TEST_TOP net
meta SC_DNSBL (DNSBL_TEST_TOP)
priority SC_DNSBL -700
shortcircuit SC_DNSBL on
");
sarun ("-t < data/spam/dnsbl.eml 2>&1", \&patterns_run_cb);
ok_all_patterns();