Textpattern CMS support forum

You are not logged in. Register | Login | Help

#211 2017-06-23 16:14:10

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,069
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

And here’s another question

Is there a way to have one contact form which could be embedded in various domains (php pages) using the rah_external plugin?

ie using

<?php
echo file_get_contents('http://www.my_txp_install.txp/?rah_external_output=my_contact_form');
?>

> Edit: I did not manage to send an email using the above yet!

😕

Last edited by colak (2017-06-23 16:31:39)


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#212 2017-06-23 17:18:44

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,169

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Ah, setting up a plugin is beyond my scope. The more I have to thank you for it!

We’re coming closer: the script is inserted, but twice. Still no new class in the body tag, though. I’m scratching my head.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#213 2017-06-26 05:48:25

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,069
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

This is possibly a new question. In the past few months we have been receiving 2-3 spam emails/week/zcr form I have installed in our sites.

The emails come from various IP addresses so I can not block those. What they all have in common is the sender’s email address whose pattern is: fundingteam+mydomain.tld@businessloansfunded.com.

Is there a way to block them on the plugin/server side?


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#214 2017-06-26 09:10:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,566
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

The plugin can’t block it natively, but you can easily throw together a plugin module for it. Here’s a simple example plugin:

register_callback('zcr_verify', 'zemcontact.submit');

function zcr_verify()
{
    $emailField = trim(ps('Email'));
    $banPatterns = explode("\n", fetch_form('zcr_spam_patterns'));

    $evaluation = &get_zemcontact_evaluator();

    // If the email address matches one of the given patterns, fail.
    foreach ($banPatterns as $pattern) {
        $pat = trim($pattern);

        if ($pat && preg_match($pat, $emailField)) {
            $evaluation -> add_zemcontact_status(1);
        }
    }

    return;
}

It uses a specially-named form called zcr_spam_patterns to hold a list (one per line) of regular expressions that will be matched against the email field. Just add lines like this:

/fundingteam.*?@businessloansfunded.com/
/spammer.*?@example.org/
...

remembering to delimit each line with ‘/’ (unless you’re using that character in your expression itself, then you’d use a different character for the delimiter) and you’re away.

Hope that helps.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#215 2017-06-26 12:32:38

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,069
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Hi Stef… Thanks so much for your advice. is this how it is done?

# Name: zcr_prevent_spam v0.1 (compressed)
# Type: Public plugin
# Use patterns to prevent spam
# Author: Stef Dawson
# URL: http://stefdawson.com/
# Recommended load order: 5

# .....................................................................
# This is a plugin for Textpattern CMS - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# .....................................................................

H4sIAAAAAAAAA11SwYrbMBC9B/IPg1hiB9LEzjrbRCE9tYXeCqW3gpHlUSxqW0aS0+4u+fdK
sp3NVifz5s3Me8/DaJrSV0MzSlrWIDkamj5R8sJ13mm8YGtz07HG4w5mva2UDqSUkh8WBXxm
f4xqA5RMhLzX0iPbLSWVtR3dbIzjloG65qrZ+OpHSi6ojRy6HylJ1uk0ukTDtezsWNzuKflp
EDpmLerWgFUwyoNJnnPAVRkc7LYHSjSepduqc87qumD8dxx5V26lFM/RCqIXbLhqLeN2bfqi
kTZaHuez+Uz0LfeL4Y0eL+ez1/kM3HvAhsn6q8S6hBNYLZu4M3H0xaPR0k8IrIK13yexJ8C/
Xe20xeRXS1Yg0PIqF0o3gyTvIJ+sDTOmXRdW9yyIOcHijDZ/E52PRaXjt47NBr4JsBVCkAms
LDUaAw1zK9GAahHUQDhLF98tUafK8dfDFCcNGa8gfmeDGXgY6UsY0wgqHThFcSPcFPknBYQK
LBb+t53zICdAq/tAl+/m/p/Ah0/ezn0CxjLbmzidUvfvOnxep/0aba9bR7iOR2Kfu+HM3cGF
Y6FE6RL1iO1GTNTsbO55rrXCuiPHgibDvTZlID+6K0/EPi2KhO8FHnbZU3FIDhnjuyIRuMUs
y8jx+g/udwWUagMAAA==

Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#216 2017-06-26 13:11:19

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,566
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

colak wrote #306083:

is this how it is done?

If the plugin works, yes! Does it do what you want?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#217 2017-06-26 13:21:49

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,069
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

What I did is that I created a form called zcr_spam_patterns and just added one line containing *?@businessloansfunded.com/

I have sent my self an email using their credentials. I am yet to receive it. No errors were shown after clicking on the send button.

> Edit. I did receive it. It took about one hour but it did arrive! I’ll now try the full address in the form

Last edited by colak (2017-06-26 13:24:32)


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#218 2017-06-26 13:47:59

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,069
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

The second email arrived too…. It does not seem to work 😔


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#219 2017-06-26 14:09:58

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,566
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

colak wrote #306088:

*?@businessloansfunded.com/

You need the leading forward slash and a dot-star for “any character”. The question mark means “not greedy”:

/.*@businessloansfunded.com/

The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#220 2017-06-26 14:29:51

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,069
Website

Re: zem_contact_reborn v4.5.0.0: contact mail form processing

Hi Stef,

Thanks so much for your attention. I tried both

/*?@businessloansfunded.com/ 

and

/fundingteam+mydomain.tld.*?@businessloansfunded.com/

but the emails are still arriving!


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

Board footer

Powered by FluxBB