npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

haraka-plugin-geoip

v1.1.0

Published

provide geographic information about mail senders.

Downloads

5,696

Readme

Build Status Code Climate NPM

geoip

provide geographic information about mail senders.

SYNOPSIS

Use MaxMind's GeoIP databases to report geographic information about senders.

This Haraka plugin supports two geoip modules:

| Plugin | geoip module | | ------ | ----- | | haraka-plugin-geoip | maxmind | | haraka-plugin-geoip-lite | geoip-lite |

INSTALL (lite)

Install the npm geoip-lite module and update the DBs:

npm install -g geoip-lite
cd node_modules/geoip-lite && npm run-script updatedb license_key=YOUR_LICENSE_KEY

INSTALL (maxmind)

The maxmind module requires the manual download of the GeoIP databases. The npm module maxmind-geolite-mirror will download the files for you and also keep them up-to-date if you run it periodically.

mkdir -p /usr/local/share/GeoIP
npm install -g maxmind-geolite-mirror
/usr/local/bin/maxmind-geolite-mirror

DESCRIPTION

GeoIP results are stored in connection.notes.geoip and the haraka-results object at connection.results.get(geoip). The following information is typically available:

continent: NA,
country:   US,

If the GeoIP city database is available, the following may also be available:

region:   CA,
city:     San Francisco,
ll:       [37.7484, -122.4156],
distance: 1539    // in kilometers
range:    [ 3479299040, 3479299071 ],

This module also adds entries like this to your logs:

[geoip] US
[geoip] US, WA
[geoip] US, WA, Seattle
[geoip] US, WA, Seattle, 1319km

Calculating the distance requires the public IP of this mail server. See config.distance.

CONFIG

  • distance

Performs geodesic distance calculations. Calculates the distance "as the crow flies" from the remote mail server.

This calculation requires a 'from' IP address. This will typically be the public IP of your mail server. If Haraka is bound to a private IP, net_utils will attempt to determine your public IP using STUN. If that doesn't work, edit config/smtp.ini and set public_ip.

  • show.city

show city data in logs and headers. City data is less accurate than country.

  • show.region in logs and headers. Regional data are US states, Canadian provinces and such.

Set a connection result to true if the distance exceeds this many kilometers.

  • too_far=4000

SPAM PREDICTION WITH DISTANCE

Spatio-temporal Network-level Automatic Reputation Engine

"For ham, 90% of the messages travel about 4,000 km or less. On the
other hand, for spam, only 28% of messages stay within this range."

Observations in 2014-2016 suggest that geodesic distance continues to be highly correlated with spam.

LIMITATIONS

The distance calculations are more concerned with being fast than accurate. The MaxMind location data is collected from whois and is of limited accuracy. MaxMind offers more accurate data for a fee.

For distance calculations, the earth is considered a perfect sphere. In reality, it is not. Accuracy should be within 1%.

SEE ALSO