Thursday, April 13, 2017

Block Domain to Send Mail in CPanel

Description: If any domain send huge spam then you can block domain to send mail
Procedure:
  • Open SSH console using root user
  • Check /etc/blockeddomains file exists or not
  • Add domain name in this file that you want to block using below command
    • # echo "thedomain.com" > /etc/blockeddomains
  • After add it set permission on this file using below command
    • # chown root.mail  /etc/blockeddomains
    • # chmod 644 /etc/blockeddomains
  • Login WHM and go to “EXIM Configuration Manager”
    • WHM - Service Configuration - Exim Configuration Manager - Advance Editor
  • Search for "Add additional configuration setting" This can be located by fourth of the way of scroll down




  • Add entry : domainlist blocked_domains = lsearch;/etc/blockeddomains


  • Search for "ROUTERSTART"  and add following entry
  • reject_domains:
    driver = redirect
    domains = +blocked_domains
    allow_fail
    data = :fail: Connection rejected: SPAM source $domain is manually blacklisted.
  • Restart exim service after make changes
  • If you want to add more domain then add entry it in  /etc/blockeddomains
     

No comments:

Post a Comment