From f8361ca6dcd74bc833183eee2110c3eb49a343d7 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 3 Jun 2013 09:08:41 +0200 Subject: [PATCH] E-Mail-Versand via SMTP: BCC-Feld in 'RCPT TO:' mitsenden Fixt #2285. --- SL/Mailer.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SL/Mailer.pm b/SL/Mailer.pm index 2857e1c75..6c7a20111 100644 --- a/SL/Mailer.pm +++ b/SL/Mailer.pm @@ -83,16 +83,23 @@ sub _create_message_id { sub _create_address_headers { my ($self) = @_; + # $self->{addresses} collects the recipients for use in e.g. the + # SMTP 'RCPT TO:' envelope command. $self->{headers} collects the + # headers that make up the actual email. 'BCC' should not be + # included there for certain transportation methods (SMTP). + $self->{addresses} = {}; foreach my $item (qw(from to cc bcc)) { $self->{addresses}->{$item} = []; - next if !$self->{$item} || $self->{driver}->keep_from_header($item); + next if !$self->{$item}; my @header_addresses; foreach my $addr_obj (Email::Address->parse($self->{$item})) { push @{ $self->{addresses}->{$item} }, $addr_obj->address; + next if $self->{driver}->keep_from_header($item); + my $phrase = $addr_obj->phrase(); if ($phrase) { $phrase =~ s/^\"//; -- 2.20.1