Setting the Spam-Score in OnClientConnect...

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
User avatar
Rainer
Normal user
Normal user
Posts: 166
Joined: 2007-06-21 13:40
Location: Zweibrücken - Germany

Setting the Spam-Score in OnClientConnect...

Post by Rainer » 2010-08-12 13:51

Hello, is it possible to set the spam-score in the function: OnClientConnect?

I wish to modify the spam-score depending on unwanted countries.
For expample, is the country-code "cn" or "kr" then set the spam-score to 10.

Kind regards from Germany :roll:
Rainer Noa

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Setting the Spam-Score in OnClientConnect...

Post by Bill48105 » 2010-08-13 03:26

Helpful? http://www.hmailserver.com/documentatio ... rase=score
long Score

Spam score
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

User avatar
Rainer
Normal user
Normal user
Posts: 166
Joined: 2007-06-21 13:40
Location: Zweibrücken - Germany

Re: Setting the Spam-Score in OnClientConnect...

Post by Rainer » 2010-08-13 07:14

Hello Bill, helps not really! :(

Kind regards :)
Rainer Noa

Bill48105
Developer
Developer
Posts: 6192
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: Setting the Spam-Score in OnClientConnect...

Post by Bill48105 » 2010-08-13 14:09

Hmm Doesn't work, not what you're looking for or you don't know how to use it?
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

ObiWan
Senior user
Senior user
Posts: 278
Joined: 2010-07-21 14:30
Location: Halfway between Germany and Egypt

Re: Setting the Spam-Score in OnClientConnect...

Post by ObiWan » 2010-08-14 19:01

Rainer wrote:Hello, is it possible to set the spam-score in the function: OnClientConnect?

I wish to modify the spam-score depending on unwanted countries.
For expample, is the country-code "cn" or "kr" then set the spam-score to 10.

Kind regards from Germany :roll:
Have a look at this, it doesn't even need a script :)

User avatar
Rainer
Normal user
Normal user
Posts: 166
Joined: 2007-06-21 13:40
Location: Zweibrücken - Germany

Re: Setting the Spam-Score in OnClientConnect...

Post by Rainer » 2010-08-14 19:12

Hello ObiWan, I noticed this thread before; but I dont want 40 or more DNSBL's.

I'm using Geoip and this is quick and user-friendly.
For example; we get emails only from our german customers.
Emails from italy, spain ore other countries are at most spam.

Now it's smart to increas the spamscore; is the ip a spammer (wrong helo, SPF, DKIM, DNSBL etc.) the spamscore is reached and blocks the email with 550!
In the other way, the message go thru.

Kind regards :)
Rainer Noa

ObiWan
Senior user
Senior user
Posts: 278
Joined: 2010-07-21 14:30
Location: Halfway between Germany and Egypt

Re: Setting the Spam-Score in OnClientConnect...

Post by ObiWan » 2010-08-14 19:32

Rainer wrote:Hello ObiWan, I noticed this thread before; but I dont want 40 or more DNSBL's.

I'm using Geoip and this is quick and user-friendly.
For example; we get emails only from our german customers.
Emails from italy, spain ore other countries are at most spam.

Now it's smart to increas the spamscore; is the ip a spammer (wrong helo, SPF, DKIM, DNSBL etc.) the spamscore is reached and blocks the email with 550!
In the other way, the message go thru.

Kind regards :)
I see, well, you may start from this script, just add a call to the "DNS lookup"
function from the hMailServer event sink to retrieve the IP country and then,
having it, you may decide how to handle the message; in your case you may
call the function inside the OnClientConnect event and then set the Result.Value
as desired; also, and since you're at it, you may simplify the script found at the
above URL by just running a "TXT" lookup for the (reversed) connecting address
against "zz.countries.nerd.dk" so obtaining the country TLD (suffix) ... or you
may use that code "as is" and optionally add some further fine-grained checks
(e.g. check if the IP owner is "bad" or "good")

User avatar
Snorkasaurus
Normal user
Normal user
Posts: 188
Joined: 2010-08-29 16:32
Location: Canada
Contact:

Re: Setting the Spam-Score in OnClientConnect...

Post by Snorkasaurus » 2010-08-29 16:49

Rainer wrote:Hello ObiWan, I noticed this thread before; but I dont want 40 or more DNSBL's.
Hey Rainer,

You can easily use countries.nerd.dk without having to create a separate DNSBL for each country you want to block. If you set the DNSBL to zz.countries.nerd.dk (note the "zz") it will return different addresses based on the country of origin. In your "expected results" you provide a list of addresses you want to block separated by pipe symbols (see list of returned addresses here). I have a slightly more detailed explanation here.

Does that accomplish what you are looking for?

Snork.

User avatar
Rainer
Normal user
Normal user
Posts: 166
Joined: 2007-06-21 13:40
Location: Zweibrücken - Germany

Re: Setting the Spam-Score in OnClientConnect...

Post by Rainer » 2010-08-29 17:32

Hello Snorkasaurus, THX for your answer; its helps!

Kind regards :)
Rainer Noa

Post Reply