How to reject spam from certain countries

61

Every now and then, a question like this pops up on some email server management forum:

I’d like to be able to reject connections from remote IP addresses if they’re from certain countries.

I have reformatted some tips on how to do this on this page. Feedback is very welcome.