Perl error with Usermin, brand new install on Ubuntu

Today I installed a fresh copy of Ubuntu 8.04 server. After I installed openssh and then the Virtualmin install script. Everything seems perfect, except I get a big error when trying to access Mail at https://ip:20000/

Error - Perl execution failed
Can’t use an undefined value as a symbol reference at /usr/share/usermin/mailbox/folders-lib.pl line 1981, line 2.

I can still click the Usermin link and see that stuff, then when I click Mail at the top I get the error again.

Lines 1981 and the line above and below:
elsif ($c) {
print $h “$id $c\r\n”;
print DEBUG “imap command $id $c\n”;

Fixed. For some reason on virtual host creation, Virtualmin decided not to create a Maildir folder. I created this and chowned it to the user and things are great now.

So, there’s actually a couple of things going on here.

First, you should never see a Perl error. Ever. When you see one, it’s a bug and should be filed in the ticket tracker.

Second, Usermin, in a default Virtualmin install.sh created configuration ought to be reading mail via Dovecot, and not hitting files directly. I’m not sure if this error indicates reading the file directly…but it’s probably worth checking. Look in Webmin>Usermin Configuration>Usermin Module Configuration>Read Mail

What’s in the field labeled “Mail storage format for Inbox”?

Hi,

This appears likely to not be a direct issue in Virtualmin, more just an exception not caught,

I haven’t had this issue with virtualmin, but based on experience with Dovecot I can state that the Maildir folder often won’t be created until a message is received, not sure if this is intentional or a Dovecot bug, but the problem more seems to revolve around this.

For Virtualmin/Usermin it would seem a simple if(-e $HOME/Maildir ) check would suffice, and notify the user that the mailbox is empty if found not to exist, bit of a hack but should catch the issue

edit: actually joe this has brought something to mind for me, would it be possible to have a “dev” flag or similar in virtualmin to feed back the raw error to screen with virtualmin, as I often find it quite frustrating when the raw error is neither displayed or logged, would simplify plugin/module dev as well

I haven’t had this issue with virtualmin, but based on experience with Dovecot I can state that the Maildir folder often won’t be created until a message is received, not sure if this is intentional or a Dovecot bug, but the problem more seems to revolve around this.

It is intentional. Dovecot doesn’t create mailboxes (if it did, it would be just as likely to be masking problems in the delivery stack). It merely picks up mail from mailboxes that are pre-existing, and creates folders when asked to do so by the user. It definitely does not create the inbox or Maildir.

And, the delivery stack (procmail, by default) doesn’t know it needs to create a new mail box until it actually goes to make the delivery.

Again, I’d like to know how your Usermin is configured. The error you saw shouldn’t happen. And, I don’t think it can happen if you’re using it in the default way we install it in our install script (but Usermin supports many modes of operation, including reading files directly). No matter what, seeing a Perl error is always a bug and should be filed in the bug tracker so Jamie can get it fixed.

would it be possible to have a “dev” flag or similar in virtualmin to feed back the raw error to screen with virtualmin, as I often find it quite frustrating when the raw error is neither displayed or logged, would simplify plugin/module dev as well

Already in there:

Webmin>Webmin>Webmin Configuration>Advanced Options>Show stack trace for error messages?