1
SMTP - country of origin, How do you do that ?
Question asked by Curtis Kropar www.HawaiianHope.org - Today at 3:15 AM
Unanswered
In the SMTP logs, I now see "Country Code : " - I never took notice of this before.
1) When was this put in ?
2) SmarterPeeps... HOW do you accomplish that ? What tool are you using to generate this ?  Is this something you built or is this a tool available to the public ?

We have pfBlocking on our firewall with Geo IP blocking and even though we have piles of countries blocked (CN, NL, TR, RU) - you can see they are still getting through, BUT, your SMTP here is properly identifying them.

I want some way to accurately block inbound traffic from a variety of places at our firewall level. I see this and I now think I can export a report to excel and run some queries to pull out IP's from countries I want to block, but wondering if we can just integrate that tool directly to our firewall instead of me doing a song and dance work around.

[2024.10.22] 00:10:00.833 [45.148.10.50][52383233] Country code: NL
[2024.10.22] 00:10:37.056 [45.148.10.50][20258366] Country code: NL
[2024.10.22] 00:13:05.243 [220.246.43.233][61278381] Country code: HK
[2024.10.22] 00:13:19.294 [178.70.243.35][54515413] Country code: RU
[2024.10.22] 00:13:56.060 [114.251.109.35][54996657] Country code: CN
[2024.10.22] 00:14:06.629 [87.120.218.157][11094627] Country code: IT
[2024.10.22] 00:14:09.054 [223.82.241.89][57627059] Country code: CN
[2024.10.22] 00:14:16.627 [78.154.31.59][32237079] Country code: BG
[2024.10.22] 00:14:54.550 [116.114.84.170][59080338] Country code: CN
[2024.10.22] 00:15:05.037 [5.11.164.165][62718108] Country code: TR
[2024.10.22] 00:16:54.490 [65.20.205.197][54067822] Country code: IQ
[2024.10.22] 00:17:01.872 [180.168.119.2][43875323] Country code: CN
[2024.10.22] 00:17:07.424 [82.19.12.103][50121484] Country code: GB
[2024.10.22] 00:17:14.049 [121.138.168.221][2614807] Country code: KR
[2024.10.22] 00:17:30.109 [121.202.201.109][43792550] Country code: HK

www.HawaiianHope.org - Providing technology services to non profit organizations, low income families, homeless shelters, clean and sober houses and prisoner reentry programs. Since 2015, We have refurbished over 11,000 Computers !

5 Replies

Reply to Thread
0
Brian Bjerring-Jensen Replied
Pfsense with pfblockerNG is what you want.
0
Brian, That is what we already have. I have Africa blocked, Europe blocked, Asia blocked. Stuff still getting through. Unless I have something set up wrong. but some stuff seems blocked and other stuff not.

www.HawaiianHope.org - Providing technology services to non profit organizations, low income families, homeless shelters, clean and sober houses and prisoner reentry programs. Since 2015, We have refurbished over 11,000 Computers !
0
J. LaDow Replied
SmarterMail uses a static database that gets updated (hopefully) whenever SM is updated.  That is where the country code lookups are coming from.  I'm almost positive the databases are from MaxMind - but not sure what the "manual update" procedure would be as we skipped all that entirely with our own IDS solution.

In the past, we have seen many inconsistencies in the IP space between SM and our outside providers - mainly because assignments are always changing.  

We use DigitalRuby IPBan Pro to handle our geo blocking and log scanning blocks and ipinfo.io for updated GeoIP information data.
MailEnable survivor / convert --
0
Brian Bjerring-Jensen Replied
Its the SMTP servers that you need to find and block. They can easily use an SMTP in a non-blocked country.
0
Ray Burd Replied
Employee Post
Hello,
J LaDow is correct, we use MaxMind for our Geo IP database. You should be able to integrate the MaxMind database (typically in .mdb format). You may need to create an account with MaxMind to download the GeoLite2 database, but you should then be able to login to your pfSense web interface and go to Diagnostics > Command Prompt - You can use scp or sftp to transfer the database file to /usr/local/share/GeoIP/ - Then it should just be a matter of switching the database used under Firewall > pfBlockerNG > GeoIP - Under GeoIP Settings > make sure its pointing to the new database.
Ray Burd System/Network Administrator SmarterTools Inc. www.smartertools.com

Reply to Thread