-
Notifications
You must be signed in to change notification settings - Fork 82
Mails not working, /etc/msmtprc: Permission denied
#318
Comments
What helped me a little:
|
How can you verify that this change actually worked? I did the modification shown in step 2 but if I rebuild the image and restart the container, I'm still unable to make the emails work. |
@tomalec OK, I figured this out. The docker image used for the If you check this file closely, you will notice that very early on this file, on line 3, the script attempts to write to the
So, apparently, the script cannot write to the Following your suggestion, I had to edit
|
I'm also trying to get MailCatcher to work with no luck. I'm using Windows 11, WP Local Docker v3.0.2 and WSL 2. Here's what I tried:
Any ideas on where to go from here? If there are error logs I should be looking at please let me know where to find them. Thanks a ton for the help. |
@jg314 if you do |
If I run |
I'm using Linux and I believe I'm facing the same or similar issue faced by @jg314. When an email is sent, I get this error in the log file: I can confirm that the docker exec CONTAINER_NAME-test_phpfpm_1 sh -c "cat /etc/msmtprc" Other than that, if I try to run the same command in entrypoint.sh to write the default account: docker exec CONTAINER_NAME-test_phpfpm_1 sh -c "cat > /etc/msmtprc <<EOF
account default
host ${MAILER_HOST:-mailcatcher}
port ${MAILER_PORT:-1025}
auto_from on
EOF" I get: if we take a look at the permissions of the
So, maybe it's necessary to change the To "fix" this issue I run the command with docker exec CONTAINER_NAME-test_phpfpm_1 sudo sh -c "cat > /etc/msmtprc <<EOF
account default
host ${MAILER_HOST:-mailcatcher}
port ${MAILER_PORT:-1025}
auto_from on
EOF" After running the command above, the content of the account default
host mailcatcher
port 1025
auto_from on |
In the .containers/php-fpm file for your project, can you add, under the last RUN line:
Then rebuild the image. Let me know if this resolves the problem for you. Thank you |
It fixed 🎉
...
RUN chown ${CALLING_USER} /run/php-fpm
RUN chown ${CALLING_USER} /var/log/php*log
RUN chown ${CALLING_USER} /etc/msmtprc
...
Thanks @dustinrue ❤️ |
@Rahmon and @dustinrue this is the
Then I had to run |
Troubleshooting
Describe the bug
Sending emails does not work. Fails with an error
PHP Mailer - Could not instantiate mail function.
.10updocker logs
shows:MailCatcher is completely empty
Steps to Reproduce
10updocker upgrade
and10updocker create
with all the defaultsScreenshots, screen recording, code snippet
Environment information
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: