Subject: | NIL personal name returned by *_addresses methods |
There is a bug in *_addresses family methods of
Mail::IMAPClient::BodyStructure::Envelope Subclass. They return NIL in
spite of documentation which says "The addresses are in the format
personalname <mailboxname@hostname>. However, if the personal name is
'NIL' then it is omitted from the address."
So, I opened the code and found this:
sub _addresses($$$)
{ my ($self, $name, $isSender) = @_;
ref $self->{$name} eq 'ARRAY'
or return ();
my @list;
foreach ( @{$self->{$name}} )
{ my $pn = $_->personalname;
my $name = $pn && $pn ne 'NIL' ? "$pn " : '';
push @list, $pn. '<'.$_->mailboxname .'@'. $_->hostname.'>';
}
wantarray ? @list
: $isSender ? $list[0]
: \@list;
}
You use $pn variable when composing the result instead of $name.