From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id A29C21FF168 for ; Mon, 22 Jun 2026 10:22:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 55ABC2855; Mon, 22 Jun 2026 10:22:19 +0200 (CEST) From: Stoiko Ivanov To: pmg-devel@lists.proxmox.com Subject: [PATCH pmg-api] d/postinst: do not error out on chown/chmod /var/spool/pmg/ Date: Mon, 22 Jun 2026 10:21:17 +0200 Message-ID: <20260622082137.2431-1-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1782116494801 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.084 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 Message-ID-Hash: ZCPFLWCL43ZGFHDWF7ENR7TIRYTV4VK5 X-Message-ID-Hash: ZCPFLWCL43ZGFHDWF7ENR7TIRYTV4VK5 X-MailFrom: s.ivanov@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: When /var/spool/pmg is a dedicated mountpoint on an unpriviledged container, its `.lost+found` is not writeable by root inside the container. In this case - it makes sense to not cause postinst to error-out, as the failing change of mode/ownership is not problematic. I don't think that it's a too common setup, but as /var/spool/pmg is one of the places which does grow with more usage (quarantined files) having it on a separate mount-point can make sense. I considered guarding all the changes of metadata with '|| true', but as failing to change ownership will result in broken mail-processing for most of the changes it seems better to fail during apt to have the user notice the issue as early as possible. reported in our community forum: https://forum.proxmox.com/threads/184240/post-858302 Signed-off-by: Stoiko Ivanov --- debian/postinst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/postinst b/debian/postinst index ee218ab9..ce514ade 100644 --- a/debian/postinst +++ b/debian/postinst @@ -40,8 +40,8 @@ migrate_pmg_smtp_filter() { printf "Adjusting group ownership of the mail spool, this might take a while\n" # no -v: the spool can hold millions of mails - chgrp -R pmg /var/spool/pmg - chmod -R g+w /var/spool/pmg + chgrp -R pmg /var/spool/pmg || true + chmod -R g+w /var/spool/pmg || true chgrp -Rv pmg /etc/pmg/dkim chmod -Rv g+rX /etc/pmg/dkim -- 2.47.3