• Resolved sgb02

    (@sgb02)


    I just configured a Contact form to use Akismet by entering the akismet:author, akismet:author_email tags.

    Next I performed a test by entering viagra-test-123 in the name field, which caused the form mail to not be sent and the error message was highlighted by an orange box. This was as expected.

    But when I entered viagra-test-123 in the message field [your-message] Akismet did not identify the message as spam and it was sent normally. This was not as expected.

    Does Akismet check other fields such as [your-message] field for spam? If not, is there a way to provide a tag (similar to the above akismet-author tag) to enable Akismet to check other fields e.g. your-message?

Viewing 15 replies - 1 through 15 (of 19 total)
  • Akismet developer here. If the message field is set to akismet-guaranteed-spam, it should get caught as spam 100% of the time.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    @cfinke Thanks. My understanding is that the “viagra-test-123” testing works only in the comment author name field, so Akismet doesn’t always mark a submission as spam even if “viagra-test-123” is in other fields like a message field, is this correct?

    @sgb02 If you set at least one akismet:* option in any fields in your form, Contact Form 7 sends information collected from all the fields in the form to Akismet, so Akismet should check the your-message field actually.

    @takayukister That’s correct. I believe that Contact Form 7 does send the message field as the comment_content parameter, but viagra-test-123 only works for the comment author field.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Thanks!

    Thread Starter sgb02

    (@sgb02)

    I just finished conducting a test using the suggestion to add the tag akismet-guaranteed-spam to the your-message field. I also have the akismet:author and akismet:author_email tags applied to the your-name and your-email fields.

    Next I typed viagra-test-123 in every field that accepted text:
    your-name = viagra-test-123
    your-email = [email protected]
    your-subject = viagra-test-123
    your-message = viagra-test-123

    After clicking submit, I received the orange box indicating “THERE WAS AN ERROR TRYING TO SEND YOUR MESSAGE…”, as expected.

    After removing the value from viagra-test-123 from your-name and substituting a valid value, I submitted the form with the rest of the values as shown above. The result was I received the green box indicating that the message was successfully sent. This was not as expected – 3 other fields contained the viagra-test-123 value, so I was hoping all (or at least 1) fields would be flagged.

    Obviously this is not what we want. If Akismet is only checking the your-name field, this is far from a useful solution. I would appreciate any guidance on how to properly setup the contact forms to check all fields for spam.

    Thread Starter sgb02

    (@sgb02)

    Followup on testing:
    For the above test case, although I received the green box with the message “THANK YOU FOR YOUR MESSAGE. IT HAS BEEN SENT”, and the message is recorded in Flamingo, I never actually received the email containing the message. So I did some more testing. Below are the results after several more test cases:

    If your-name contains viagra-test-123: Contact 7 shows orange box, WAS AN ERROR.
    If your-email contains viagra-test-123: C7 green box, email msg received.
    If your-subject contains viagra-test-123: C7 green box, No email, msg in Flamingo
    If your-message contains viagra-test-123: C7 green box, email received
    If your-message contains viagra: C7 green box, email received

    So, hopefully you two can figure out how to stop spam regardless of which field it appears in, however of all these, your-subject, and your-message seem most important.

    viagra-test-123 in any field except for your-name won’t trigger Akismet. If you want to trigger Akismet via the your-message field, do your-message = akismet-guaranteed-spam.

    Thread Starter sgb02

    (@sgb02)

    Hi Chris,

    I’m not exactly sure what you mean by “do your-message = akismet-guaranteed-spam”. According to the C7 site, I use: [text* your-name akismet:author] to cause Akisimet to check the name field.

    So for the tests mentioned in the last post, I tried several alternatives, but none of the below worked:
    [textarea* your-message akismet:akismet-guaranteed-spam]
    [textarea* your-message akismet:guaranteed-spam]
    [textarea* your-message akismet-guaranteed-spam]

    Can you provide the exact syntax you believe will work?

    My initial response above was intended to give you a way to confirm that Akismet is checking the other fields. You don’t need to put a tag in your-message field code. It should just look like this:

    [textarea* your-message]

    Contact Form 7 will send the contents of all fields to Akismet. If you want to confirm this, make a form with just an author field (tagged with akismet:author) and a message field, and when you are filling out the form, use a normal name like “John Smith” and put “akismet-guaranteed-spam” in the message text box. This comment should be caught as spam.

    Thread Starter sgb02

    (@sgb02)

    Chris,

    Thanks for the quick feedback.

    I just tried it, set [textarea* your-message] but didn’t work.
    C7 green box, sent the message, and email was received…

    From: test user01 <[email protected]>
    Subject: test 17
    Category: Other
    Message Body:
    akismet-guaranteed-spam

    ??
    no joy …

    It appears that Contact Form 7 doesn’t construct the request in the same way that I thought it did. In order to ensure that Akismet receives all of the data, it sends a combination of all fields in the comment_content parameter.

    @takayukister If a field is already tagged with one of the akismet:[...] tags, can it not be included in the comment_content parameter?

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    So, the comment_author, comment_author_email, and comment_author_url values should be excluded from the comment_content value, right? Yes, it’s possible. I’ll fix it in the next release.

    That’s correct, thanks.

    Another weird datum:
    I have a form with 4 fields. Just the name and email are required. I enter viagra-test-123 as the name and my email in the email field. I press SUBMIT. I get the GREEN response box, but the email does NOT arrive. Not a huge problem, but the behavior is unexpected!


    <label for=”your-name”> Your Name (required) </label>
    [text* your-name id:your-name akismet:author]

    <label for=”your-email”> Your Email (required) </label>
    [email* your-email id:your-email akismet:author_email]

    <label for=”your-subject”> Subject </label>
    [text your-subject id:your-subject]

    <label for=”your-message”> Your Message </label>
    [textarea your-message id:your-message]

    [submit class:submit-button id:submit “Send”]

    Just jumping in to put my opnion that the message field should definitely be an option that is passed to Akismet. Currently it’s only possible to pass url/name/email. The message text is where so much of the spam is, spammers will use “real” details for the rest!

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Does Akismet check the your-message field for spam?’ is closed to new replies.