From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id CB9211FF38F for ; Mon, 24 Jun 2024 14:31:32 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0247436400; Mon, 24 Jun 2024 14:31:40 +0200 (CEST) From: Lukas Wagner To: pve-devel@lists.proxmox.com Date: Mon, 24 Jun 2024 14:31:31 +0200 Message-Id: <20240624123134.321417-3-l.wagner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240624123134.321417-1-l.wagner@proxmox.com> References: <20240624123134.321417-1-l.wagner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.005 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH proxmox 3/6] notify: sendmail: make mailfrom and author non-optional X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Signed-off-by: Lukas Wagner --- proxmox-notify/src/endpoints/sendmail.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/proxmox-notify/src/endpoints/sendmail.rs b/proxmox-notify/src/endpoints/sendmail.rs index e75902fc..0f7a61b0 100644 --- a/proxmox-notify/src/endpoints/sendmail.rs +++ b/proxmox-notify/src/endpoints/sendmail.rs @@ -141,8 +141,8 @@ impl Endpoint for SendmailEndpoint { &subject, Some(&text_part), Some(&html_part), - Some(&mailfrom), - Some(&author), + &mailfrom, + &author, ) .map_err(|err| Error::NotifyFailed(self.config.name.clone(), err.into())) } @@ -174,8 +174,8 @@ fn sendmail( subject: &str, text: Option<&str>, html: Option<&str>, - mailfrom: Option<&str>, - author: Option<&str>, + mailfrom: &str, + author: &str, ) -> Result<(), Error> { use std::fmt::Write as _; @@ -184,9 +184,7 @@ fn sendmail( "At least one recipient has to be specified!".into(), )); } - let mailfrom = mailfrom.unwrap_or("root"); let recipients = mailto.join(","); - let author = author.unwrap_or("Proxmox Backup Server"); let now = proxmox_time::epoch_i64(); @@ -339,8 +337,8 @@ mod test { "Subject2", None, Some("HTML"), - None, - Some("test1"), + "root", + "Proxmox", ); assert!(result.is_err()); } -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel