From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <m.sandoval@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 73E48B9A3E
 for <pve-devel@lists.proxmox.com>; Mon, 11 Dec 2023 17:18:01 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 556641AEBC
 for <pve-devel@lists.proxmox.com>; Mon, 11 Dec 2023 17:17:31 +0100 (CET)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS
 for <pve-devel@lists.proxmox.com>; Mon, 11 Dec 2023 17:17:30 +0100 (CET)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 2067145EC9
 for <pve-devel@lists.proxmox.com>; Mon, 11 Dec 2023 17:17:30 +0100 (CET)
References: <20231129121812.145409-1-l.wagner@proxmox.com>
User-agent: mu4e 1.10.7; emacs 29.1
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Date: Mon, 11 Dec 2023 16:55:55 +0100
In-reply-to: <20231129121812.145409-1-l.wagner@proxmox.com>
Message-ID: <s8osf48soh2.fsf@proxmox.com>
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.002 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
 T_SCC_BODY_TEXT_LINE    -0.01 -
Subject: Re: [pve-devel] [PATCH widget-toolkit] notify: sendmail: smtp: fix
 mailto/mailto-user parameter deletion
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Mon, 11 Dec 2023 16:18:01 -0000


Lukas Wagner <l.wagner@proxmox.com> writes:

> Both fields were moved to a separate panel at some point, but this
> broke parameter deletion behavior (e.g. if a target is modified and
> switches from using mailto to mailto-user, then mailto should be
> deleted)
>
> Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>

The commit message was not immediately clear for me.

If one sets X, Y as the values of "Recipient(s)", and "Additional
Recipients(s)" in a Sendmail notification target, and then modifies it
so that either X=`` or Y=``, /etc/pve/notifications.cfg will incorrectly
contain the old values instead of removing the corresponding line:

    sendmail: test
            mailto Y
            mailto-user X

Tested setting both mailto and mailto-user to `` from non-nil values and
switching their values around. The patch fixes this as far as my testing
went.

Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>

--
Maximiliano