| 1 | package Mail::Karmasphere::Parser::RBL::Mixed; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | 2 | ▶ | use base 'Mail::Karmasphere::Parser::RBL::Base'; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | 2 | ▶ | use Mail::Karmasphere::Parser::Record; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 7 | |||||||||||||||
| 8 | 1 | ▶ | sub _streams { qw(ip4 domain) } | ||||||||||||
|
Subroutine
_streams: called CC=1 SCAR=0.0
| |||||||||||||||
| 9 | |||||||||||||||
| 10 | 0 | ▶ | sub my_format { "rbl.mixed" } # if the source table's "magic" field is rbl.mixed, this module deals with it. | ||||||||||||
|
Subroutine
my_format: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||
| 11 | |||||||||||||||
| 12 | 12 | ▶ | sub tweaks { | ||||||||||||
|
Subroutine
tweaks: called CC=3 SCAR=11.2
Pod
undocumented
| |||||||||||||||
| 13 | 12 | my $self = shift; | |||||||||||||
| 14 | 12 | my $identity = shift; | |||||||||||||
| 15 | # if it's a domain identity, we output to the domain stream. | ||||||||||||||
| 16 | # if it's an ip4 identity, we output to the ip4 stream. | ||||||||||||||
| 17 | 12 | my $type = Mail::Karmasphere::Parser::Record::guess_identity_type($identity); | |||||||||||||
| 18 | 12 | my $stream; | |||||||||||||
| 19 | 12 | ▶ | if ($type eq "ip4") { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 20 | 6 | $stream = 0; | |||||||||||||
| 21 | # in an rbl.mixed input file, we'll find things like "4.3.2.1". | ||||||||||||||
| 22 | # we want to return "1.2.3.4". | ||||||||||||||
| 23 | 6 | $identity = join ".", reverse split /\./, $identity; | |||||||||||||
| 24 | } | ||||||||||||||
| 25 | elsif ($type eq "domain") { | ||||||||||||||
| 26 | 6 | $stream = 1; | |||||||||||||
| 27 | } | ||||||||||||||
| 28 | else { | ||||||||||||||
| 29 | 0 | $self->warning("guessed type=$type for identity=$identity, skipping."); | |||||||||||||
| 30 | 0 | return; | |||||||||||||
| 31 | } | ||||||||||||||
| 32 | |||||||||||||||
| 33 | 12 | return ($type, $stream, $identity); | |||||||||||||
| 34 | } | ||||||||||||||
| 35 | |||||||||||||||
| 36 | |||||||||||||||
| 37 | 2 | 1; | |||||||||||||