Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-08-12 05:59:52

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Spam blacklists to load on previewing a comment

because of the current problems in txd and experiencing long runtimes in my sites, I think that it would be good if the connection to the spamlists happened during the previewing of the comments and not whilst the comments enabled page is loading.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2007-08-12 18:03:25

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: Spam blacklists to load on previewing a comment

I think part of the problem is that any page that has the comments_form will test the user against the blacklists. This will also happen when previewing/saving a comment. I created a patch to 4.0.5 that will cache the results for 1 day. This should significantly reduce traffic from TxD to spamhaus.

Patch found here

Username “anonymous”, if it prompts.

To get the blacklist cache table to create itself, you’ll probably need to modify /textpattern/index.php and set the $txp_using_svn value to true. It’s at the top of the file.

Find:
$txp_using_svn = false; // set false for releases

Replace with:
$txp_using_svn = true; // set false for releases

Last edited by Manfre (2007-08-12 18:09:50)

Offline

#3 2007-08-12 18:28:11

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Spam blacklists to load on previewing a comment

IMHO, Caching the queries in TXP is not the solution, for 3 reasons:
  • the spamhaus DNS isn’t queried directly, that is done using your webserver’s local DNS resolver which will cache the DNS response
  • you want up-to-date blacklist info. Spamhaus uses a 30 minute TTL for its DNS records, so you get fresh info every 30 minutes. Using a 1 day cache makes the detection less accurate.
  • there’s still the problem of the first DNS query that takes a long time in Yiannis situation. Fix the problem, not the symptom.

Personally, I don’t think using blacklists aimed at preventing email spam is very useful in fighting comment spam, so making that blacklist entry empty probably doesn’t give you a lot of extra comment spam.

Last edited by ruud (2007-08-12 18:47:09)

Offline

#4 2007-08-12 19:26:58

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: Spam blacklists to load on previewing a comment

  • the spamhaus DNS isn’t queried directly, that is done using your webserver’s local DNS resolver which will cache the DNS response

Normally I would agree with this point, but my results have shown that all requests to the local DNS resolver on textdrive is consistently slow. I have no issues on my local test systems or other hosts.

  • you want up-to-date blacklist info. Spamhaus uses a 30 minute TTL for its DNS records, so you get fresh info every 30 minutes. Using a 1 day cache makes the detection less accurate.

This is an argument about the cache life, not whether something should be cached. Changing the value to 30 minutes instead of 1 day would increase accuracy.

  • there’s still the problem of the first DNS query that takes a long time in Yiannis situation. Fix the problem, not the symptom.

If you have a cold, would you take medicine to keep your nose from running? Of course you would because sometimes the only thing with in your control is removing the symptoms until the problem is fixed. The underlying problem is that DNS lookups are slow. Caching the information reduces the load on the DNS resolver, which if enough sites implement should reduce the initial lag.

Personally, I don’t think using blacklists aimed at preventing email spam is very useful in fighting comment spam, so making that blacklist entry empty probably doesn’t give you a lot of extra comment spam.

I agree, but the underlying problem would still exist if TXP was using a list devoted to comment spammers.

Offline

#5 2007-08-12 20:14:31

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Spam blacklists to load on previewing a comment

There is medicine against running noses? Didn’t know that. I just wipe my nose, but if it were possible to prevent a running nose (assuming it doesn’t have any other nasty side-effects) I’d go for that ;)

DNS servers are designed to cache DNS query results. Duplicating that behaviour in TXP can’t be more efficient than a properly set up DNS on a webhost. According to the opening post, TxD acknowledges that there is a problem, so I assume they’ll fix it. Until that happens, disabling the blacklists in TXP (as they suggest) is a good workaround.

Offline

#6 2007-08-13 07:42:29

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: Spam blacklists to load on previewing a comment

The discussion is interesting but it kind of misses the point by a nose:)

I assume that the blacklists are there for comment spam and not for spam referrers.

I think that blacklists can be very useful, but, having said that, if somebody is guilty of spamming, it does not mean that they are not visiting someone’s site for legit purposes. There is no reason why a guilty ip should not be able to read through sites, unless of course we follow the ‘crime and banishment’ rule.

By enabling the ‘spamlist check’ only if the person is trying to preview a comment would probably speed a lot of the pages and the general performance of the sites.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#7 2007-08-13 08:09:44

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Spam blacklists to load on previewing a comment

Spammers can still read your website + comments, but instead of a comment form they see a line informing them that their IPnr has been blacklisted. For spambots it doesn’t matter where the blacklist check is done, but for normal visitors who happen to have an IPnr that is blacklisted, they don’t have to waste time entering and previewing a comment only to find out upon submit that their IPnr is blacklisted.

Offline

#8 2007-08-13 09:20:54

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: Spam blacklists to load on previewing a comment

ruud wrote:

Spammers can still read your website + comments, but instead of a comment form they see a line informing them that their IPnr has been blacklisted. For spambots it doesn’t matter where the blacklist check is done, but for normal visitors who happen to have an IPnr that is blacklisted, they don’t have to waste time entering and previewing a comment only to find out upon submit that their IPnr is blacklisted.

hi Ruud, maybe I should get my ip blacklisted so as to check what the spammers see:)

The methods sounds good but the price we pay is that of performance… (especially when the dns lookup in the host is not that fast or malfunctioning which is the current case in txd)
.
Why should we worry about spammers wasting their time posting a comment which is not going to be accepted anyway as the spamlist will catch them out on preview and not the legit visitors who have to wait for a longer load of a page?

Having said that I have no idea how much work is involved in this change of behaviour!


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#9 2007-08-13 09:34:35

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Spam blacklists to load on previewing a comment

Good point. I think changing this behaviour is not a lot of work. Just removing a few lines of code in taghandlers.php: in the comments_form function, try commenting out the three lines containing the word ‘blacklisted’.

Offline

Board footer

Powered by FluxBB