suspended_login value with UAPI list_pops
Hello,
I am working on an app and I found out that upon suspending a cPanel account, already suspended email accounts within that suspended cPanel account will be returned as NOT suspended by uapi / list_pops. At least in ver 64.0.36.
Is this a feature or a bug?
Steps to reproduce:
1. #uapi --user=blablate Email list_pops regex=office@blablatest.com
---
apiversion: 3
func: list_pops
module: Email
result:
data:
-
email: office@blablatest.com
login: office@blablatest.com
suspended_incoming: 0
suspended_login: 1
errors: ~
messages: ~
metadata:
transformed: 1
status: 1
2. Suspending cPanel account from WHM or uapi...
3. #uapi --user=blablate Email list_pops regex=office@blablatest.com
---
apiversion: 3
func: list_pops
module: Email
result:
data:
-
email: office@blablatest.com
login: office@blablatest.com
suspended_incoming: 0
suspended_login: 0
errors: ~
messages: ~
metadata:
transformed: 1
status: 1
Regards!
-
. Suspending cPanel account from WHM or uapi...
Hello, I've been unable to reproduce this issue on a test system. Can you confirm that you are suspending the email login for the specific email account, as opposed to suspending the entire cPanel account? EX:uapi --user=username Email suspend_login email=test1%40domain.tld
Thank you.0 -
Hi, First I suspend the email login and I test it's suspended: #uapi --user=blablate Email list_pops regex=office@blablatest.com ... suspended_login: 1 Then merely after I suspend the entire cPanel account from WHM, the status of the email login suspension changes to suspended_login: 0 Then, if I merely unsuspend the cPanel account, the suspended email login status returns (suspended_login: 1). Regards! 0 -
Hello, That's actually working as intended. The system adds the LOCKED string to the /etc/shadow password files for all of the account's email users when the cPanel account is suspended. The following document is useful for understanding what happens when an account is suspended: What Happens When You Suspend an Account - cPanel Knowledge Base - cPanel Documentation Thank you. 0 -
Hi, Thanks for the link. I am still struggling to understand why it's intended behavior for uapi to give inaccurate info on a suspended email address after the entire cPanel account has also been suspended. As it is, it seems kind of confusing as we can't trust the output of "uapi --user=... Email list_pops" which is accurate only when the cPanel account is NOT suspended and irrelevant when the cPanel account IS suspended. Indeed I can see that this shouldn't be a problem normally (it just messed a bit my app logic). It's not a serious issue though...easily fixed with an added test. Thanks, Regards! 0 -
Hi, The suspend_login UAPI function works by modifying the email account's entry in the /home/$user/etc/$domain.tld/shadow file. For example, before suspending an email account login, the entry in this file for an email account will look like this: test1:$1$51ayoqJvg$5OFjmu/JNXANDSCZGfjxF2:17322::::::
After suspending the email account login, the entry looks like this (notice the added "!!" before the password):test1:!!$1$51ayoqJvg$5OFjmu/JNXANDSCZGfjxF2:17322::::::
The list_pops UAPI function determines the email account's suspended login status based on that specific change in the shadow file. When you suspend the entire cPanel account, the entry in the shadow file changes to:test1:*LOCKED*$1$51ayoqJvg$5OFjmu/JNXANDSCZGfjxF2:17322::::::*LOCKED*
Thus, the list_pops UAPI function won't detect the suspended status until after the entire cPanel account is unsupended, at which time the individual email account suspension is reactivated. Thank you.0 -
Michael, Thank you for your clarifications! If uapi can't know this, besides uapi is there any API call or any other command that might retrieve the suspended mail account status while the cPanel account is also suspended? I mean WHM does list the suspended email login status even in suspended cPanel accounts. It must find this info somewhere. I've looked a bit in whmapi1 API calls but found nothing relevant. Thanks, Regards! 0 -
I mean WHM does list the suspended email login status even in suspended cPanel accounts. It must find this info somewhere. I've looked a bit in whmapi1 API calls but found nothing relevant.
Hello, Could you verify where you are seeing that information in Web Host Manager? Thank you.0 -
I mean when we access cPanel from WHM -> List accounts... and then click on the cPanel icon and get redirected to cPanel then go to Email Accounts. There, we can see that the email is login suspended or not, even in suspended cPanel account. If cPanel can get that information, maybe we can too... 0 -
I mean when we access cPanel from WHM -> List accounts... and then click on the cPanel icon and get redirected to cPanel then go to Email Accounts. There, we can see that the email is login suspended or not, even in suspended cPanel account. If cPanel can get that information, maybe we can too...
I'm unable to reproduce that behavior using the following steps: 1. Suspended an email account. 2. Suspended the full cPanel account the suspended email account is associated with. 3. Accessed cPanel and verified no suspension status appears in "Email Accounts". 4. Confirmed the /home/username/.cpanel/email_accounts.json contains a "suspended_login":0" entry for the suspended email account. 5. Unsuspended the full cPanel account the suspended email account is associated with. 6. Confirmed the /home/username/.cpanel/email_accounts.json now contains a "suspended_login":1" entry for the suspended email account. Are you using different steps, or is it possible you were viewing cached data? Thank you.0 -
It took me a while to figure out what I was doing differently. 0. Nothing is suspended. 1. Suspend cPanel account from WHM. 2. Suspend email account from cPanel. ... "office": { "disk_mtime": 1502735937, "diskmtime": 1503004647, "diskquota": "262144000", "diskused": "64137", "suspended_login": 1 } Also the 'suspended login' icon appears in cPanel. So my findings were different from yours because I was first suspending the cPanel account and afterwards the email account. Also it's funny that if I un-suspend the email account while the cPanel account is still suspended after I un-suspend the cPanel account, the email account returns to the suspended status. Anyway for me this is the end of this matter as it's obvious that I can't detect reliably an email account status while the containing cPanel account is suspended. Thank you! I appreciate your help and patience! 0
Please sign in to leave a comment.
Comments
10 comments