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

php sendmail not included in docker image? #353

Open
ross-spencer opened this issue Aug 4, 2022 · 0 comments
Open

php sendmail not included in docker image? #353

ross-spencer opened this issue Aug 4, 2022 · 0 comments

Comments

@ross-spencer
Copy link

I am seeing the following error:

image

  • Unknown error in PHP's mail() function.

Which is similar to this: https://phabricator.wikimedia.org/T206517

To recreate this I download the current main branch here, I then replace the most basic of settings in template.env for .env:

diff --git a/example/.env b/example/.env
index 55f9e14..6d87976 100644
--- a/example/.env
+++ b/example/.env
@@ -17,25 +17,25 @@ MYSQL_IMAGE_NAME=mariadb:10.3
 ## Your password must be different from your username.
 ## Your password must not appear within your username.
 ## The password must not be in a list of very commonly used passwords. Please choose a unique password.
-MW_ADMIN_PASS=change-this-password
+MW_ADMIN_PASS=passw0rd12345
 MW_ADMIN_NAME=admin
 [email protected]
 MW_SECRET_KEY=some-secret-key
 MW_WG_ENABLE_UPLOADS=false
 
 ## Jobrunner Configuration
-MAX_JOBS=1
+MAX_JOBS=2
 
 ## Database Configuration
 DB_NAME=my_wiki
 DB_USER=sqluser
-DB_PASS=change-this-sqlpassword
+DB_PASS=passw0rd12345
 
 ## Wikibase Configuration
 WIKIBASE_PINGBACK=false
 # wikibase.svc is the internal docker hostname, change this value to the public hostname
 WIKIBASE_HOST=wikibase.svc
-WIKIBASE_PORT=80
+WIKIBASE_PORT=8882
 
 ## WDQS-frontend Configuration
 # wdqs-frontend.svc is the internal docker hostname, change this value to the public hostname

And run docker-compose up without configuring anything else.

If I try adding an email for a user and sending a confirmation email the error above happens.

Entering the container: sudo docker-compose exec --user=root wikibase bash

We see the following running php in interactive mode:

php > mail("[email protected]", "1", "2");
sh: 1: /usr/sbin/sendmail: not found

And in /usr/sbin/:

root@4a11c0f57991:/var/www/html# ls /usr/sbin/
a2disconf  addgroup	   chpasswd		dpkg-reconfigure  groupdel     invoke-rc.d	    policy-rc.d   rtcwake		  update-rc.d
a2dismod   adduser	   chroot		e2freefrag	  groupmems    ldattach		    pwck	  service		  useradd
a2dissite  apache2	   cpgr			e4crypt		  groupmod     mklost+found	    pwconv	  split-logfile		  userdel
a2enconf   apache2ctl	   cppw			e4defrag	  grpck        newusers		    pwunconv	  tarcat		  usermod
a2enmod    apachectl	   delgroup		faillock	  grpconv      nologin		    readprofile   tzconfig		  vigr
a2ensite   check_forensic  deluser		fdformat	  grpunconv    pam-auth-update	    remove-shell  update-ca-certificates  vipw
a2query    chgpasswd	   dpkg-fsys-usrunmess	filefrag	  httxt2dbm    pam_getenv	    rmt		  update-mime		  zic
add-shell  chmem	   dpkg-preconfigure	groupadd	  iconvconfig  pam_timestamp_check  rmt-tar	  update-passwd

If we follow some of the information in Phabricator, we see PEAR installed:

image

Providing this is diagnosed correctly, then it looks like sendmail isn't bundled with PHP in the given image.

The impact is on:

  • Creating new users with a temporary password.
  • Validating user passwords, and therefore OAuth.
  • Other functions I'm not thinking about yet, e.g. monitoring pages? etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants