Disabling Unlimited Quota "root access required"
Long has it been that the horde of people have been crying for CPANEL to put in a dam email option TO REMOVE the dredded "UNLIMITED" option from the page... well i got sick and tired of looking at that word and decided to remove it MANUALLY...
Barring some trail and error for 2 days i finally managed to remove it BUT also including limiting the MB to 2000MB regardless...
Cpanel i mean REALLY now looking at it, its so dam simple "making sure you have root access, if you running an account outside of root access then sorry cant help you unless you point the person whom is hosting your email to this POST"
I only did this for their new skin "Paper Lantern" i'm sure you can find the same line in the other skins but i couldn't be bothered because i only use "Paper Lantern - awesome skin btw not sure why you would use any other..."
** DISCLAIMER - you do this at your own risk, you use this at your own risk, i take no responsibility what so ever if you mess up by using this method... you have been warned...
1. you must have root access to the server or hosting, hosting the cpanel/whm
2. this edit applies to "Paper Lantern" only it MIGHT work for others
3. you are going to edit root files of cpanel MAKE BACKUPS before attempting any edits of said files
4. Mailbox Quota dont exceed 2048MB
5. THIS IS ONLY FOR ENGLISH other languages should work but youll have to figure that out.
** LETS START **
1. navigate to /usr/local/cpanel/base/frontend/paper_lantern/mail/pops/views
2. find the file changeQuotaModule.ptt
3. look for :
email-max-quota="{{maxQuota}}"
change to :
email-max-quota="2000"
can be what ever min/max amount you want just keep it below 2048
4. look for :
[%- LANG.mailbox_maxquota -%]
change to :
Quotas cannot exceed xxxxMB
where xxxx is, is the amount you've chosen to limit too
5. look for :
[% LANG.unlimited %]
and delete all of the above, this will remove the "UNLIMITED" option from the page "WOOOHOOO!!!"
6. save and exit, reload page and check the magic of no unlimited... try setting a higher than 2000mb limit and youll see some more magic
Cpanel so simple, i mean really... for the people that created this awesome product not to inlcuding something like this is beyond me...
-
Hello, Thank you for sharing your workaround. Note the feature request for what you are seeking is found at: Ability to disable 'unlimited' email quotas Thank you. 0 -
*bUMp* AND *Update* Just fair warning if cpanel does any updates it seems to always update all the paper_latern files there by overwriting the changes... No problem just repeat steps above and youll be back to normal again, suppose you need to keep track of cpanel/whm updates then 0 -
*bUMp* AND *Update* Just fair warning if cpanel does any updates it seems to always update all the paper_latern files there by overwriting the changes... No problem just repeat steps above and youll be back to normal again, suppose you need to keep track of cpanel/whm updates then
G'day gavcom, We do much same thing, but we set the max quota based on the user's hosting plan/package so different users have different max quota limits. We also install hooks on addpop/editquota. It gives us a lot of flexibility with our billing plans. If you first derive your own theme from the standard paper_lantern instead of changing paper_lantern directly, your changes won't be overwritten on cPanel updates. You still need to do a compare of the file changes on each update, and rebuild your own theme from the new paper_lantern base (we have quite a few extra modifications), but that usually only takes a few minutes unless there has been a major redesign. There's a feature request for plan-related max quotas somewhere aging away, but although it's fairly simple code changes that are required, it never seems to be added in. It's disappointing, and as you write, so simple, especially if you're adding it in from the development platform as the cPanel coders would be. Best regards, LBJ0 -
If you first derive your own theme from the standard paper_lantern instead of changing paper_lantern directly, your changes won't be overwritten on cPanel updates.
Ye already on that road and testing, never really dived into their code pages/themes, I just got tired of clients leaving the unlimited option on and forgetting about the box while spam builds up. Just recently removed boxes full of spam totalling near 20gig, crazy... and yes before you ask running CSF in "hard" mode else im sure that would have been 200gig worth of spam... LOLWe do much same thing, but we set the max quota based on the user's hosting plan/package so different users have different max quota limits. We also install hooks on addpop/editquota. It gives us a lot of flexibility with our billing plans.
What code did you use to get this right was it part of the {{maxquote}} or some other code peice... ?There's a feature request for plan-related max quotas somewhere aging away, but although it's fairly simple code changes that are required, it never seems to be added in.
Yes that been what YEARS now, looking at the code and thinking to my self how can they not just add a tick to HIDE it, it would honestly be so SIMPLE for them... beyond words, keeping the max quota aside, a simple tick... sheesh...0 -
Ye already on that road and testing, never really dived into their code pages/themes, I just got tired of clients leaving the unlimited option on and forgetting about the box while spam builds up. Just recently removed boxes full of spam totalling near 20gig, crazy... and yes before you ask running CSF in "hard" mode else im sure that would have been 200gig worth of spam... LOL What code did you use to get this right was it part of the {{maxquote}} or some other code peice... ? Yes that been what YEARS now, looking at the code and thinking to my self how can they not just add a tick to HIDE it, it would honestly be so SIMPLE for them... beyond words, keeping the max quota aside, a simple tick... sheesh...
G'day gavcom, Take a look at... Template::Tutorial::Web ...and... Guide to Template Toolkit - API Calls from Template Toolkit - Software Development Kit - cPanel Documentation Use the template language to call the API to retrieve the hosting package for the user. Then limit the quota based on the plan settings you have in place. We also use hooks on on both addpop and editquota. Also, in addition to changeQuotaModule.ptt you (possibly more importantly) need to make similar mods to addEmailAccount.ptt/js/min.js Best regards, LBJ0 -
Hello, I did want to note the following options are available under the "Mail" tab in "WHM >> Tweak Settings": Default user-defined quota value for new email accounts Default quota option for new email accounts While this doesn't prevent a cPanel user from using "unlimited" as a quota value for email accounts, it does allow you to set a default email quota that appears in the UI during the email creation process. Thank you. 0 -
Hello, I did want to note the following options are available under the "Mail" tab in "WHM >> Tweak Settings": Default user-defined quota value for new email accounts Default quota option for new email accounts While this doesn't prevent a cPanel user from using "unlimited" as a quota value for email accounts, it does allow you to set a default email quota that appears in the UI during the email creation process. Thank you.
G'day cPanelMichael, Thank you, but that really doesn't come near to what we needed and had to code for ourselves. We needed the ability to set a maximum quota size for mail accounts based on the account plan. This seemed to be a very reasonable extension of how we could already set a maximum number of email accounts, a maximum number of FTP accounts, a disk space quota, a data quota, and a limit on just about anything else associated with any specific hosting plan. It's a very simple thing to code, and would be truly trivial for cPanel developers to build into the code base. We modified the theme to do most of the work, but we also put hooks in place in case clients disable JavaScript or find other clever ways to post data. The end result is that we can be much more granular in our hosting plans. That makes it far easier for staff to solve clients' growth requirements with an easy upsell, and that drives profit growth. It's really an oddly missing feature of cPanel. Best regards, LBJ0 -
No need for code changes they have F I N A L L Y made it possible for us to do it from with in CPANEL, all hail the coders they finally woke up... Thanks guys/girls/devs for finally making it possible - v70.0.41
0 -
Hello @gavcom, Thank you for updating this thread. Here's the full link to information about this feature in the cPanel & WHM version 70 release notes: 70 Release Notes - Version 70 Documentation - cPanel Documentation Thank you. 0
Please sign in to leave a comment.
Comments
9 comments