Help:Block email

From Apache OpenOffice Wiki
Jump to: navigation, search

To help combat Spam registrations, one-time-use or throw-away email services are blocked. If a user attempts to register a new account using one of these email services, they receive an error stating that these mail services are forbidden on the OpenOffice.org Wiki.

This is implemented as a $wgHooks and function call directly in LocalSettings.php. It can be expanded (if new email services need to be blocked) by adding the service names in the function.

The code in use is:

#############################################
# Hook to block one-time-use email services #
#############################################
$wgHooks['AbortNewAccount'][] = 'noMailinator';
 
function noMailinator( $user, &$message ) {
   if( preg_match( '/@(mailinator|binkmail)\.com/i', $user->getEmail() )) {
     $message =  'One-time-use email services are forbidden on the OpenOffice.org Wiki';
     return false;
   }
   return true;
}
Personal tools