New features for spam protection plugin ...

Creating and modifying plugins.
Post Reply
Lux
Regular
Posts: 764
Joined: Fri Aug 12, 2005 4:36 pm
Location: Grüt, Zürich, Switzerland
Contact:

New features for spam protection plugin ...

Post by Lux »

Hi,

is it possible to upgrade the spam protection plugin to support the following features?

- checking for "valid" e-mail-adress (somewhat@other.do.main.tld, a check of an existing top level domain and the at-sign "@" should be sufficient)

- checking for multiple exclamation marks

- checking for empty subjects

... more to come

Dirk
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: New features for spam protection plugin ...

Post by garvinhicking »

Hi!
- checking for "valid" e-mail-adress (somewhat@other.do.main.tld, a check of an existing top level domain and the at-sign "@" should be sufficient)
This could be done, but personally I'm not fond of email verifiers, as they all tend to have flaws in identifying mail adresses at some point. Actually, serendipity already checks for "@" containment.

You cannot easily check TLDs, as they all might change. In a few months we may have ".xxx", and we'd have to re-edit the domain check every time. That would suck big time. :)
- checking for multiple exclamation marks
If you check for that, you can also check IF YOU ALWAYS USE UPPERCASE or check for multiple "???" signs, or check for " ? ? ? ? ?" or check for ". . . . .. ". Where does one draw the line? Thus this method of content checking is not a wise thing to apply. You'd also always run after you filter and customize it more often than where it actually helps.
- checking for empty subjects
S9y does not allow subjects in comments... :)

Ideally, you'd patch up your own spamblock protector with PHP code suitable for your own needs, but a generall workable solution is hard to find.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Lux
Regular
Posts: 764
Joined: Fri Aug 12, 2005 4:36 pm
Location: Grüt, Zürich, Switzerland
Contact:

Re: New features for spam protection plugin ...

Post by Lux »

garvinhicking wrote:This could be done, but personally I'm not fond of email verifiers, as they all tend to have flaws in identifying mail adresses at some point. Actually, serendipity already checks for "@" containment.
My wife got a comment last night without "@"-sign. So, can you please tell me, how I can set it up?
You cannot easily check TLDs, as they all might change. In a few months we may have ".xxx", and we'd have to re-edit the domain check every time. That would suck big time. :)
You can always get a complete list at iana.org.
If you check for that, you can also check IF YOU ALWAYS USE UPPERCASE or check for multiple "???" signs, or check for " ? ? ? ? ?" or check for ". . . . .. ". Where does one draw the line? Thus this method of content checking is not a wise thing to apply. You'd also always run after you filter and customize it more often than where it actually helps.
Correct. That is difficult.

Maybe one can find a source for that somewhere in the net.
S9y does not allow subjects in comments... :)
Aargh, you are right.
Ideally, you'd patch up your own spamblock protector with PHP code suitable for your own needs, but a generall workable solution is hard to find.
I think, the best would be a "regexp-checker" ...

Dirk
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: New features for spam protection plugin ...

Post by garvinhicking »

Hi!
My wife got a comment last night without "@"-sign. So, can you please tell me, how I can set it up?
Sorry, I was mistaken. The "@" check in fact only replaced "@" with "[at]", and not validate it.

I just hacked a new config switch into the spamblock plugin that now allows to check for "@" and committed it to our 0.9 trunk/nighty.
You cannot easily check TLDs, as they all might change. In a few months we may have ".xxx", and we'd have to re-edit the domain check every time. That would suck big time. :)
You can always get a complete list at iana.org.
I know that. But one would have to edit this list over and over again, as the TLDs can change sometimes, right? :)
And that list is quite large, I'm afraid a regular expressions would be very large.
Maybe one can find a source for that somewhere in the net.
I think the problem is this list would always change and grow endless - thus it's not a solution. Bayes filters would maybe work, but they're hard to implement on PHP-base.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Lux
Regular
Posts: 764
Joined: Fri Aug 12, 2005 4:36 pm
Location: Grüt, Zürich, Switzerland
Contact:

Re: New features for spam protection plugin ...

Post by Lux »

garvinhicking wrote:I know that. But one would have to edit this list over and over again, as the TLDs can change sometimes, right? :)
And that list is quite large, I'm afraid a regular expressions would be very large.
The only intelligent way is, to import the list into a database table and to check against this table.

Once a month the table could be updated.
garvinhicking wrote:I think the problem is this list would always change and grow endless - thus it's not a solution. Bayes filters would maybe work, but they're hard to implement on PHP-base.
I agree! But that does not satisfy me.

Dirk
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: New features for spam protection plugin ...

Post by garvinhicking »

Hi!
The only intelligent way is, to import the list into a database table and to check against this table.

Once a month the table could be updated.
Okay, that's a good idea! I'd like such an implementation, this should be workable.
garvinhicking wrote:I think the problem is this list would always change and grow endless - thus it's not a solution. Bayes filters would maybe work, but they're hard to implement on PHP-base.
I agree! But that does not satisfy me.
Then you should best look at the serendipity_event_spamblock plugin and add your custom rules in that file directly...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Lux
Regular
Posts: 764
Joined: Fri Aug 12, 2005 4:36 pm
Location: Grüt, Zürich, Switzerland
Contact:

Re: New features for spam protection plugin ...

Post by Lux »

garvinhicking wrote:Okay, that's a good idea! I'd like such an implementation, this should be workable.
Fine!
garvinhicking wrote:Then you should best look at the serendipity_event_spamblock plugin and add your custom rules in that file directly...
I think, I live with the existing solution. If I do manual modifications, I have to repeat them every time an update comes.

Thanks for your support.

Dirk
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: New features for spam protection plugin ...

Post by garvinhicking »

Hi!
I think, I live with the existing solution. If I do manual modifications, I have to repeat them every time an update comes.
I'm really sorry about that - you might want to have your manual code as an include which you could easily add?

Or make use of CVS/SVN so that you can update your blog without overwriting custom modifications?

Best Regards,
Garvni
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Lux
Regular
Posts: 764
Joined: Fri Aug 12, 2005 4:36 pm
Location: Grüt, Zürich, Switzerland
Contact:

Re: New features for spam protection plugin ...

Post by Lux »

garvinhicking wrote:I'm really sorry about that - you might want to have your manual code as an include which you could easily add?

Or make use of CVS/SVN so that you can update your blog without overwriting custom modifications?
I am not quite sure, what I really want to do.

Maybe I take my holiday and get clear about that ;-)

Thanks for your support.

Dirk
Post Reply