Bulk check - maximum percentage of failed or deferred messages a domain may send per hour

jtgroup

Active Member
Nov 21, 2017
32
2
8
UK
cPanel Access Level
Root Administrator
Hello everyone,

Sorry to bother you but I was wondering, is there a way to check all accounts on a server for the current 'Maximum percentage of failed or deferred messages a domain may send per hour' setting? Obviously I can check each account individually but can I generate a report / see a table of all accounts and their current setting?

Kind regards


James
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
5,425
696
313
cPanel Access Level
Root Administrator
Hey there! No need to apologize - we're here to be bothered!

The easiest way to check these at once would be to examine the /var/cpanel/users/username file for the user in question and check the following block of values:

Code:
MAX_DEFER_FAIL_PERCENTAGE=unlimited
MAX_EMAILACCT_QUOTA=unlimited
MAX_EMAIL_PER_HOUR=unlimited
"unlimited" is the default for those unless they have been changed.

If you'd rather set up a more automated tool for this, you can use the modifyacct API call with no values to return the current settings:

Code:
whmapi1 modifyacct user=username
More details on that can be found here: Update cPanel account · cPanel & WHM Developer Portal
 

jtgroup

Active Member
Nov 21, 2017
32
2
8
UK
cPanel Access Level
Root Administrator
Hi,

Thank you for getting back to me. I would like to check all accounts in one go though, rather than checking each one individually. Is this possible?

Kind regards


James
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
5,425
696
313
cPanel Access Level
Root Administrator
That's where you'd need to do some custom scripting using the modifyacct API call, possibly with a text file to loop through the usernames on the server. I don't have anything pre-written for that situation available, so it would be some custom development work for sure.

I tested this on my own server and it worked well:

Code:
for i in `cat /etc/trueuserdomains | awk {'print $2'}`; do whmapi1 modifyacct user=$i | grep -E 'USER|MAX_DEFER_FAIL_PERCENTAGE' ; done
although it will not return an entry for a user if the value isn't set specifically for that user. For an example of that, see how there is nothing above user 4 in the following output:

Code:
# for i in `cat /etc/trueuserdomains | awk {'print $2'}`; do whmapi1 modifyacct user=$i | grep -E 'USER|MAX_DEFER_FAIL_PERCENTAGE' ; done
    MAX_DEFER_FAIL_PERCENTAGE: unlimited
    USER: user1
    MAX_DEFER_FAIL_PERCENTAGE: unlimited
    USER: user2
    MAX_DEFER_FAIL_PERCENTAGE: unlimited
    USER: user3
    USER: user4
 
Thread starter Similar threads Forum Replies Date
Y Email 6
Z Email 8
jonh Email 4
4 Email 12
F Email 2