Bulk check - maximum percentage of failed or deferred messages a domain may send per hour
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
-
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: 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:whmapi1 modifyacct user=username
More details on that can be found here: Update cPanel account " cPanel & WHM Developer Portal0 -
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 0 -
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: 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:# 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: user40
Please sign in to leave a comment.
Comments
3 comments