Skip to content

Still getting a lot of spam from @qq.com account #43

@samuel-clara

Description

@samuel-clara

I've implemented craft-recaptcha to my form using the recaptcha/recaptcha/verify-submission action.
But I still receive dozens of spam submissions form mails using @qq.com email.
Even in the Google recaptcha admin dashboard I see no data.

I've also tried to check if the email filed contains @qq.com, but even with this check in place I'm getting spam.

Here is my js validation/submit code, any ideas how this is possible?

$("#contactForm").validate({
    errorElement: 'div',
    ignore: "",
    highlight: function(element, errorClass, validClass) {
        $(element).parent().addClass('has-error');
        $(element).addClass(errorClass);
        $(element).removeClass(validClass);
    },
    rules: {
        fromName: "required",
        fromEmail: {
            required: true,
            email: true
        },
        "message[body]": {
            required: true,
            minlength: 80
        },
        privacy: "required"
    },
    messages: {
        fromName: nameError,
        fromEmail: emailError,
        "message[body]": messageError,
        privacy: privacyError
    },
    errorPlacement: function(error, element) {
        error.appendTo("#contactForm-errorHolder");
    },
    submitHandler: function(form) {

           if ($("#fromEmail").val().includes("@qq.com")) {
                alert("Validation error, please contact us");
            }
            else {
                var allowSubmit = true;
                var response = grecaptcha.getResponse();
            
                if (!response) {
                    alert(recaptchaError); 
                }
                else if (allowSubmit) {
    
                    var formData = new FormData(form);
                    
                    formData.append("action", "recaptcha/recaptcha/verify-submission");
                    formData.append("verified-action", "contact-form/send");
    
                    $.post({
                        url: '/recaptcha/recaptcha/verify-submission',
                        data: formData,
                        type: 'POST',
                        async: false,
                        cache: false,
                        contentType: false,
                        processData: false,
                        dataType: "json",
                        beforeSend: function() {
                            allowSubmit = false;
                        },
                        success: function(response) {
                        },
                        error: function(jqXHR) {
                        }
                    });
                }       
            }
    }
});

On the form I use
{{ craft.recaptcha.render() }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions