| 1 | # This code is part of Perl distribution Mail-Message version 4.05. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # The POD got stripped from this file by OODoc version 3.06. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # For contributors see file ChangeLog. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # This software is copyright (c) 2001-2026 by Mark Overmeer. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | # This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | # the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | #XXX Do the list still exist? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | #XXX Add Simplelists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | package Mail::Message::Head::ListGroup;{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 2 | our $VERSION = '4.05'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 2 | ▶ | use parent 'Mail::Message::Head::FieldGroup'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 2 | ▶ | use Log::Report 'mail-message', import => [ qw/__x error/ ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 2 | ▶ | use List::Util qw/first/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 2 | ▶ | use Scalar::Util qw/blessed/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | #-------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | sub init($$) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 20 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
init: called CC=8 SCAR=21.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 20 | $self->SUPER::init($args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 20 | my $address = $args->{address}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 20 | ▶ | if(!defined $address) { ; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | ▶ | elsif(!ref $address || !$address->isa('Mail::Message::Field::Address')) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
ref $address && $address->isa('Mail::Message::Field::Address')
MC/DC0%0/2
ref $address && $address->isa('Mail::Message::Field::Address')
ref $address
$address->isa('Mail::Message::Field::Address')
Truth table33%1/3
A && B
A= ref $addressB= $address->isa('Mail::Message::Field::Address')
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 1 | { require Mail::Message::Field::Address; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 1 | ▶ | my $mi = Mail::Message::Field::Address->coerce($address) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | or error __x"cannot convert '{address}' into an address object.", address => $address; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 1 | $address = $mi; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 20 | ▶ | $self->{MMHL_address} = $address if defined $args->{address}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 20 | ▶ | $self->{MMHL_listname} = $args->{listname} if defined $args->{listname}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 20 | ▶ | $self->{MMHL_rfc} = $args->{rfc} if defined $args->{rfc}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 20 | $self->{MMHL_fns} = []; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 20 | $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | sub from($) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 19 | ▶ | { my ($class, $from) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
from: called CC=25 SCAR=32.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 19 | ▶ | my $head = $from->isa('Mail::Message::Head') ? $from : $from->head; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 19 | my $self = $class->new(head => $head); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 19 | ▶ | $self->collectFields or return (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 17 | my ($type, $software, $version, $field); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 17 | ▶ | if(my $communigate = $head->get('X-ListServer')) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 14 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 2 | { ($software, $version) = $communigate =~ m/^(.*)\s+LIST\s*([\d.]+)\s*$/i; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 2 | ▶ | $type = ($software =~ m/Pro/ ? 'CommuniGatePro' : 'CommuniGate'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | elsif(my $mailman = $head->get('X-Mailman-Version')) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 2 | { $version = "$mailman"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 2 | $type = 'Mailman'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | elsif(my $majordomo = $head->get('X-Majordomo-Version')) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 0 | { $version = "$majordomo"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | $type = 'Majordomo'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | elsif(my $ecartis = $head->get('X-Ecartis-Version')) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 1 | { ($software, $version) = $ecartis =~ m/^(.*)\s+(v[\d.]+)/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 1 | $type = 'Ecartis'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | elsif(my $listar = $head->get('X-Listar-Version')) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 1 | { ($software, $version) = $listar =~ m/^(.*?)\s+(v[\w.]+)/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 1 | $type = 'Listar'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | ▶ | elsif(defined($field = $head->get('List-Software')) && $field =~ m/listbox/i) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
defined($field = $head->get("List-Software")) and $field =~ /listbox/i
MC/DC100%2/2
defined($field = $head->get("List-Software")) and $field =~ /listbox/i
defined($field = $head->get("List-Software"))
$field =~ /listbox/i
Truth table100%3/3
A and B
A= defined($field = $head->get("List-Software"))B= $field =~ /listbox/i
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 1 | { ($software, $version) = $field =~ m/^(\S*)\s*(v[\d.]+)\s*$/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 1 | $type = 'Listbox'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 42 | ▶ | elsif($field = first { m!LISTSERV-TCP/IP!s } $head->get('Received')) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | { # Listserv is hard to recognise | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 2 | ($software, $version) = $field =~ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | m!\( (LISTSERV-TCP/IP) \s+ release \s+ (\S+) \)!xs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 2 | $type = 'Listserv'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | ▶ | elsif(defined($field = $head->get('X-Mailing-List')) && $field =~ m[archive/latest]) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
defined($field = $head->get("X-Mailing-List")) and $field =~ m[archive/latest]
MC/DC50%1/2
defined($field = $head->get("X-Mailing-List")) and $field =~ m[archive/latest]
defined($field = $head->get("X-Mailing-List"))
$field =~ m[archive/latest]
Truth table66%2/3
A and B
A= defined($field = $head->get("X-Mailing-List"))B= $field =~ m[archive/latest]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 1 | { $type = 'Smartlist' } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | ▶ | elsif(defined($field = $head->get('Mailing-List')) && $field =~ m/yahoo/i ) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
defined($field = $head->get("Mailing-List")) and $field =~ /yahoo/i
MC/DC100%2/2
defined($field = $head->get("Mailing-List")) and $field =~ /yahoo/i
defined($field = $head->get("Mailing-List"))
$field =~ /yahoo/i
Truth table100%3/3
A and B
A= defined($field = $head->get("Mailing-List"))B= $field =~ /yahoo/i
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 1 | { $type = 'YahooGroups' } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | ▶ | elsif(defined($field) && $field =~ m/(ezmlm)/i ) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
defined $field and $field =~ /(ezmlm)/i
MC/DC50%1/2
defined $field and $field =~ /(ezmlm)/i
defined $field
$field =~ /(ezmlm)/i
Truth table66%2/3
A and B
A= defined $fieldB= $field =~ /(ezmlm)/i
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 1 | { $type = 'Ezmlm' } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | elsif(my $fml = $head->get('X-MLServer')) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 2 | { ($software, $version) = $fml =~ m/^\s*([^\s\[]+)\s*\[\S*\s*([^\]]*?)\s*\]/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 2 | $type = 'FML'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | ▶ | elsif(defined($field = $head->get('List-Subscribe') || $head->get('List-Unsubscribe')) && $field =~ m/sympa/i) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition83%5/6
defined($field = $head->get("List-Subscribe") || $head->get("List-Unsubscribe")) and $field =~ /sympa/i
$head->get('List-Subscribe') || $head->get('List-Unsubscribe')
MC/DC66%2/3
defined($field = $head->get("List-Subscribe") || $head->get("List-Unsubscribe")) and $field =~ /sympa/i
$head->get('List-Subscribe')
$head->get('List-Unsubscribe')
$field =~ /sympa/i
Truth table60%3/5
A || B and C
A= $head->get('List-Subscribe')B= $head->get('List-Unsubscribe')C= $field =~ /sympa/i
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 1 | { $type = 'Sympa' } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 7 | ▶ | elsif(first { m/majordom/i } $head->get('Received')) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | { # Majordomo is hard to recognize | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 1 | $type = "Majordomo"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | ▶ | elsif(defined($field = $head->get('List-ID')) && $field =~ m/listbox\.com/i) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
defined($field = $head->get("List-ID")) and $field =~ /listbox\.com/i
MC/DC0%0/2
defined($field = $head->get("List-ID")) and $field =~ /listbox\.com/i
defined($field = $head->get("List-ID"))
$field =~ /listbox\.com/i
Truth table33%1/3
A and B
A= defined($field = $head->get("List-ID"))B= $field =~ /listbox\.com/i
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 1 | { $type = "Listbox" } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 17 | $self->detected($type, $software, $version); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 17 | $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | sub rfc() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 18 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
rfc: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 18 | ▶ | return $self->{MMHL_rfc} if defined $self->{MMHL_rfc}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 18 | my $head = $self->head; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 18 | ▶ | defined $head->get('List-Post') ? 'rfc2369' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | : defined $head->get('List-Id') ? 'rfc2919' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | sub address() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 20 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
address: called CC=19 SCAR=31.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 20 | ▶ | return $self->{MMHL_address} if exists $self->{MMHL_address}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 17 | ▶ | my $type = $self->type || 'Unknown'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->type || 'Unknown'
MC/DC0%0/1
$self->type || 'Unknown'
$self->type
Truth table50%1/2
A
A= $self->type
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 17 | my $head = $self->head; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 17 | my ($field, $address); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 17 | ▶ | if($type eq 'Smartlist' && defined($field = $head->get('X-Mailing-List'))) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition66%2/3
$type eq "Smartlist" and defined($field = $head->get("X-Mailing-List"))
MC/DC50%1/2
$type eq "Smartlist" and defined($field = $head->get("X-Mailing-List"))
$type eq "Smartlist"
defined($field = $head->get("X-Mailing-List"))
Truth table66%2/3
A and B
A= $type eq "Smartlist"B= defined($field = $head->get("X-Mailing-List"))
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 1 | ▶ | { $address = $1 if $field =~ m/\<([^>]+)\>/ } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | elsif($type eq 'YahooGroups') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 1 | { $address = $head->get('X-Apparently-To')->unfoldedBody } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | elsif($type eq 'Listserv') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 2 | { $address = $head->get('Sender') } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 17 | ▶ | $address ||= $head->get('List-Post') || $head->get('Reply-To') || $head->get('Sender'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition55%5/9
$address ||= $head->get("List-Post") || $head->get("Reply-To") || $head->get("Sender")
$head->get('List-Post') || $head->get('Reply-To') || $head->get('Sender')
$head->get("List-Post") or $head->get("Reply-To")
MC/DC0%0/4
$address ||= $head->get("List-Post") || $head->get("Reply-To") || $head->get("Sender")
$address
$head->get("List-Post")
$head->get("Reply-To")
$head->get('Sender')
Truth table0%0/5
A ||= B or C || D
A= $addressB= $head->get("List-Post")C= $head->get("Reply-To")D= $head->get('Sender')
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 17 | ▶ | $address = $address->study if blessed $address; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 17 | ▶ | if(!defined $address) { ; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | elsif(!ref $address) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 2 | { $address =~ s/\bowner-|-(?:owner|bounce|admin)\@//i; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 2 | $address = Mail::Message::Field::Address->new(address => $address); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | elsif($address->isa('Mail::Message::Field::Addresses')) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | { # beautify | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 11 | $address = ($address->addresses)[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 11 | ▶ | my $username = defined $address ? $address->username : ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 11 | ▶ | if($username =~ s/^owner-|-(owner|bounce|admin)$//i) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | { $address = Mail::Message::Field::Address->new(username => $username, domain => $address->domain); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | elsif($address->isa('Mail::Message::Field::URIs')) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 4 | ▶ | { my $uri = first { $_->scheme eq 'mailto' } $address->URIs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 4 | ▶ | $address = defined $uri ? Mail::Message::Field::Address->new(address => $uri->to) : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | else # Don't understand life anymore :-( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | { undef $address; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 17 | $self->{MMHL_address} = $address; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | sub listname() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 1 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
listname: called CC=7 SCAR=23.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 1 | ▶ | exists $self->{MMHL_listname} and return $self->{MMHL_listname}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 1 | my $head = $self->head; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | # Some lists have a field with the name only | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 1 | ▶ | my $list = $head->get('List-ID') || $head->get('X-List') || $head->get('X-ML-Name'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%2/6
$head->get('List-ID') || $head->get('X-List') || $head->get('X-ML-Name')
$head->get("List-ID") or $head->get("X-List")
MC/DC0%0/3
$head->get('List-ID') || $head->get('X-List') || $head->get('X-ML-Name')
$head->get("List-ID")
$head->get("X-List")
$head->get('X-ML-Name')
Truth table25%1/4
A or B || C
A= $head->get("List-ID")B= $head->get("X-List")C= $head->get('X-ML-Name')
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 1 | my $listname; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 1 | ▶ | if(defined $list) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | { $listname = $list->study->decodedBody; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | elsif(my $address = $self->address) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 1 | ▶ | { $listname = $address->phrase || $address->address; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$address->phrase || $address->address
MC/DC0%0/2
$address->phrase || $address->address
$address->phrase
$address->address
Truth table33%1/3
A || B
A= $address->phraseB= $address->address
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 1 | $self->{MMHL_listname} = $listname; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | #-------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 2 | my $list_field_names = qr/ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | ^ (?: List|X-Envelope|X-Original ) - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | | ^ (?: Precedence|Mailing-List|Approved-By ) $ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | | ^ X-(?: Loop|BeenThere|Sequence|List|Sender|MLServer ) $ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | | ^ X-(?: Mailman|Listar|Egroups|Encartis|ML ) - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | | ^ X-(?: Archive|Mailing|Original|Mail|ListServer ) - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | | ^ (?: Mail-Followup|Delivered|Errors|X-Apperently ) -To $ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | /xi; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | ▶ | sub isListGroupFieldName($) { $_[1] =~ $list_field_names } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
isListGroupFieldName: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | #-------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | sub collectFields() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 19 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
collectFields: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 19 | my @names = map $_->name, $self->head->grepNames($list_field_names); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 19 | $self->addFields(@names); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 19 | @names; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | #-------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | sub details() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 17 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
details: called CC=8 SCAR=20.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 17 | ▶ | my $type = $self->type || 'Unknown'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->type || 'Unknown'
MC/DC0%0/1
$self->type || 'Unknown'
$self->type
Truth table50%1/2
A
A= $self->type
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 17 | my $software = $self->software; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 17 | my $version = $self->version; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 17 | ▶ | undef $software if defined $software && $type eq $software; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $software and $type eq $software
MC/DC100%2/2
defined $software and $type eq $software
defined $software
$type eq $software
Truth table100%3/3
A and B
A= defined $softwareB= $type eq $software
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 17 | ▶ | my $release | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | = defined $software | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | ? (defined $version ? " ($software $version)" : " ($software)") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | : (defined $version ? " ($version)" : ''); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 17 | ▶ | my $address = $self->address || 'unknown address'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->address || 'unknown address'
MC/DC0%0/1
$self->address || 'unknown address'
$self->address
Truth table50%1/2
A
A= $self->address
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 17 | my $fields = scalar $self->fields; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 17 | "$type at $address$release, $fields fields"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | #-------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||