File: uribl_ips_only.t

package info (click to toggle)
spamassassin 4.0.1%2Bsvn1923525-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 22,104 kB
  • sloc: perl: 87,831; ansic: 5,193; sh: 3,712; javascript: 339; sql: 295; makefile: 209; python: 49
file content (40 lines) | stat: -rwxr-xr-x 1,035 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl -T
# bug 6335: ips_only URIDNSBL rules

use lib '.'; use lib 't';
use SATest; sa_t_init("uribl_ips_only");

use Test::More;
plan skip_all => "Net tests disabled"          unless conf_bool('run_net_tests');
plan skip_all => "Can't use Net::DNS Safely"   unless can_use_net_dns_safely();
plan tests => 4;

# ---------------------------------------------------------------------------

%anti_patterns = (
  q{ X_URIBL_IPSONLY } => 'A',
);

tstlocalrules(q{

  rbl_timeout 30

  urirhssub  X_URIBL_IPSONLY  dnsbltest.spamassassin.org.    A 2
  body       X_URIBL_IPSONLY  eval:check_uridnsbl('X_URIBL_IPSONLY')
  tflags     X_URIBL_IPSONLY  net ips_only

  add_header all RBL _RBL_

});

# note: don't leave -D here, it causes spurious passes
ok sarun ("-t < data/spam/dnsbl_ipsonly.eml 2>&1", \&patterns_run_cb);
ok_all_patterns();

%patterns = ( q{ 1.0 X_URIBL_IPSONLY } => 'A' );
%anti_patterns = ();

clear_pattern_counters();
ok sarun ("-t < data/spam/dnsbl_domsonly.eml 2>&1", \&patterns_run_cb);
ok_all_patterns();