Are there hooks for webmail logins?

Luke1818

Registered
Sep 15, 2015
3
0
1
Singapore
cPanel Access Level
Root Administrator
Hi,

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: github.com/steadramon/cpanel_addon-twostepauth
BUT it works only for cPanel users, and not for email user accounts..
 
Last edited by a moderator:

DavidN.

Active Member
Mar 19, 2013
42
3
83
cPanel Access Level
DataCenter Provider
Hello,

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.

Thanks,

David Nielson
Integration Developer, cPanel