Skip to content

fix: ONE_DIR=1 should keep correct permissions for spool-postfix#2273

Merged
polarathene merged 1 commit intodocker-mailserver:masterfrom
polarathene:fix/one-dir-postfix-postdrop
Oct 31, 2021
Merged

fix: ONE_DIR=1 should keep correct permissions for spool-postfix#2273
polarathene merged 1 commit intodocker-mailserver:masterfrom
polarathene:fix/one-dir-postfix-postdrop

Conversation

@polarathene
Copy link
Copy Markdown
Member

@polarathene polarathene commented Oct 31, 2021

Description

A PR in July 2017 contained a fix for this but was rejected due to other changes proposed:

Fixing permissions problems for /var/mail-state/spool-postfix when ONE_DIR=1:

  • spool-postfix/maildrop and spool-postfix/public folders must be owned by group postdrop
  • spool-postfix/[dev/etc/lib/pid/usr] permissions were not restrictive enough. They should be owned by the root user and root group.

I have looked at the source destination and the permissions remain the same. This PR carries over the ownership to the ONE_DIR location.

An alternative fix in future might be to use rsync which can copy over the contents with permissions and everything else retained. I'm not super familiar with the ONE_DIR handling myself. I see that it appears to do some cleanup and mostly symlinking (for files?) and moving for directories?


I came across this when looking into postdrop in regards to maildrop while working on this PR.

postdrop:


Fixes #694 #1029 #1179

Affected a vacation sieve filter in Sep 2018 and a sieve filter redirect in June 2019:

Have setup a simple sieve file:

redirect "[email protected]";
keep;

When testing I do not get the test emails. In the sieve.log for the user being emailed you get "failed to redirect message to [email protected]: Failed to execute sendmail (temporary failure)."

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md or the documentation under docs/)
  • If necessary I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

GID of postfix(102) should not be set here. only GID is root(0) and postdrop(103). Ensure root(0) UID matches source location ownership too.
@polarathene polarathene force-pushed the fix/one-dir-postfix-postdrop branch from 32ac515 to 995cbce Compare October 31, 2021 04:13
Copy link
Copy Markdown
Member

@georglauterbach georglauterbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I had this in my user-patches.sh because I thought this was K8s related. Nice 👍🏼

@georglauterbach georglauterbach added this to the v10.3.0 milestone Oct 31, 2021
@georglauterbach georglauterbach added kind/improvement Improve an existing feature, configuration file or the documentation priority/medium labels Oct 31, 2021
@georglauterbach georglauterbach requested a review from a team October 31, 2021 11:13
Copy link
Copy Markdown
Member

@wernerfred wernerfred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems logical to me

@polarathene polarathene merged commit 79617dc into docker-mailserver:master Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/improvement Improve an existing feature, configuration file or the documentation priority/medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Permission issue for postdrop group

3 participants