I'm busy tidying up spam on the OOoWiki on a fairly regular basis. The OOoWiki uses several tools to block/stop spammers (BadBehavior, the spam RegEx etc.)... it's working most of the time, but the spammers still get in and vandalize pages several times per week. I've been poking around and discovered that a lot of the spammers (who create an account just to post a URL link) are using Mailinator dot com to create a one-time-use throwaway email address to receive the Wiki user authentication email.
Is there any practical way of blocking new users from using specific services like Mailinator? Is there a better way of dealing with situations like this?
C.
On Fri, Dec 3, 2010 at 4:01 PM, Clayton ccornell@openoffice.org wrote:
I'm busy tidying up spam on the OOoWiki on a fairly regular basis. The OOoWiki uses several tools to block/stop spammers (BadBehavior, the spam RegEx etc.)... it's working most of the time, but the spammers still get in and vandalize pages several times per week. I've been poking around and discovered that a lot of the spammers (who create an account just to post a URL link) are using Mailinator dot com to create a one-time-use throwaway email address to receive the Wiki user authentication email.
Is there any practical way of blocking new users from using specific services like Mailinator? Is there a better way of dealing with situations like this?
C.
The OpenID authentication service, http://www.mediawiki.org/wiki/Extension:OpenID seems to deal with these situations effectively.
On Fri, Dec 3, 2010 at 3:01 PM, Clayton ccornell@openoffice.org wrote:
I'm busy tidying up spam on the OOoWiki on a fairly regular basis. The OOoWiki uses several tools to block/stop spammers (BadBehavior, the spam RegEx etc.)... it's working most of the time, but the spammers still get in and vandalize pages several times per week. I've been poking around and discovered that a lot of the spammers (who create an account just to post a URL link) are using Mailinator dot com to create a one-time-use throwaway email address to receive the Wiki user authentication email.
Is there any practical way of blocking new users from using specific services like Mailinator? Is there a better way of dealing with situations like this?
C.
http://www.mediawiki.org/wiki/Manual:Hooks/AbortNewAccount
might work, dont know exactly what the docu means by 'incomplete'
pesudocodey:
$wgHooks['AbortNewAccount'][] = 'fnMyHook'; function fnMyHook( $user, $message ) { if( $user->getEmail() =~ /mailinator/ ) { $message = 'mailinator iz verbotten'; return false; } }
OQ wrote:
On Fri, Dec 3, 2010 at 3:01 PM, Clayton ccornell@openoffice.org wrote:
I'm busy tidying up spam on the OOoWiki on a fairly regular basis. The OOoWiki uses several tools to block/stop spammers (BadBehavior, the spam RegEx etc.)... it's working most of the time, but the spammers still get in and vandalize pages several times per week. I've been poking around and discovered that a lot of the spammers (who create an account just to post a URL link) are using Mailinator dot com to create a one-time-use throwaway email address to receive the Wiki user authentication email.
Is there any practical way of blocking new users from using specific services like Mailinator? Is there a better way of dealing with situations like this?
C.
http://www.mediawiki.org/wiki/Manual:Hooks/AbortNewAccount
might work, dont know exactly what the docu means by 'incomplete'
pesudocodey:
$wgHooks['AbortNewAccount'][] = 'fnMyHook'; function fnMyHook( $user, $message ) { if( $user->getEmail() =~ /mailinator/ ) { $message = 'mailinator iz verbotten'; return false; } }
That's a bit perlish ;) Try this instead, Clayton:
$wgHooks['AbortNewAccount'][] = 'noMailinator';
function noMailinator( $user, &$message ) { if( !preg_match( '/@(mailinator|binkmail).com$/', $user->getEmail() ) { $message = 'No mailinator emails, please'; return false; } return true; }
Another option would be the isValidEmailAddr hook.
On 12/04/2010 12:39 AM, Platonides wrote: [snip]
Is there any practical way of blocking new users from using specific services like Mailinator? Is there a better way of dealing with situations like this?
[snip]
$wgHooks['AbortNewAccount'][] = 'noMailinator';
function noMailinator( $user,&$message ) { if( !preg_match( '/@(mailinator|binkmail).com$/', $user->getEmail() ) { $message = 'No mailinator emails, please'; return false; } return true; }
Another option would be the isValidEmailAddr hook.
Sorry for the late reply. I've just had a chance to look at this again - prompted by yet another spammer using mailinator to authenticate their account.
I took a quick look at the $wgHooks docs here: http://www.mediawiki.org/wiki/Manual:Hooks and http://www.mediawiki.org/wiki/Manual:Hooks/AbortNewAccount
Seems straight forward, so I added the code (with and without the & in front of the $message variable) to my LocalSettings.php... and it didn't work so well. According to my error log it had a "PHP Parse Error: syntax error, unexpected '{'" at the end of the first line of the if statement. Funny thing is... I don't see a syntax error there though (granted I'm not a php guru... still learning, so I might be missing something).
I tried a few variations on the function code (including the suggestion from OQ) with the same results.... an unexpected '{'.
So at this point I'm a little puzzled... any suggestions on where the problem is?
C.
Clayton wrote :
On 12/04/2010 12:39 AM, Platonides wrote:
if( !preg_match( '/@(mailinator|binkmail).com$/', $user->getEmail() ) {
Seems straight forward, so I added the code (with and without the & in front of the $message variable) to my LocalSettings.php... and it didn't work so well. According to my error log it had a "PHP Parse Error: syntax error, unexpected '{'" at the end of the first line of the if statement. Funny thing is... I don't see a syntax error there though (granted I'm not a php guru... still learning, so I might be missing something).
I tried a few variations on the function code (including the suggestion from OQ) with the same results.... an unexpected '{'.
So at this point I'm a little puzzled... any suggestions on where the problem is?
a closing parenthesis ')' is missing before the '{' ?
Alexis
On 12/09/2010 06:01 PM, Alexis Moinet wrote:
Clayton wrote :
On 12/04/2010 12:39 AM, Platonides wrote:
if( !preg_match( '/@(mailinator|binkmail).com$/', $user->getEmail() ) {
Seems straight forward, so I added the code (with and without the& in front of the $message variable) to my LocalSettings.php... and it didn't work so well. According to my error log it had a "PHP Parse Error: syntax error, unexpected '{'" at the end of the first line of the if statement. Funny thing is... I don't see a syntax error there though (granted I'm not a php guru... still learning, so I might be missing something).
I tried a few variations on the function code (including the suggestion from OQ) with the same results.... an unexpected '{'.
So at this point I'm a little puzzled... any suggestions on where the problem is?
a closing parenthesis ')' is missing before the '{' ?
Ooops, so many ( ) that I lost count :-)
Fixed that, and it accepts the Hook... but it doesn't work.. I'll pick that up in the root of this thread.
C.
On 12/04/2010 12:39 AM, Platonides wrote: [snip]
Is there any practical way of blocking new users from using specific services like Mailinator? Is there a better way of dealing with situations like this?
http://www.mediawiki.org/wiki/Manual:Hooks/AbortNewAccount
might work, dont know exactly what the docu means by 'incomplete'
pesudocodey:
$wgHooks['AbortNewAccount'][] = 'fnMyHook'; function fnMyHook( $user, $message ) { if( $user->getEmail() =~ /mailinator/ ) { $message = 'mailinator iz verbotten'; return false; } }
That's a bit perlish ;) Try this instead, Clayton:
$wgHooks['AbortNewAccount'][] = 'noMailinator';
function noMailinator( $user,&$message ) { if( !preg_match( '/@(mailinator|binkmail).com$/', $user->getEmail() ) { $message = 'No mailinator emails, please'; return false; } return true; }
Another option would be the isValidEmailAddr hook.
Ok, this is the exact code I've added to the end of the LocalSettings.php file:
################### $wgHooks['AbortNewAccount'][] = 'noMailinator';
function noMailinator( $user, $message ) { if( !preg_match( '/@(mailinator|binkmail).com$/', $user->getEmail() )) { $message = 'One-time-use email services are forbidden on the OpenOffice.org Wiki'; return false; } return true; } ###################
I created a test account using mailinator as the authentication email address, and it went through and accepted the account creation. So... is there any way to trap or see what's happening at this stage? I can't see any reason the function doesn't work (now that I've got the right number of parenthesis). Given my (weak) knowledge of php, it seems to follow what's documented.
C.
On 12/09/2010 01:49:56 PM, Clayton - ccornell@openoffice.org wrote: [snip]
Is there any practical way of blocking new users from using specific services like Mailinator? Is there a better way of dealing with situations like this?
[snip]
Ok, this is the exact code I've added to the end of the LocalSettings.php file:
################### $wgHooks['AbortNewAccount'][] = 'noMailinator';
function noMailinator( $user, $message ) { if( !preg_match( '/@(mailinator|binkmail).com$/', $user->getEmail() )) { $message = 'One-time-use email services are forbidden on the OpenOffice.org Wiki'; return false; } return true; } ###################
I created a test account using mailinator as the authentication email address, and it went through and accepted the account creation. So... is there any way to trap or see what's happening at this stage? I can't see any reason the function doesn't work (now that I've got the right number of parenthesis). Given my (weak) knowledge of php, it seems to follow what's documented.
[snip] Try replacing the test with this:
if( preg_match( '/@(mailinator|binkmail).com/i', .....
preg_match() returns the number of matches, it will be zero (false) if there are none. [1]
In addition the pattern is now case insensitive and the period is meant literally. The "end of string" specification ($) seems superfluous and could cause trouble.
[1] http://www.php.net/manual/en/function.preg-match.php
Hope that helps.
Jim
On 12/09/2010 10:27 PM, Jim Laurino wrote:
On 12/09/2010 01:49:56 PM, Clayton - ccornell@openoffice.org wrote: [snip]
Is there any practical way of blocking new users from using specific services like Mailinator? Is there a better way of dealing with situations like this?
[snip]
Ok, this is the exact code I've added to the end of the LocalSettings.php file:
################### $wgHooks['AbortNewAccount'][] = 'noMailinator';
function noMailinator( $user, $message ) { if( !preg_match( '/@(mailinator|binkmail).com$/', $user->getEmail() )) { $message = 'One-time-use email services are forbidden on the OpenOffice.org Wiki'; return false; } return true; } ###################
I created a test account using mailinator as the authentication email address, and it went through and accepted the account creation. So... is there any way to trap or see what's happening at this stage? I can't see any reason the function doesn't work (now that I've got the right number of parenthesis). Given my (weak) knowledge of php, it seems to follow what's documented.
[snip] Try replacing the test with this:
if( preg_match( '/@(mailinator|binkmail).com/i', .....
preg_match() returns the number of matches, it will be zero (false) if there are none. [1]
In addition the pattern is now case insensitive and the period is meant literally. The "end of string" specification ($) seems superfluous and could cause trouble.
[1] http://www.php.net/manual/en/function.preg-match.php
Hope that helps.
I was wondering about escaping the dot... I also removed $ and added /i for case insensitive as suggested... tested creating a new account using mailinator as the authentication email and it still allows it through.
Hmmm time to do some more reading I think :-P This looks like it should work... Would it make a difference if I converted this to a custom extension instead of dropping it direct into LocalSettings? I can't see how it'd make a difference, but...
C.
On 12/09/2010 04:49:42 PM, Clayton - ccornell@openoffice.org wrote:
On 12/09/2010 10:27 PM, Jim Laurino wrote:
On 12/09/2010 01:49:56 PM, Clayton - ccornell@openoffice.org wrote: [snip]
Is there any practical way of blocking new users from using specific services like Mailinator? Is there a better way of dealing with situations like this?
[snip]
Ok, this is the exact code I've added to the end of the LocalSettings.php file:
################### $wgHooks['AbortNewAccount'][] = 'noMailinator';
function noMailinator( $user, $message ) { if( !preg_match( '/@(mailinator|binkmail).com$/', $user->getEmail() )) { $message = 'One-time-use email services are forbidden on the OpenOffice.org Wiki'; return false; } return true; } ###################
I created a test account using mailinator as the authentication email address, and it went through and accepted the account creation. So... is there any way to trap or see what's happening at this stage? I can't see any reason the function doesn't work (now that I've got the right number of parenthesis). Given my (weak) knowledge of php, it seems to follow what's documented.
[snip] Try replacing the test with this:
if( preg_match( '/@(mailinator|binkmail).com/i', .....
preg_match() returns the number of matches, it will be zero (false) if there are none. [1]
In addition the pattern is now case insensitive and the period is meant literally. The "end of string" specification ($) seems superfluous and could cause trouble.
[1] http://www.php.net/manual/en/function.preg-match.php
Hope that helps.
I was wondering about escaping the dot... I also removed $ and added /i for case insensitive as suggested... tested creating a new account using mailinator as the authentication email and it still allows it through.
[snip]
Did you also remove the NOT (!) in front of the preg_match() call? You did not say.
Have you tried it both ways? With this rule in place, can a non-mailinator account register?
Jim
Clayton wrote:
Ok, this is the exact code I've added to the end of the LocalSettings.php file:
################### $wgHooks['AbortNewAccount'][] = 'noMailinator';
function noMailinator( $user, $message ) { if( !preg_match( '/@(mailinator|binkmail).com$/', $user->getEmail() )) { $message = 'One-time-use email services are forbidden on the OpenOffice.org Wiki'; return false; } return true; } ###################
I created a test account using mailinator as the authentication email address, and it went through and accepted the account creation. So... is there any way to trap or see what's happening at this stage? I can't see any reason the function doesn't work (now that I've got the right number of parenthesis). Given my (weak) knowledge of php, it seems to follow what's documented.
The lack of ampersand before $message is likely to be blocking the hook from running (PHP 5.3 is very nitpicking on this). And yes, the original code missed a ), had a ! too much and should have escaped the . inside the regex. It's also a good idea to make it case insensitive (and legal per rfc822).
On 12/09/2010 11:45 PM, Platonides wrote:
Clayton wrote:
Ok, this is the exact code I've added to the end of the LocalSettings.php file:
################### $wgHooks['AbortNewAccount'][] = 'noMailinator';
function noMailinator( $user, $message ) { if( !preg_match( '/@(mailinator|binkmail).com$/', $user->getEmail() )) { $message = 'One-time-use email services are forbidden on the OpenOffice.org Wiki'; return false; } return true; } ###################
I created a test account using mailinator as the authentication email address, and it went through and accepted the account creation. So... is there any way to trap or see what's happening at this stage? I can't see any reason the function doesn't work (now that I've got the right number of parenthesis). Given my (weak) knowledge of php, it seems to follow what's documented.
The lack of ampersand before $message is likely to be blocking the hook from running (PHP 5.3 is very nitpicking on this). And yes, the original code missed a ), had a ! too much and should have escaped the . inside the regex. It's also a good idea to make it case insensitive (and legal per rfc822).
It was a combination of the & and !. I looked up the exclamation thinking it was a "not", but what I found seemed to indicate it was an "if exists"... so I left it in place during the initial testing.
So, now it works exactly as I want (tested creating an account with mailinator and with a regular email account)... for now just mailinator and binkmail are blocked, but I can add more to the "or" if necessary.
Thanks to everyone for walking me through this. I've learned just a bit more about php and MediaWiki :-)
C.
The quick and dirty way:
I use a specific email server (mine; running surgemail) for all wiki mail. For archival purposes I take a copy of ALL mail for the domain and stored it in a special email account, Yes I have noticed similar and its just so easy to force a redirect rather than just a copy so they never get the email to authenticate. If they are serious you will get a complaint and can investigate and watch like a hawk, personally I have never received a complaint.
GS
On 4/12/2010 8:01 AM, Clayton wrote:
I'm busy tidying up spam on the OOoWiki on a fairly regular basis. The OOoWiki uses several tools to block/stop spammers (BadBehavior, the spam RegEx etc.)... it's working most of the time, but the spammers still get in and vandalize pages several times per week. I've been poking around and discovered that a lot of the spammers (who create an account just to post a URL link) are using Mailinator dot com to create a one-time-use throwaway email address to receive the Wiki user authentication email.
Is there any practical way of blocking new users from using specific services like Mailinator? Is there a better way of dealing with situations like this?
C.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Gary Stern wrote:
The quick and dirty way:
I use a specific email server (mine; running surgemail) for all wiki mail. For archival purposes I take a copy of ALL mail for the domain and stored it in a special email account, Yes I have noticed similar and its just so easy to force a redirect rather than just a copy so they never get the email to authenticate. If they are serious you will get a complaint and can investigate and watch like a hawk, personally I have never received a complaint.
GS
Or they may just assume your mail server is broken.
mediawiki-l@lists.wikimedia.org