Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Allow Email Access from specific IP only, block everyone else

Discussion in 'E-mail Discussion' started by USA_Webmaster, Jun 7, 2018.

  1. USA_Webmaster

    USA_Webmaster Well-Known Member

    Dec 10, 2015
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    How do I disable email access to a specific email account (or cPanel primary domain emails) from every IP address in the world except for the one I whitelist?

    I check server logs and I see Temporary Block for 1800 seconds [LF_SMTPAUTH] lfd alerts because people from other parts of the world are trying to access my email account.


    Is there something similar I could do email account(s) for a primary domain on a cPanel account? Allow email account access to whitelisted IPs, block / deny everyone else?

    Normally, for a website, I could just add .htaccess file to a directory and copy / paste code below to very top:

    order deny,allow
    allow from
    deny from all
    ErrorDocument 403
  2. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Nov 14, 2017
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    DataCenter Provider
    Hi @USA_Webmaster

    Host access control may provide the control you'd like. Located at WHM>>Security Center>>Host Access Control you can block webmail access for everyone but a few addresses. You also can create IP tables rules to block by port but I would be concerned about the effectiveness of this as you could affect your ability to receive mail.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice