Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1000472

    i do get now from mail.ru adresses a lot of spam.
    is there a way to filter the contact form that email send from some ip or domains are not send?

    I know on CF7 there is a little plugin for it.

    Maybe to block all from ru or cn
    ;)

    #1000536

    maybe we can do something over this check in contact.js:

    if(classes && classes.match(/is_email/))
    {
    	if(!value.match(/^[\w|\.|\-]+@\w[\w|\.|\-]*\.[a-zA-Z]{2,20}$/))
    	{
    		surroundingElement.removeClass("valid error ajax_alert").addClass("error");
    		send.validationError = true;
    	}
    	else
    	{
    		surroundingElement.removeClass("valid error ajax_alert").addClass("valid");
    	}
    	nomatch = false;
    }
    #1001347

    Hi,

    I asked Ismael to take a look at the ticket, maybe he can come up with something quick! :)

    Best regards,
    Basilis

    #1001505

    Thanks!

    #1001527

    Hi!

    You could replace it with this code:

    
    if(classes && classes.match(/is_email/))
    {
    	if(!value.match(/^[\w|\.|\-]+@\w[\w|\.|\-]*\.[a-zA-Z]{2,20}$/))
    	{
    		surroundingElement.removeClass("valid error ajax_alert").addClass("error");
    		send.validationError = true;
    	}
    	else
    	{
    		var emailReg = value.match( /@\w[\w|\.|\-|ÄÖÜäöü]*\.[a-zA-Z]{2,20}$/ );
    
    		var domain = emailReg[0].split('.');
    		var country = domain.slice(-1).pop();
    
    		var block_countries = ['cn', 'ru'];
    
    		for (var i = 0; i < block_countries.length; i += 1)
    		{
    			if (country.toLowerCase() == block_countries[i])
    			{								
    				surroundingElement.removeClass("valid error ajax_alert").addClass("error");
    				send.validationError = true;
    				break;
    			}
    			else
    			{
    				surroundingElement.removeClass("valid error ajax_alert").addClass("valid");
    			}
    		}
    	}
    	nomatch = false;
    }
    

    to block domains ending with cn or ru.

    Best regards,
    Peter

    #1001828

    thanks dude :
    and best would be for me ( i got always a lot of customised alb elements) to load this script instead – if i got a custom contact.php in my child-theme/shortcodes folder and this edited new contact.js.
    I have then edited the contact.php to

    function extra_assets()
    {
    	//load css
    	wp_enqueue_style( 'avia-module-contact' , AviaBuilder::$path['pluginUrlRoot'].'avia-shortcodes/contact/contact.css' , array('avia-layout'), false );
    		//load the new js
    	wp_enqueue_script( 'avia-module-contact' , get_stylesheet_directory_uri().'/shortcodes/contact.js' , array('avia-shortcodes'), false, TRUE );
    }

    – it works ! but:

    what is the difference between is_ext_email and is_email
    do i have to do it with this part too?
    if(classes && classes.match(/is_ext_email/))

    #1001834

    Hey!

    The is_ext_email check will only fire if you use the “Valid E-Mail address with special characters” field validation (screenshot http://www.clipular.com/c/6126134404841472.png?k=929gwJ5qXLLVAavl5nIn-ZrnKn4 ). The extended characters check would also allow special characters like öä, etc. in the e-mail address but tbh you probably won’t stumble over e-mail addresses which contain special characters because of the reference standards (see https://stackoverflow.com/questions/2049502/what-characters-are-allowed-in-an-email-address )

    Best regards,
    Peter

    #1001921

    it works – now I just hope that the spammers will not switch to other country addresses.
    and if I don’t get the mega order from China now , then it’s fate.

    #1006366

    it works – but – one e-mail has passed – and i don’t know how?

    No more e-mails from ru or cn came in now. None, except one. And I’m really surprised. There is probably still one who can crack it.

    Can be closed. thanks

    #1006449

    Hi,
    Glad Dude was able to help, we will close this now.

    Best regards,
    Mike

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘blacklist emails from contact form’ is closed to new replies.