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!

Are there hooks for webmail logins?

Discussion in 'cPanel Developers' started by Luke1818, Sep 15, 2015.

  1. Luke1818

    Luke1818 Registered

    Sep 15, 2015
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    I am exploring the possibility of implementing 2FA for webmail logins. What I need to achieve is run some custom code after a user logs in via the Webmail page, to perform additional authentication (like keying in an OTP etc).

    Is there some hook where I can run some actions after a user has logged in with the password?

    This is the closest solution I found:
    BUT it works only for cPanel users, and not for email user accounts..
    #1 Luke1818, Sep 15, 2015
    Last edited by a moderator: Sep 16, 2015
  2. cPDavidN

    cPDavidN cPanel Developer Staff Member

    Mar 19, 2013
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    DataCenter Provider

    Unfortunately, we don't have hook points for webmail or cPanel logins. This would be a difficult place to add a hook, because cpsrvd would have to fork and drop privileges before executing the hook, but still block the login process. A hook that was implemented incorrectly could completely break cPanel & WHM in a way that very few other hooks could do. It would also introduce an unknown number of code dependencies into cpsrvd, increasing memory usage. I will make a request to find out if we can do it, but please understand that it may not be possible.


    David Nielson
    Integration Developer, cPanel
    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