Read user email module bug

Getting this from a clients CentOS 5.8 server

sdbm store returned -1, errno 9, key "lastchange" at /usr/libexec/webmin/mailboxes/boxes-lib.pl line 335

Status: 
Closed (fixed)

Comments

Looks like a DBM corruption problem, or perhaps a lack of quota.

Is the user or domain you are reading mail for low on quota?

Actually this a 2 fold problem. I got a new client that did the worse possible thing.

He first had sendmail installed on his server and at some point he installed VM GPL and to complicate it even more he switched to postfix in mid stride messing up the read user mail module, VM and UM.

UM can't get any emails either by imap or pop3 "An error occurred listing mail in this folder : Failed to login to POP3 server : Internal error occurred. Refer to server log for more information"

VM is showing the old mbox path under the edit users section.

I don't know how to fix this one at all.

Yeah, switching from Sendmail to Postfix can complicate things.

I have a few questions regarding your setup there --

  1. Can you verify that the user in question that's getting the "sdbm store returned -1, errno 9" error is not over their quota?

  2. Usermin is referencing an error in the mail logs, that may assist in diagnosing the issue. What error shows up in the mail logs when you get the error "An error occurred listing mail in this folder : Failed to login to POP3 server"?

  3. Lastly, what path is the mail path that you're seeing in Edit Users? You mentioned that it's the old mbox path, what's an example of what that looks like? And can you confirm that email is no longer going to that mbox path, but that it's instead being delivered to the Maildir directory that's normally used in a Virtualmin setup?

Thanks!

  1. No quota set for anyone

  2. I figured that one out -- someone tried to fix the problems using copy-mailbox and did it wrong

  3. Inbox mail file /var/mail/username

For instance the edit user shows:

Inbox mail file /var/mail/stu.igloowebdesigners

When it should be

/home/igloowebdesigners/homes/stu/Maildir/

I've asked Jamie for some additional input on where Virtualmin gets that Inbox mail file location... he should be able to shed some light there.

However, in the meantime, we may want to verify two things.

Can you paste in the contents of the /etc/procmailrc file?

Also, what does this command output:

find /etc/dovecot | xargs grep mail_location

Thanks!

[root@ns59 home]# cat /etc/procmailrc
LOGFILE=/var/log/procmail.log
TRAP=/etc/webmin/virtual-server/procmail-logger.pl
:0wi
VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME
EXITCODE=$?
:0
* ?/usr/bin/test "$EXITCODE" = "73"
/dev/null
EXITCODE=0
:0
* ?/usr/bin/test "$VIRTUALMIN" != ""
{
INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN
}
DEFAULT=/var/mail/$LOGNAME
ORGMAIL=/var/mail/$LOGNAME
DROPPRIVS=yes

mail_location = maildir:~/Maildir

Ah, that looks like the issue there. In the procmailrc file, it looks like the "DEFAULT" and "ORGMAIL" options had modified to point to /var/mail.

That means that right now, all email being delivered would be delivered to an mbox file within /var/mail.

However, Dovecot is configured to look for Maildir directories in the user's homedir.

To reconfigure procmail to deliver email to the Maildir directory within the user's homedir, you'd need to change these two lines:

DEFAULT=/var/mail/$LOGNAME
ORGMAIL=/var/mail/$LOGNAME

To read as follows:

ORGMAIL=$HOME/Maildir/
DEFAULT=$HOME/Maildir/

now thats weird.... I changed that yesterday to the right lines now how could that have changed ?

something is changing that info -- i made the change and looked 2 seconds later and it was reverted so I chattr +i the file but I need to find out what is changing it

Okay, Jamie did some digging, and did see some possible causes of that.

If you go into Webmin -> Servers -> Read User Mail -> Module Config -> System Configuration, what is "Detect location of mail files automatically" set to?

Also, what is the output of the command "postconf -n" (and in particular, I'm interested in seeing how home_mailbox and mail_spool_directory are set)?

Detect location of mail files automatically? Yes, based on mail server

home_mailbox = Maildir/

mail_spool_directory is commented out

Yeah, having the "Detect location of mail files automatically" option set the way you do should be what you want.

And it sounds like Postfix is also setup correctly.

Can you verify that it's using the Postfix config? You can do that by looking at the "Mail server installed" option on the top of the screen in Webmin -> Servers -> Read User Mail -> Module Config -> System Configuration, and making sure that's set to "Postfix".

Also, could you paste in the output of the command "postconf -n"?

[root@ns59 mail]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
disable_vrfy_command = yes
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
local_recipient_maps = $alias_maps, unix:passwd.byname
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
mailbox_size_limit = 0
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
milter_default_action = accept
mydestination = $myhostname, localhost.$mydomain, $mydomain
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
non_smtpd_milters = inet:localhost:8891
readme_directory = no
recipient_delimiter = +
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sender_bcc_maps = hash:/etc/postfix/bcc
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_delay_reject = no
smtpd_milters = inet:localhost:8891
smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination check_policy_service unix:/var/spool/postfix/postgrey/socket
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual

I'll ask Jamie if he has any other thoughts, but were you able to verify that in Webmin -> Servers -> Read User Mail -> Module Config -> System Configuration, that "Mail server installed" was set to "Postfix"?

If that were still set to Sendmail, it could cause Virtualmin to look at the wrong config.

Your Postfix config does look good though.

Yes, the Postfix config looks OK. Could you also post the contents of the /etc/webmin/mailboxes/config file on your system?

hmm everything seems to be working now - closing ticket