- if ( $self->TransactionObj->Attachments->First ) {
- my @cc_addresses = Mail::Address->parse($self->TransactionObj->Attachments->First->GetHeader('RT-Send-Cc'));
- foreach my $addr (@cc_addresses) {
- push @Cc, $addr->address;
- }
- my @bcc_addresses = Mail::Address->parse($self->TransactionObj->Attachments->First->GetHeader('RT-Send-Bcc'));
-
- foreach my $addr (@bcc_addresses) {
- push @Bcc, $addr->address;
- }
-
+ if ( my $attachment = $self->TransactionObj->Attachments->First ) {
+ push @Cc, map { $_->address } Email::Address->parse(
+ $attachment->GetHeader('RT-Send-Cc')
+ );
+ push @Bcc, map { $_->address } Email::Address->parse(
+ $attachment->GetHeader('RT-Send-Bcc')
+ );