Fix emission of repeated email addresses
authorJacob Bachmeyer <jcb@gnu.org>
Fri, 28 Oct 2022 22:42:45 +0000 (17:42 -0500)
committerJacob Bachmeyer <jcb@gnu.org>
Fri, 28 Oct 2022 22:42:45 +0000 (17:42 -0500)
This bug was discovered when support for checking for repeated email
addresses was developed for the testsuite.

gatekeeper.pl

index f3a0708b3f8397032f3440e0cf34375598729d29..3011c77ba7b11d897844545cf290331534a7b31e 100755 (executable)
@@ -1069,7 +1069,8 @@ sub mail {
       ftp_abort("FATAL: SMTP connection failed") unless $smtp;
 
       $smtp->mail($sender);
-      $smtp->bcc($email_always) if ($send_to_user);
+      $smtp->bcc($email_always)
+       if ($send_to_user && !grep $_ eq $email_always, @email_list);
       $smtp->recipient(@email_list, { SkipBad => 1});
 
       $smtp->data();