all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH common v2 2/2] sendmail helper: allow empty display name in from
Date: Thu,  3 Sep 2020 14:09:45 +0200	[thread overview]
Message-ID: <20200903120946.23596-3-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20200903120946.23596-1-s.ivanov@proxmox.com>

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>
---
 src/PVE/Tools.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
index 3b5b199..e04b504 100644
--- a/src/PVE/Tools.pm
+++ b/src/PVE/Tools.pm
@@ -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' - $!";
-- 
2.20.1





  parent reply	other threads:[~2020-09-03 12:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03 12:09 [pve-devel] [PATCH common/manager v2] adapt PVE::Tools::sendmail to match rust-implementation and use it for apt update notifications Stoiko Ivanov
2020-09-03 12:09 ` [pve-devel] [PATCH common v2 1/2] sendmail-helper: only send multipart if necessary Stoiko Ivanov
2020-09-03 12:09 ` Stoiko Ivanov [this message]
2020-09-03 12:09 ` [pve-devel] [PATCH manager v2 1/1] use PVE::Tools::sendmail for update notifications Stoiko Ivanov
2020-09-07  8:06 ` [pve-devel] applied-series: [PATCH common/manager v2] adapt PVE::Tools::sendmail to match rust-implementation and use it for apt " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200903120946.23596-3-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal