]> git.proxmox.com Git - pve-common.git/commitdiff
sendmail: code cleanup
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 29 Oct 2020 14:20:17 +0000 (15:20 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 29 Oct 2020 14:20:21 +0000 (15:20 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/Tools.pm

index 7d3368393809f7c3c767e7454d9f6f2b3418b2cd..4b445eafa784d526250e7632d93f02158645b8a7 100644 (file)
@@ -1450,16 +1450,14 @@ sub sendmail {
 
     $mailto = [ $mailto ] if !ref($mailto);
 
-    foreach (@$mailto) {
-       die "illegal character in mailto address\n"
-           if ($_ =~ $mail_re);
+    for my $to (@$mailto) {
+       die "illegal character in mailto address\n" if $to =~ $mail_re;
     }
 
     my $rcvrtxt = join (', ', @$mailto);
 
     $mailfrom = $mailfrom || "root";
-    die "illegal character in mailfrom address\n"
-       if $mailfrom =~ $mail_re;
+    die "illegal character in mailfrom address\n" if $mailfrom =~ $mail_re;
 
     $author = $author // 'Proxmox VE';