I'm afraid this is broken for the newest version of MediaWiki; I looked at trying to fix it but am not all that well versed in php. Seems that the wfMessage needs to be put in, but also I can't get $user->getEmail() to produce results.
Topic on Extension talk:EmailDomainCheck
Hm, it looks like a PreAuthenticationProvider needs to be implemented - https://www.mediawiki.org/wiki/Manual:Hooks/AbortNewAccountManual:Hooks/AbortNewAccount
I've created a small extension that works in newer versions: https://github.com/Insolitu/RestrictEmailDomain
It's broken for me too. However, I've tried Sdeaki's extension and it works pretty good although, I do get:
Warning: Cannot modify header information - headers already sent by (output started at \mediawiki\extensions\RestrictEmailDomain\RestrictEmailDomain_body.php:15) in \mediawiki\includes\WebResponse.php on lineĀ 42
Sdeaki - fantastic, and thank you!
Extension:EmailDomainCheck works on MediaWiki 1.29. I put in a fix in the error path (when a user attempts to create an account with an unsupported domain) by replacing wfMsgHtml() with wfMessage()