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

Password reset emails not being set #16

Open
domenic opened this issue Mar 9, 2022 · 3 comments
Open

Password reset emails not being set #16

domenic opened this issue Mar 9, 2022 · 3 comments

Comments

@domenic
Copy link
Member

domenic commented Mar 9, 2022

It seems the default PHP docker container cannot send mail.

Some helpful-looking pages:

@domenic
Copy link
Member Author

domenic commented May 1, 2022

I almost got something similar working on wiki.whatwg.org using this recipe: whatwg/wiki.whatwg.org@28725a6

It worked when trying locally but failed when trying live due to what some Googling said was a permissions error. The next step would be trying to fix the permissions in various ways such as https://unix.stackexchange.com/a/605314/190444 .

However instead I went with a different approach of having Mediawiki use our SMTP server directly instead of using ssmtp, in whatwg/wiki.whatwg.org@c6c3f93.

So for the blog we have two paths:

To be continued, probably...

@domenic
Copy link
Member Author

domenic commented May 1, 2022

Step 3 of https://www.e-tinkers.com/2020/09/simple-steps-to-setup-wordpress-smtp-email-without-a-plugin/ is promising as an even easier path. It implies that we need to do steps 1 and 2 also but I am skeptical; maybe some version of step 3 alone would suffice.

@domenic
Copy link
Member Author

domenic commented Sep 2, 2023

I seem to have a local branch with the following changes: an entrypoint.sh with

#!/bin/bash
set -euo pipefail

cat >> /etc/ssmtp/ssmtp.conf <<-EOCFG
# Fastmail setup
mailhub=smtp.fastmail.com:465
AuthUser=${FASTMAIL_USERNAME}
AuthPass=${FASTMAIL_PASSWORD}
AUthMetod=PLAIN
UseTLS=YES
UseSTARTTLS=NO
FromLineOverride=YES
EOCFG

docker-php-entrypoint apache2-foreground

and the following diff:

diff --git a/Dockerfile b/Dockerfile
index ff70209..cb4bf26 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,2 +1,10 @@
 FROM wordpress:5.9.2-php8.1-apache
+
+# Enable sending mail (see also some config in entrypoint.sh)
+RUN apt-get update && apt-get install -y ssmtp && apt-get clean && \
+    echo 'sendmail_path = "/usr/sbin/ssmtp -t -i"' > /usr/local/etc/php/conf.d/mail.ini
+
 COPY org.whatwg.awesome /var/www/html/wp-content/themes/org.whatwg.awesome/
+
+ENTRYPOINT ["/bin/bash"]
+CMD ["/entrypoint.sh"]

I have no recollection of whether these were working or when I was working on this, but it's probably better to dump them here than to just blow away my local branch forever.

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

No branches or pull requests

1 participant