From 67caf0c8cfc91bd6c15970e511313aad0ce0f7f3 Mon Sep 17 00:00:00 2001 From: ofthesun9 Date: Mon, 4 May 2020 15:41:53 +0000 Subject: [PATCH 1/4] Check /queue permissions before postfix start postfix and posdrop id might have changed after base image change --- core/postfix/start.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/postfix/start.py b/core/postfix/start.py index c32099bf..e8766175 100755 --- a/core/postfix/start.py +++ b/core/postfix/start.py @@ -64,4 +64,8 @@ if "RELAYUSER" in os.environ: # Run Podop and Postfix multiprocessing.Process(target=start_podop).start() os.system("/usr/libexec/postfix/post-install meta_directory=/etc/postfix create-missing") +# Before starting postfix, we need to check permissions on /queue +# in the event that postfix,postdrop id have changed +os.system("chown postfix -R /queue/{active,bounce,corrupt,defer,deferred,flush,hold,incoming,maildrop,pid,private,public,saved,trace}") +os.system("chown postdrop -R /queue/{maildrop,public}") os.system("postfix start-fg") From 3a9c9d043656daa084faf2f91ea07c75ceb01d4c Mon Sep 17 00:00:00 2001 From: ofthesun9 Date: Mon, 4 May 2020 17:15:15 +0000 Subject: [PATCH 2/4] Fixed typo --- core/postfix/start.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/postfix/start.py b/core/postfix/start.py index e8766175..c5bf073e 100755 --- a/core/postfix/start.py +++ b/core/postfix/start.py @@ -66,6 +66,6 @@ multiprocessing.Process(target=start_podop).start() os.system("/usr/libexec/postfix/post-install meta_directory=/etc/postfix create-missing") # Before starting postfix, we need to check permissions on /queue # in the event that postfix,postdrop id have changed -os.system("chown postfix -R /queue/{active,bounce,corrupt,defer,deferred,flush,hold,incoming,maildrop,pid,private,public,saved,trace}") -os.system("chown postdrop -R /queue/{maildrop,public}") +os.system("chown -R postfix /queue/{active,bounce,corrupt,defer,deferred,flush,hold,incoming,maildrop,pid,private,public,saved,trace}") +os.system("chgrp -R postdrop /queue/{maildrop,public}") os.system("postfix start-fg") From 381bf747cc2951b2120853024027de1956cdfb46 Mon Sep 17 00:00:00 2001 From: ofthesun9 Date: Mon, 4 May 2020 18:18:32 +0000 Subject: [PATCH 3/4] Check permissions using postfix set-permissions --- core/postfix/start.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/postfix/start.py b/core/postfix/start.py index c5bf073e..b68303e1 100755 --- a/core/postfix/start.py +++ b/core/postfix/start.py @@ -66,6 +66,5 @@ multiprocessing.Process(target=start_podop).start() os.system("/usr/libexec/postfix/post-install meta_directory=/etc/postfix create-missing") # Before starting postfix, we need to check permissions on /queue # in the event that postfix,postdrop id have changed -os.system("chown -R postfix /queue/{active,bounce,corrupt,defer,deferred,flush,hold,incoming,maildrop,pid,private,public,saved,trace}") -os.system("chgrp -R postdrop /queue/{maildrop,public}") +os.system("postfix set-permissions") os.system("postfix start-fg") From 455814d51f950c841c999edfc1093dcaba713c33 Mon Sep 17 00:00:00 2001 From: ofthesun9 Date: Mon, 4 May 2020 18:55:01 +0000 Subject: [PATCH 4/4] Add newsfragment for pr1486 --- towncrier/newsfragments/1486.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 towncrier/newsfragments/1486.bugfix diff --git a/towncrier/newsfragments/1486.bugfix b/towncrier/newsfragments/1486.bugfix new file mode 100644 index 00000000..3053455d --- /dev/null +++ b/towncrier/newsfragments/1486.bugfix @@ -0,0 +1 @@ +Check postfix mailqueue permissions before start-up