glipaddress - How do I interpret?

Use this forum if you want to discuss a problem or ask a question related to a hMailServer beta release.
Post Reply
cveillon
Normal user
Normal user
Posts: 88
Joined: 2006-01-31 23:56
Location: Roy, UT USA

glipaddress - How do I interpret?

Post by cveillon » 2006-09-12 18:48

I'd like to be able to interpret the ‘glipaddress’ under the ‘hm_greylisting_triplets’ table. I've been looking at this over the last few weeks thinking this shouldn't be too hard... but I've come to the conclusion that this is a little harder than I think.

For example, I have an glipaddress that comes from one of my servers (with no relay) that shows a value of 2789656069. Ok, first of all there are no legal IP address possibilities here. Second, the real IP address is 166.70.198.5.

What am I missing here? :oops: Has anyone been able to figure this out?

I’d really like to be able to use the glipaddress information to add additional ‘white listing’ for Greylisting.

Would anyone else find this useful? :)

with best regards,
Chuck
hMailServer 4.4.1-B273 Built-in MySQL
3 ea prod mx servers on XP Home, 1 ea on Win2k

User avatar
martin
Developer
Developer
Posts: 6837
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2006-09-12 18:56

hMailServer stores the IP address as a "long" instead of storing them as a string. 166.70.198.5 is just a more-human-readable version of 2789656069. From a geek perspective, 2789656069 is closer to the "real" ip address than 166.70.198.5. Most software you use will probably use 2789656069 internally.

In hMailServers case, I use the numeric version internally since using number instead of strings often gives better performance when it comes to searching. In the grey listing case, you may have hundreds of thousands of rows in the table, so good performance is.. good. :)

It's fairly easy to convert from dotted to long and back again:
PHP example: http://www.php.net/manual/en/function.long2ip.php
VB example: http://www.freevbcode.com/ShowCode.Asp?ID=5512
Ugly online converter: http://www.elfqrin.com/LongIP.html

(Some web browsers (such as Firefox and Internet Explorer) can use these numbers directly. For example, if you go to http://2789656069/ you'll go to the same server as if you choose http://166.70.198.5/)

cveillon
Normal user
Normal user
Posts: 88
Joined: 2006-01-31 23:56
Location: Roy, UT USA

Post by cveillon » 2006-09-12 19:26

Wow! :shock:

I had no idea, and I've been doing this for more than 10 years. :roll:

Maybe this could be added to the documentation or HOWTO forum?

Thanks Martin! You're the greatest!
hMailServer 4.4.1-B273 Built-in MySQL
3 ea prod mx servers on XP Home, 1 ea on Win2k

Post Reply