Topic on Project:Support desk

[RESOLVED] MediaWiki not sending email

16
Mvanhorn (talkcontribs)

At some point in the past, this was working, but our wiki is now not sending email to the WikiSysop when someone makes a change to the wiki.

We have both $wgEnableEmail and $wgEnableUserEmail set to "true", and the EmailNotification variables are:

$wgEnotifUserTalk = true; # UPO $wgEnotifWatchlist = true; # UPO $wgEmailAuthentication = true; $wgUsersNotifiedOnAllChanges = array('WikiSysop');

As I say, at one point we know this was working, but it has stopped and I can't figure out why. The wiki is configured to use the php mail functionality (not a direct SMTP connection), which is working for other applications on our server.

I know that the version of the wiki software is somewhat old, but I haven't seen anything in the release note of subsequent versions that says a fix for anything that seems to be conencted to this issue was implemented. There doesn't seem to be a way to get the MediaWiki software to log what it is doing, to be able to check where in the process something is failing.

MediaWiki: 1.11.0 PHP: 5.4.11 (apache2handler) MySQL: 5.1.58

Any help is appreciated, thanks!

Ciencia Al Poder (talkcontribs)

If the PHP or wiki configuration hasn't changed, then it may be a firewall refusing connections between the server running MediaWiki and the mail server, or the mail server is refusing emails received from the email address configured in your server or from your server's IP address.

Mvanhorn (talkcontribs)

It's not that firewall is blocking connections, because, as noted, sending mail via php (and via other means) from the server works.

Ciencia Al Poder (talkcontribs)

Uh... I just noticed that you're using PHP 5.4.11, which was released on 24-jan-2013, so you upgraded PHP to a new version recently, which probably caused the issue.

Since MediaWiki 1.11 wasn't tested with that version of PHP (which didn't exist at the time it was released), it may be some compatibility issue with mail functions.

Having upgraded PHP, I'd recommend upgrading MediaWiki as well.

Bawolff (talkcontribs)

Do normal emails work? (Special:emailuser type emails)? It may be useful to enable MW debug logging (See How to debug) to see if it says anything about emails.

As an aside, there is a bug on latest MediaWiki with php 5.4 when $wgTimezone isn't set in LocalSettings.php (you get weird warnings). The easy work around is to set the timezone explicitly. (Just a heads up for if you decide to upgrade MediaWiki)

Ciencia Al Poder (talkcontribs)
Mvanhorn (talkcontribs)

Special:emailuser gives me a message which says

No target You have not specified a target page or user to perform this function on. [sic]

So, I can't test it that way.

I have already fixed the timezone issue; that was a PHP thing, not a MW thing.

I will try using the debug log; that may help. Thanks!

Bawolff (talkcontribs)

Sorry, I meant special:emailuser/<username of someone with email set up>

Mvanhorn (talkcontribs)

Okay, gotcha. Yes, that works. So, sending email via PHP (known to work) does work for MW. However, the automated email-when-someone-updates-the-wiki is not.

Bawolff (talkcontribs)

Hmm. Did you try special:emailuser for WikiSysop just to check for things like does wikisysop have correct email set.

My next guess is maybe the amount of email sent to that user started to trigger spam filters or something like that.

Your server may have logs about outgoing email. If so it might be worth to check them to see if the emails make it to that point or if mw is not generating them at all.

Mvanhorn (talkcontribs)

No, upgrading PHP didn't cause the problem; it was occurring before upgrading to 5.4.11. Previously, we had 5.3.10, and it was not working then, either.

Mvanhorn (talkcontribs)

Well, I tuned on debugging via $wgDebugLogFile and am not any closer to figuring this out. If I send a user an email directly, it generates a line in the log that says "Sending mail via internal mail() function". However, this is not occurring when a page changes happens, which is supposed to generate a message to the WikiSysop's email address.

Also, I did a recursive find, and the only reference that I can find to $wgUsersNotifiedOnAllChanges is in the LocalSettings.php file; wouldn't it need to be found in the MW code somewhere else for this to work?

Bawolff (talkcontribs)
Mvanhorn (talkcontribs)

That was it! I changed the variable name to $wgUsersNotifedOnAllChanges in our LocalSettings.php file, and now things are working!

At some point, I must have up-graded the wiki to a version where that variable name was misspelled, and that was when it broke.

Thank you!

Sowmya.yarradoddi (talkcontribs)

hi, am new to mediawiki. I have it installed. What all do I have to do for the email to work?

88.130.64.41 (talkcontribs)

Puhh, depends on your system: Make sure that mails can be sent at all, set up MediaWiki so that sending emails is enabled. The latter can be done during installation.