sendmail helper: allow empty display name in from

This patch enables the sendmail helper sub to send emails with a non-existant
display name in the from address. This is used to replace the direct call to
the sendmail binary in pve-manager/PVE/API2/APT.pm.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
This commit is contained in:
Stoiko Ivanov 2020-09-03 14:09:45 +02:00 committed by Thomas Lamprecht
parent b18826ce61
commit a24d91ea08

View File

@ -1457,7 +1457,7 @@ sub sendmail {
die "illegal character in mailfrom address\n"
if $mailfrom =~ $mail_re;
$author = $author || 'Proxmox VE';
$author = $author // 'Proxmox VE';
open (MAIL, "|-", "sendmail", "-B", "8BITMIME", "-f", $mailfrom, "--", @$mailto) ||
die "unable to open 'sendmail' - $!";