public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH pmg-api] d/postinst: do not error out on chown/chmod /var/spool/pmg/
@ 2026-06-22  8:21 Stoiko Ivanov
  2026-07-14  9:30 ` Dominik Csapak
  2026-07-15 13:10 ` applied: " Fabian Grünbichler
  0 siblings, 2 replies; 3+ messages in thread
From: Stoiko Ivanov @ 2026-06-22  8:21 UTC (permalink / raw)
  To: pmg-devel

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 <s.ivanov@proxmox.com>
---
 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





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH pmg-api] d/postinst: do not error out on chown/chmod /var/spool/pmg/
  2026-06-22  8:21 [PATCH pmg-api] d/postinst: do not error out on chown/chmod /var/spool/pmg/ Stoiko Ivanov
@ 2026-07-14  9:30 ` Dominik Csapak
  2026-07-15 13:10 ` applied: " Fabian Grünbichler
  1 sibling, 0 replies; 3+ messages in thread
From: Dominik Csapak @ 2026-07-14  9:30 UTC (permalink / raw)
  To: Stoiko Ivanov, pmg-devel

Looks mostly good for me, the only downside to this i could imagine
would be that other failure wouldn't be detected anymore (e.g. wrong
permissions, broken storage, etc.) but i guess these will
appear with processing mails anyway sooner or later..

from my POV this change should be fine

On 6/22/26 10:22 AM, Stoiko Ivanov wrote:
> 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 <s.ivanov@proxmox.com>
> ---
>   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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* applied: [PATCH pmg-api] d/postinst: do not error out on chown/chmod /var/spool/pmg/
  2026-06-22  8:21 [PATCH pmg-api] d/postinst: do not error out on chown/chmod /var/spool/pmg/ Stoiko Ivanov
  2026-07-14  9:30 ` Dominik Csapak
@ 2026-07-15 13:10 ` Fabian Grünbichler
  1 sibling, 0 replies; 3+ messages in thread
From: Fabian Grünbichler @ 2026-07-15 13:10 UTC (permalink / raw)
  To: pmg-devel, Stoiko Ivanov


On Mon, 22 Jun 2026 10:21:17 +0200, Stoiko Ivanov wrote:
> 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.
> 
> [...]

Applied, thanks!

[1/1] d/postinst: do not error out on chown/chmod /var/spool/pmg/
      commit: 138e1574d91ff91f32a8d14690e783f8a2913986

Best regards,
-- 
Fabian Grünbichler <f.gruenbichler@proxmox.com>




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-15 13:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-22  8:21 [PATCH pmg-api] d/postinst: do not error out on chown/chmod /var/spool/pmg/ Stoiko Ivanov
2026-07-14  9:30 ` Dominik Csapak
2026-07-15 13:10 ` applied: " Fabian Grünbichler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal