Topic on Project:Support desk

Jump to navigation Jump to search

[RESOLVED] Unknown error in PHP's mail() function

Kmacdowe (talkcontribs)

MediaWiki: 1.23.5 PHP: 5.5.9-1ubuntu4.4 (apache2handler) MySQL: 5.5.40-0ubuntu0.14.04.1

I installed a new wiki. It is working fine other than it fails at sending email. For example when I ask it to send a confirmation email I get the following error:

"4MI Wiki could not send your confirmation mail. Please check your email address for invalid characters. Mailer returned: Unknown error in PHP's mail() function."

Or when I try to create a new account and have a random password sent to the user I get this error: "Account creation error Error sending mail: Unknown error in PHP's mail() function."

Florianschmidtwelzow (talkcontribs)
Kmacdowe (talkcontribs)

The solution was to remove a line from the PHP configuration file that was redundantly calling a PHP module that was already called from a different config file. Sorry I don't have the specifics at hand right now. Advice to others that have this problem: try sending mail from the CLI, if you get an error, fix that and then try sending from your wiki again. Thanks Florianschmidtwelzow for the help.

Foudfou (talkcontribs)
Jabbott (talkcontribs)

If you are running CentOS7 (or the equivalent Redhat) running SEL, you may have to turn on the ability of apache to send mail. See if this is set to allow or disallow by running the following command:
getsebool -a | grep mail
If you get the following response:
allow_postfix_local_write_mail_spool --> off
Then you will get the Unknown error. You will need to turn on this ability in the OS by the following command:
setsebool -P httpd_can_sendmail on
This should cure the error.

Kmacdowe (talkcontribs)
Reply to "[RESOLVED] Unknown error in PHP's mail() function"