Unable to View Mailbox in Usermin - Fixed by Switching Themes

SYSTEM INFORMATION
OS type and version CentOS Linux 7.9.2009
Webmin version 2.402
Usermin version 2.302

I have just got usermin working and found that I am getting an error when trying to view the inbox of a user:

Error: 500 - Perl execution failed – Undefined subroutine &extensions::list_folders_sorted called — /extensions/mail/folders.cgi

This only happens in the Authentic theme, as when I change the theme through webmin to Framed everything works correctly.

All mailboxes work fine in webmin using the Authentic theme.

This suggests that there is an issue with the Authentic theme in usermin.

Thanks!

Hello,

Thanks for the heads up!

This is an unusual issue. Can you try running:

systemctl restart webmin usermin

…then force reload the browser tab, or try using an incognito tab with all plugins disabled, and give it another try.

Already done all that and the error persists.

The clue that lead me to the Theme being the issue came from this thread:

where you described the issue as being caused by sudo-capable users:

Maybe this is the same root cause?

This was the applied fix:

Have you applied this fix now?

No, as I assumed that this was specific to webmin (which works fine) rather than for usermin where I am having the issue.

If you go to “Webmin ⇾ Usermin Configuration: Available Modules”—which modules do you have enabled?

Also, can you show a screenshot of an error, and a page before that?

Initially I had all modules enable, but have now reduced it down to:

But I still get the same results regardless.

(post split as I can only post one image at a time…)

There are actually two toast errors that I get, the first disappears very quickly to be followed by the second:

This is the second error:

Notice that in the Manage Folders list it can see the mail file, but just doesn’t display:

Switching to Framed theme and everything works (redacted, obvs):

HTH.

Can you also show screenshots of “Webmin ⇾ Usermin Configuration: Usermin Module Configuration / Read Mail” page?

I had the same issue and the fix was to configure the inbox folder to the users home directory rather than /var/spool/mail/<username> so I guess as it works with the old theme there might be a bug in authentic

How and why did you configure it to /var/spool/mail in the first place?

As requested.

Note that my mail directory is also set to /var/spool/mail because that’s where the mail file was originally created in CentOS/Postfix. Everything else should be default.

I’ve tried in so many different ways, but I have no idea how to reproduce this issue.

No worries, I did think it would be difficult as I couldn’t find anything when searching for similar issues.

I may just have to roll my sleeves up and look through the code to see what’s going on, and the difference between the two themes to try and figure it out!

Well, it won’t be that easy, but sure, why not.

But before that, try applying this patch and let me know if it changes anything for you.

webmin patch https://github.com/webmin/authentic-theme/commit/d514b74

and then

cp -fv /usr/libexec/webmin/authentic-theme/extensions/mail/{folders.cgi,message.cgi,messages.cgi} \
       /usr/libexec/usermin/authentic-theme/extensions/mail/
systemctl restart webmin usermin

And, also apply one more patch in similar way:

webmin patch https://github.com/webmin/authentic-theme/commit/e188e00

and then

cp -fv /usr/libexec/webmin/authentic-theme/extensions/mail/{folders.cgi,message.cgi,messages.cgi,mail-lib.pl,search.cgi} \
       /usr/libexec/usermin/authentic-theme/extensions/mail/
systemctl restart webmin usermin

Does it work for you now?