block mails from a particular country in postfix

Is there any possibility to block mails from country wise in Postfix.  for Example I need to block all mails coming from China. Please let me know the process.

Vijay Kumar GajulaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tim EdwardsIT Team Lead - Unified Communications & CollaborationCommented:
Please take a look here, they were able to get this completed with Postfix:
Kent WSr. Network / Systems AdminCommented:
The most straightforward way is blocking the /8 IP block of the associated country, via iptables.
The list of IPv4 is here -
Ipv6 is here -

Regardless of your postfix config, if you block via iptables rules, they won't be able to get mail or any other packets to your bruteforce, etc.
arnoldCommented: has references to enhance functionality.
Blocking by firewall could lead to dos since there is a resource for blocking and attempts will be retried ..
Using rbl that will mimic an SMTP session and issue a permanent error when the recipient is identified in the SMTP session.

Rbl, you would use an internally created ..........

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
5 Ways Acronis Skyrockets Your Data Protection

Risks to data security are risks to business continuity. Businesses need to know what these risks look like – and where they can turn for help.
Check our newest E-Book and learn how you can differentiate your data protection business with advanced cloud solutions Acronis delivers

Natty GregIn Theory (IT)Commented:
Use PFblocker
Vijay Kumar GajulaAuthor Commented:
is PFblocker is open source? can we install it in my mail server which is UBUNTU back-end. If So Please let me know the procedure.
Natty GregIn Theory (IT)Commented:
Yes PFblocker is open source, however it only installs on PFsense from what I know and found. So maybe use PFsense as your firewall then you'll have all this functionality
Vijay Kumar GajulaAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.