Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make email files readable on non Mac platforms #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wfaler
Copy link

@wfaler wfaler commented Jul 1, 2021

Firstly, thank you for this repo, great for testing email!

I ran into an issue on Linux, whereby I was not able to read files that were written in a bind volume from the container.
This is because by default, 0600 privileges are given to the files, as in owner RW. However, on Linux, Docker is often run as root, but users are not.
This fixes it by changing the privileges on the file.

I assume this might have gone unnoticed, since it works fine on a Mac (I tried both platforms, works on Mac, works on Linux after this change).

@flaviovs
Copy link
Owner

flaviovs commented Jul 2, 2021

Hi, thank you for your interest in the package.

I found the issue strange because I do use Linux, and never faced any file permission issue with the package. Have you checked that you own the directory being mounted inside the container? From the README:

When run as root, the daemon will drop privileges, and assume the same identify of the owner/group of current directory or (the one specified in MOCK_SMTP_PATH), after the SMTP socket is open.

@wfaler
Copy link
Author

wfaler commented Jul 5, 2021

Yes I own the directory, even created it by hand as my user before running. I can read the directory, but files that get written end up with rw only for root (owner of docker daemon process).

@flaviovs
Copy link
Owner

flaviovs commented Jul 7, 2021

Can you do some tests to help debug this issue?

  1. Start the container
  2. Check processes owners -- i.e. docker exec <container> ps -ax
  3. Check bound volume permissions: docker exec <container> ls -ld /var/lib/mock-smtp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants