New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MailboxHandler crashed on empty quota value #347
Comments
what version of postfixadmin are you using? master already has something a bit different from what your patch is based on - protected function beforestore() {
if (isset($this->values['quota']) && $this->values['quota'] != -1 && is_numeric($this->values['quota'])) {
$multiplier = Config::read_string('quota_multiplier');
if ($multiplier == 0 || !is_numeric($multiplier)) { // or empty string, or null, or false...
$multiplier = 1;
}
$this->values['quota'] = $this->values['quota'] * $multiplier; # convert quota from MB to bytes
} see : https://github.com/postfixadmin/postfixadmin/blob/master/model/MailboxHandler.php#L221 |
The code you were posting is the code delievered from last stable download - 3.2 (via official website). My patch adds another check for the empty quota value at the beginning of the function. If master fixes this it would be helpful to publish the fix or update the download section if already done. I just checked a few hours ago. |
The fix probably isn't in 3.2 .... yet. |
Thanks! Any idea when you will have the release published? |
if git's log is to be believed, we released 3.2.3 back in Sept 2019. Since then there have been a couple of bug fixes - postfixadmin-3.2.3...postfixadmin_3.2 which seem to be mostly quota related. I'll bump the smarty variant bundled in, and do a 3.2.4 release soon. |
Thank you for the fast fix. Please check the official download repositories. They do not offer any release after 3.2 - so 3.2.1 -> 3.2.3 are missing |
You're looking in the wrong place - us cool kids hang out at : https://github.com/smarty-php/smarty/releases !! :-) |
Thanks for the hint. Nevertheless, the releases must be searchable. At the moment they are not. Try out a Google search. Appropriate links/hints to the newest distribution channels are missing. (I noticed the tag before this report but was unable to find a download for it.) Thanks again for maintaining this software. It makes life so much easier :) |
Oh, you're referring to the postfixadmin releases page(s) e.g. on sourceforge? I know they're stale; it's the annoyance of being split over two project "homes". |
Yes. They point to github. but from there is no hint where to get the releases. Perhaps it shall be mentioned in README.md. |
I've setup some sort of integration between github and sourceforge; so the next github release may magically get mirrored there. I'm not sure how well that'll work. I have deleted some of the old 3.2.x files and uploaded the 3.2.4.tar.gz file onto sourceforge. |
3.2.4 release does not include the fix:
Downloaded from: https://github.com/postfixadmin/postfixadmin/archive/postfixadmin-3.2.4.tar.gz |
sigh. That'll teach me ..... Happy with the commit above? |
The patch itself seems to work in my testings :) |
Hmm, I'd rather avoid creating multiple releases, just for 1 line changes. Are you able to just download the latest MailboxHandler from https://raw.githubusercontent.com/postfixadmin/postfixadmin/postfixadmin_3.2/model/MailboxHandler.php and check against that ? |
All good. I am using a patch file for my purposes at this point in time :) I will re-evaluate when the next release is available. So you don't need to make an extra release. |
When you add a new mailbox to a domain using an empty quota field then the model/MailBoxHandler.php crashes.
Actual behaviour: edit.php page crashes (database entry seems to be created nevertheless)
Expected behaviour: Regard quota as -1 (non-existent or default) or complain about empty field
Please find a patch
MailboxHandler.txt
for this as attachment
The text was updated successfully, but these errors were encountered: