From: Thomas Lamprecht Date: Thu, 29 Oct 2020 14:20:17 +0000 (+0100) Subject: sendmail: code cleanup X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=a7886364a7e0880c84b707a5607a19a580b0be6c sendmail: code cleanup Signed-off-by: Thomas Lamprecht --- diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm index 7d33683..4b445ea 100644 --- a/src/PVE/Tools.pm +++ b/src/PVE/Tools.pm @@ -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';