Page MenuHomePhabricator

New Sign Up cannot send Confirmation Email on Local Instance of MW-Vagrant.
Closed, ResolvedPublic

When i create a new account and successfully logs in i get:
Mailer returned: Unknown error in PHP's mail() function.
This is most likely to happen due to absence of mail server i guess ?
If YES, will not be it great if you enable support of mail server with MW Vagrant itself.
If NO, what is the cause of this error?

Event Timeline

Kabhi2104 raised the priority of this task from to Medium.
Kabhi2104 updated the task description. (Show Details)
Kabhi2104 added a subscriber: Kabhi2104.

This can happen if the required pear mailer packages are not installed automatically too. Can you please verify these requirements are satisfied ?$wgSMTP#Error_sending_mail:_Unknown_error_in_PHP.27s_mail.28.29_function_Mediawiki

Hmm. I didn't have pear mailer packages installed. However after installation i got this issue Apart this shows i have those packages installed.

Did you restart the webserver process (or even machine) between installing the packages and getting that error?

(For future reference: If possible, please paste text as text instead of images, so search engines could index it.)

yeah i did start my web server as well as my VM.
[5793ebef] /w/index.php?title=Special:UserLogin&action=submitlogin&type=signup&returnto=Main+Page MWException from line 268 of /vagrant/mediawiki/includes/mail/UserMailer.php: PEAR mail package is not installed


#0 /vagrant/mediawiki/includes/User.php(4035): UserMailer::send(array, MailAddress, string, string, NULL)
#1 /vagrant/mediawiki/includes/User.php(4011): User->sendMail(string, string)
#2 /vagrant/mediawiki/includes/specials/SpecialUserlogin.php(409): User->sendConfirmationMail()
#3 /vagrant/mediawiki/includes/specials/SpecialUserlogin.php(314): LoginForm->addNewAccount()
#4 /vagrant/mediawiki/includes/specialpage/SpecialPage.php(383): LoginForm->execute(NULL)
#5 /vagrant/mediawiki/includes/specialpage/SpecialPageFactory.php(581): SpecialPage->run(NULL)
#6 /vagrant/mediawiki/includes/MediaWiki.php(270): SpecialPageFactory::executePath(Title, RequestContext)
#7 /vagrant/mediawiki/includes/MediaWiki.php(556): MediaWiki->performRequest()
#8 /vagrant/mediawiki/includes/MediaWiki.php(420): MediaWiki->main()
#9 /vagrant/mediawiki/index.php(46): MediaWiki->run()
#10 /var/www/w/index.php(5): include(string)
#11 {main}

You need to have PEAR installed in your vagrant machine - so that should be run after you ssh into the box. Maybe a role like 'echo' should install it automatically though.

Looks like we are missing the Debian php-pear packages that we install to provision that in production. Easy patch.

gerritbot added a subscriber: gerritbot.

Change 186943 had a related patch set uploaded (by BryanDavis):
Provision PEAR/Mail


Change 186943 merged by jenkins-bot:
Provision PEAR/Mail

bd808 claimed this task.

<JacksonIsaac> Hi, I am trying to confirm email and I am getting this output "Class undefined: Net_SMTP" now. Do I need to set some SMTP variable somewhere?

Mail_smtp from the PEAR/Mail package says "Requires the Net_SMTP class". Apparently we are missing another deb that provides that. I bet it is a recommended package for php-mail that we don't pick up automatically in MediaWiki-Vagrant because we have configured Apt to ignore recommended packages by default.

$ apt-cache info php-mail
E: Invalid operation info
vagrant$ apt-cache show php-mail
Package: php-mail
Priority: optional
Section: universe/web
Installed-Size: 143
Maintainer: Ubuntu Developers <>
Original-Maintainer: Debian PHP PEAR Maintainers <>
Architecture: all
Version: 1.2.0-6
Depends: php5-common (>= 4.4.9), php-pear (>= 1.5.6)
Recommends: php-net-smtp (>= 1.4.1)
Filename: pool/universe/p/php-mail/php-mail_1.2.0-6_all.deb
Size: 23316
MD5sum: 66dc2c4eec164d88437ae3d4492568cb
SHA1: 3806838055f43eb9ce256d62bb9cdbadbf1dcfa6
SHA256: 04b01473ea0d69b6d76c39b1e0a6da06c14f00695d333e03c10954db9a023e86
Description-en: Class that provides multiple interfaces for sending emails
 PEAR's Mail package defines an interface for implementing mailers under the
 PEAR hierarchy.  It also provides supporting functions useful to multiple
 mailer backends.  Currently supported backends include: PHP's native mail()
 function, sendmail, and SMTP.  This package also provides a RFC822 email
 address list validation utility class.
Description-md5: fcc8db151e2dc689da89286980759ed6
Origin: Ubuntu

Change 189104 had a related patch set uploaded (by Jacksonisaac):
Add php-net-smtp and php-auth-sasl packages in vagrant


Change 189104 merged by jenkins-bot:
Add php-net-smtp and php-auth-sasl packages in vagrant

bd808 reassigned this task from bd808 to jacksonisaac.

Change 214308 had a related patch set uploaded (by Mattflaschen):
Basic local email support using postfix

Change 214308 merged by jenkins-bot:
Use the postfix module for MediaWiki, plus mailutils