X-Git-Url: https://git.jankratochvil.net/?p=PerlMail.git;a=blobdiff_plain;f=perlmail-sendmail;h=3cf3f3fe3ae6f09a9c30590a53159d741961bd4f;hp=4831db221e6eb4535712409d287cc179c8f62bc8;hb=42c28285247c74238b364b82ef875fa83e0ab9a8;hpb=64c177cdda789cf1acfb4095abc067bf781d60e6 diff --git a/perlmail-sendmail b/perlmail-sendmail index 4831db2..3cf3f3f 100755 --- a/perlmail-sendmail +++ b/perlmail-sendmail @@ -231,7 +231,11 @@ my $from_headername; } my $exitcode=0; -my @rcpts=(@addr ? @addr : (undef())); # !defined($rcpt) if we have no recipients +# !defined($rcpt) if we have no recipients +# make the list unique to prevent dupes being normally filtered by sendmail(8) +# one '{' is block-wrapper, another '{' is hash-indirection! +my @rcpts=keys(%{{ map(($_=>1),(@addr ? @addr : (undef()))) }}); + my $stdin_body=(@rcpts<=1 ? undef() : do { # store input data only if it will be used multiple times local $/=undef(); ;