So you read entirely the wrong thing and installed something you did not require?
With smeserver-geoip the GeoIP2 module was already installed? Did you ever bother to check that?
Right here, at the top of the page:
https://wiki.koozali.org/GeoIPThis product includes GeoLite2 data
You can see it here on standard SME with smeserver-geoip installed:
/usr/share/perl5/vendor_perl/GeoIP2
So instead you have now installed a whole pile of stuff that your server did not need, including tools to build modules which means any user, or hacker with access, could build their and install their own modules on your server.
I'll leave you to figure out how to update the modules regularly and how to remove it all. Remember to mention what you have done the next time you ask for help as you now have a non standard SME which may make life harder to fix in the future.
If you removed smeserver-geoip you have removed the automatic update mechanism for the GeoIP databases as well. The module you installed may have added something to crontab, but that is templated and will get overwritten on the next update.
You added code to init.pre which will get overwritten on your next update of spamassassin.
Finally you have a system that doesn't actually DO anything much at all. A user won't be checking headers. It may put [SPAM] in the subject depending on your settings but I found it wasn't very good, and probably for a lot of mail that isn't actually spam.
As for how you should probably have done it. (I think this method with .pre is OK but you should check)
Ensure you have smeserver-geoip installed correctly which has the correct modules for GeoIP2.
nano /etc/mail/spamassassin/my_custom_smeserver.pre
Paste:
loadplugin Mail::SpamAssassin::Plugin::RelayCountry
geodb_module GeoIP2
Then:
mkdir /etc/e-smith/templates-custom/etc/mail/spamassassin/local.cf/
nano /etc/e-smith/templates-custom/etc/mail/spamassassin/local.cf/82geoiprelay
Paste:
# Mark GeoIP Relay Countries
ifplugin Mail::SpamAssassin::Plugin::RelayCountry
# We can add this header as RELAYCOUNTRY is a tag in RelayCountry.pm
add_header all Relay-Country _RELAYCOUNTRY_
# If we template properly we could use qpsmptd BadCountries here
header RELAYCOUNTRY_BAD X-Relay-Countries =~ /(CN|RU|UA|RO|VN|US)/
describe RELAYCOUNTRY_BAD Relayed through spammy country at some point
score RELAYCOUNTRY_BAD 2.0
header RELAYCOUNTRY_GOOD X-Relay-Countries =~ /^(DE|AT|CH|FR)/
describe RELAYCOUNTRY_GOOD First untrusted GW is DE, AT,CH or FR
score RELAYCOUNTRY_GOOD -0.5
endif
# Mail::SpamAssassin::Plugin::RelayCountry
Finally:
signal-event email-update
Simple as that.
You should now get the relevant headers, though as I realised when I did this myself some while ago, a hard GeoIP block via XT_Geoip & smeserver-geoip is much more effective.
This will stop a lot but YMMV.
BadCountries=CN,IN,RU,BR,KR,RO,LT,AR,TW,VN,JP,HK,ID,PH,BD,CZ,BO,TH,MX,MD,IL,CO,BG,SG,RS,PL,IR,UA,EE,AE,CA,BY,NG,TR,AW,AM
xt_geoip has some nice simple reporting to help you.
(Yes, it has taken me a while to dig out my notes and check this works, but I also have a job to do that takes up most of my day. You just weren't that patient enough)
As my best mate says. "It's a wise man that has second thoughts first"
Good luck.