Unable to delete messages from webmail when quota is full

Hi,

One of our domains has small per-user mail quotas of 25MB, and when those users get maxed out they're unable to delete messages through the Read Mail webmail module in Usermin. We're seeing a few different errors:

Error: Failed to write to /home/domain/homes/user/.usermin/mailbox/lastfolder when closing : Disk quota exceeded

Error: Write failed : Disk quota exceeded

The only way messages can be deleted is by temporarily increasing the user's quota.

I haven't dug into this myself but I'm assuming, especially with the first error, that there's some kind of wrapper involved for various file operations that checks the quota and throws an error if it's full. Certain ops like message/file deletions or status type updates should be excluded otherwise the user has to contact their admin to help them out.

I assume this is a fairly new issue, regression or oversight in the quota handling, as I was unable to find any similar bug reports, but I couldn't tell you exactly when it started happening since we just took on this domain on the 26th and some users are reaching that threshold due to some large spam messages. I applied a webmin-1.881 update that day but I'm not sure if that would be related unless there's some shared perl functions, etc.

Thanks alot,

Mike

Status: 
Closed (fixed)

Comments

Ok, I see the bug here - this will be fixed in the next Usermin release.

Did this fix ever make it into Usermin? My coworker mentioned he was still running into this as of yesterday.

Thanks,

Mike

Yes, I believe that would have made it into Usermin 1.741 back in April.

Which Usermin version is it that you have there?

We're running usermin-1.741 on Debian 8.11.

I had a little time to try and investigate some more today. It seems like there's some secondary file operations contributing to this issue.

Just trying to get a list of messages from mailbox folder produces an error like this:

Failed to write to /home/domain/homes/username/.usermin/mailbox/maildircache/domain_homes_username_Maildir.Spam when closing : Disk quota exceeded

And nothing else. All you can do is go back to the previous page.

This appears to be the close_tempfile() call on line 2057 in the get_maildir_files() function in boxes-lib.pl. If I comment that out and try again I can actually get a list of messages in the folder, but at the bottom of the page is another error:

Failed to write to /home/domain/homes/username/.usermin/mailbox/lastfolder when closing : Disk quota exceeded

And that looks like another close_tempfile() call in the save_last_folder_id() function defined in mailbox-lib.pl.

Commenting that out and attempting to delete a message results in a request that never finishes. I assume there's additional (similar) file ops happening here that don't succeed and the web interface spins indefinitely waiting for an expected response.

There's probably lots of these types of calls happening all over the place. I think the only way to allow users will full quotas to be able to clear out some mail and restore their account to working order without admin intervention would be to always check the quota before these calls are made, and skip them if they are full or close to it. Either that or handle the lastfolder, maildircache, etc, in a completely different way. Store that data somewhere else and/or owned by a different user, someone not tied up with a quota, a special usermin user or root.

Ok, I looked further into this and it turns out that running out of disk quota when closing the file isn't properly handled by the code. This will be fixed in the next release of Usermin though.

Status: Fixed ยป Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.