| 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 | package Mail::Message;{ | ||||||||||||||||||||||||||||||||||||||||||
| 13 | 2 | our $VERSION = '4.05'; | |||||||||||||||||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | 2 | ▶ | use Log::Report 'mail-message', import => [ qw/__x error trace/ ]; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | 2 | ▶ | use Mail::Message::Head::Complete (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 2 | ▶ | use Mail::Message::Field (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | #-------------------- | ||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | sub bounce(@) | ||||||||||||||||||||||||||||||||||||||||||
| 28 | 1 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
bounce: called CC=10 SCAR=31.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 1 | my $bounce = $self->clone; | |||||||||||||||||||||||||||||||||||||||||
| 30 | 1 | my $head = $bounce->head; | |||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | 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")
| |||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | { $head->addResentGroup(shift); | |||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | return $bounce; | |||||||||||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | 1 | my @rgs = $head->resentGroups; | |||||||||||||||||||||||||||||||||||||||||
| 38 | 1 | my $rg = $rgs[0]; | |||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||
| 40 | 1 | ▶ | if(defined $rg) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | { $rg->delete; # Remove group to re-add it later: otherwise | |||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | ▶ | while(@_) # field order in header would be disturbed. | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | { my $field = shift; | |||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | ref $field ? $rg->set($field) : $rg->set($field, shift); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||
| 47 | elsif(@_) | ||||||||||||||||||||||||||||||||||||||||||
| 48 | 1 | { $rg = Mail::Message::Head::ResentGroup->new(@_); | |||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||
| 50 | else | ||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | { error __x"method bounce requires To, Cc, or Bcc."; | |||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 1 | ▶ | $rg->set(Date => Mail::Message::Field->toDate) unless defined $rg->date; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||
| 56 | 1 | ▶ | unless(defined $rg->messageId) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | { my $msgid = $head->createMessageId; | |||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | $rg->set('Message-ID' => "<$msgid>"); | |||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | 1 | $head->addResentGroup($rg); | |||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | # Flag action to original message | ||||||||||||||||||||||||||||||||||||||||||
| 64 | 1 | $self->label(passed => 1); # used by some maildir clients | |||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||
| 66 | 1 | $bounce; | |||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||
| 69 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||