| 1 | # Copyrights 2001-2022 by [Mark Overmeer <markov@cpan.org>]. | ||||||||||||||||||||||||||||||||||||||||||
| 2 | # For other contributors see ChangeLog. | ||||||||||||||||||||||||||||||||||||||||||
| 3 | # See the manual pages for details on the licensing terms. | ||||||||||||||||||||||||||||||||||||||||||
| 4 | # Pod stripped from pm file by OODoc 2.03. | ||||||||||||||||||||||||||||||||||||||||||
| 5 | # This code is part of distribution Mail-Message. Meta-POD processed with | ||||||||||||||||||||||||||||||||||||||||||
| 6 | # OODoc into POD and HTML manual-pages. See README.md | ||||||||||||||||||||||||||||||||||||||||||
| 7 | # Copyright Mark Overmeer. Licensed under the same terms as Perl itself. | ||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | package Mail::Message; | ||||||||||||||||||||||||||||||||||||||||||
| 10 | 2 | ▶ | use vars '$VERSION'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | 2 | $VERSION = '3.012'; | |||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | 2 | ▶ | use Mail::Message::Head::Complete; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 2 | ▶ | use Mail::Message::Field; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | 2 | ▶ | use Carp qw/croak/; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | sub bounce(@) | ||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
bounce: called CC=10 SCAR=32.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 1 | my $bounce = $self->clone; | |||||||||||||||||||||||||||||||||||||||||
| 25 | 1 | my $head = $bounce->head; | |||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | 1 | ▶ | if(@_==1 && ref $_[0] && $_[0]->isa('Mail::Message::Head::ResentGroup' )) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
@_ == 1 and ref $_[0] and $_[0]->isa("Mail::Message::Head::ResentGroup")
@_ == 1 and ref $_[0]
MC/DC0%0/3
@_ == 1 and ref $_[0] and $_[0]->isa("Mail::Message::Head::ResentGroup")
@_ == 1
ref $_[0]
$_[0]->isa("Mail::Message::Head::ResentGroup")
Truth table25%1/4
A and B and C
A= @_ == 1B= ref $_[0]C= $_[0]->isa("Mail::Message::Head::ResentGroup")
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | { $head->addResentGroup(shift); | |||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | return $bounce; | |||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | 1 | my @rgs = $head->resentGroups; | |||||||||||||||||||||||||||||||||||||||||
| 33 | 1 | my $rg = $rgs[0]; | |||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | 1 | ▶ | if(defined $rg) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | { $rg->delete; # Remove group to re-add it later: otherwise | |||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | ▶ | while(@_) # field order in header would be disturbed. | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | { my $field = shift; | |||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | ref $field ? $rg->set($field) : $rg->set($field, shift); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||
| 42 | elsif(@_) | ||||||||||||||||||||||||||||||||||||||||||
| 43 | 1 | { $rg = Mail::Message::Head::ResentGroup->new(@_); | |||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||
| 45 | else | ||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | { $self->log(ERROR => "Method bounce requires To, Cc, or Bcc"); | |||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | return undef; | |||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||
| 50 | # | ||||||||||||||||||||||||||||||||||||||||||
| 51 | # Add some nice extra fields. | ||||||||||||||||||||||||||||||||||||||||||
| 52 | # | ||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 1 | ▶ | $rg->set(Date => Mail::Message::Field->toDate) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 55 | unless defined $rg->date; | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | 1 | ▶ | unless(defined $rg->messageId) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | { my $msgid = $head->createMessageId; | |||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | $rg->set('Message-ID' => "<$msgid>"); | |||||||||||||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||
| 62 | 1 | $head->addResentGroup($rg); | |||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||
| 64 | # | ||||||||||||||||||||||||||||||||||||||||||
| 65 | # Flag action to original message | ||||||||||||||||||||||||||||||||||||||||||
| 66 | # | ||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||
| 68 | 1 | $self->label(passed => 1); # used by some maildir clients | |||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||
| 70 | 1 | $bounce; | |||||||||||||||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||
| 73 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||