1 (edited by OviVan 2011-11-18 07:29:43)

Topic: user suddenly gone from iRedMail

==== Provide basic information to help troubleshoot ====
- iRedMail version: 0.7.3
- iRedAdminPro-MYSQL: 1.3.0
- Linux/BSD distribution: CentOS 6 64Bit
- Any related log? not sure which log is needed in this case

Hello Zhang,

I noticed one very strange and wired thing now. I installed the fresh CentOS 6 64 Bit and than I successfully installed the iRedMail 0.7.3 and than iRedAdmin-MYSQL 1.3.0 everything with a setup was just fine.

Than I created email domains, users, aliases manually, no restore from old server.

After that I restored the emails and folders for only ONE user to test the system before I migrate the rest.
and guess what ? after the server was up and running around one hour, I tested this user with migrated emails, I sent couple emails to this user from gmail, hotmail etc... and he received all of the emails, and this user was also able to send the emails as well everything was fine... the user is also able to see all of his migrated emails and folders from old server...

And after one hour, this user called me on the phone and told me that he is no able to log-on to Roundcube (webmail)
than I opened (iRedAdmin) and clicked on the domain name for this user to try to reset the password, but guess what ?
the user was gone from iRedAdmin, I was not able to see him anymore in the iRedAdmin...

than I checked the /var/vmail/vmail1/ and all the files and folders was there.... but user does not exist in the iRedAdmin...

I am not sure which log You need to find out about this, but since this server is not in the production yet, I can give You the access if You will take a look on it self ?

this is very strange because only this user was gone, could it be some problems during mail migration ?

I migrated the emails on the following way:
1. packed the whole domain_name_folder in TAR
2. copied the tar file on the new server
3. extracted the TAR file
4. configured the permissions :

chown -R vmail:vmail /var/vmail/vmail1/domain_name/
chmod -R 0700 /var/vmail/vmail1/domain_name/

5. logged in via RoundCube Webmail and I saw all of the emails and folders, everything was just fine...

but as I mentioned above this user was gone from iRedAdmin after one hour ... while all of others users remained on the server... I am just thinking could the migration process affect this ? because all other users are still on the server and I have not migrated their mailboxes, so only this user which is gone have its mail box migrated...

I hope You can find out about this before I migrate the rest of the users...

PS: I am manually creating the users in the iRedAdmin and migrating the emails only ... just so you know..

Thank You

Best regards


Re: user suddenly gone from iRedMail

iRedMail and iRedAdmin won't delete mail accounts automatically, so here comes my questions:

- Is it possible that some other cron jobs deleted this user in that hour?
- Did someone delete this user? You can find it in iRedAdmin-Pro: System -> Admin Log.

Note: You can re-create this user with iRedAdmin-Pro, then assign the same maildir as old one, so that this user can see old mails.


Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee


Re: user suddenly gone from iRedMail

- there is no cron jobs ..
- nobody deleted this user because nobody have access to this server except me
- checked the log, and there is nothing about deletion for this user
- I already tried to re-create the user but when I did it I got the message "cannot create user, user already exist"


Re: user suddenly gone from iRedMail

Could you please paste the LDIF data of this user to help troubleshoot?

You can try getting LDIF data either way:

- Accessing httpS://your_server.com/iredadmin/export/ldif/user/username@domain.ltd
- Login to phpLDAPadmin, then export LDIF data of this account.


Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee


Re: user suddenly gone from iRedMail

just tried and I have received the message: "not found"

PS: I am using iRedAdmin-Pro-MYSQL ver...

6 (edited by OviVan 2011-11-18 23:28:09)

Re: user suddenly gone from iRedMail

very strange, the user "exist" it seems that it is only gone from the iRedAdminPro but at the same time I cannot understand if the user is not deleted why I cannot login ?

7 (edited by OviVan 2011-11-19 04:58:03)

Re: user suddenly gone from iRedMail

I did some research and here is what I have found out.

When I am logged in to IredAdmin, than I click on the link "search" and I type the username of the user which is missing from the iRedAdmin, and than iRedAdmin found this user, so I would check the path to the email folders, so I clicked on the tab "advanced" on the right side, and this is what I found.

Path to mailbox: /var/vmail   vmail1   and the last field was totally empty, so I typed the path to users mail directory
so it looks like:

Path to mailbox: /var/vmail   vmail1   domain.name/s/a/l/userName-2011.

I replaced the domain with "domain.name" and username with userName ....
than I clicked on the "save changes" and after that I should verify it again and I clicked again on the "advanced" tab
and again nothing was in the third "form field" it was empty again just as first time...

so again I saw only:

Path to mailbox: /var/vmail   vmail1

I tested with other users, removed their "mailbox" path from the third field and put it back again and everything was fine...
but this user which got his email migrated is having these issues...

again as I mentioned, this is the procedure for mail migrating I did:

1. packed user folder "Maildir" in a TAR archive
2. copied TAR file to new server, extracted it in
3. configured the permissions:

chown -R vmail:vmail /var/vmail/vmail1/domain.name/
chmod -R 0700 /var/vmail/vmail1/24sata.info/domain.name/

At the end I tried again search for this user and when I found him, I deleted the user.
Then when I tried to re-create this user the iRedAdmin says "there is already an user with this email address"


Re: user suddenly gone from iRedMail

new update, now I have deleted whole domain name where this user was created and all of his email folders etc.. removed the entire domain from the server..

than I created the domain again and created this user, migrated his mailbox again, and now it`s working but I will follow up how long it will work before it is gone from the iRedAdmin again.. will let you know... I have noticed the time ... when I recreated entire domain name in case we should look in the log files..


Re: user suddenly gone from iRedMail

Still no idea why it happened. sorry sad


Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee


Re: user suddenly gone from iRedMail

perhaps stupid question but I have to ask, could the problem be if the new server have new system "domain" name which is different from the old one ?

I am asking this because all of the emails files which are migrated they contain the domain name of the old server in their "files"

wired because all of other users are there except the one I migrated emails for...


Re: user suddenly gone from iRedMail

The key point is, MySQL record was changed. It doesn't relate to other operations.


Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

12 (edited by OviVan 2011-11-22 01:52:36)

Re: user suddenly gone from iRedMail

now I found out why this user is loosing his email path in the iRedAdminPro and "being gone as user" from iRedAdminPro.
but don`t know how to fix this as I am 100% sure that this is a bug..

it happens only when user log on to RoundCube webmail and clicks on the "trash" link to delete the emails from trash, and user select all of the emails and delete them, than he clicks on the "REFRESH" button to refresh the "unread number of the trashed messages" to clear unread messages number... and once he clicks on REFRESH buttons he gets the "imap error connection" message and being logged off from the roundcube webmail... than when I open the iRedAdminPro I see that users path to the mailbox is gone ... empty field... I see only: /var/vmail   vmail1 and third field is just empty and if I try to add the path again and save nothing happens... it`s still empty...

this has to be a bug... and this happens ONLY to the user which I have migrated emails from old server...
other users are just fine they can empty-delete all of the emails from the "trash" and click on the REFRESH button while located on the "trash" and nothing happens it works just fine...

any idea ? do You need some pictures as a screen-shoot ??

PS: in short words user is being gone from iRedAdminPro and looses his mail path in the iRedAdmin pro ONLY when he clicks on the "refresh" button while located in the "trash" in the webmail, is You are on the inbox than You can refresh as many times as You just want and it will work... but if You are located in the "trash" and hits the REFRESH button than You will be logged off and Your mail path reference is gone in the iRedAdminPro...

13 (edited by OviVan 2011-11-22 03:56:42)

Re: user suddenly gone from iRedMail

I have recorded a video (live screen shoot) and I can send you the link via email if it`s ok for You ?


Re: user suddenly gone from iRedMail

Hi OviVan, please mail me the link of video, thanks.


Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee


Re: user suddenly gone from iRedMail

mail sent !
thank You very much!


Re: user suddenly gone from iRedMail

Problem solved. Thanks very much for Amel (@OviVan)'s help. Your video is really impressive, it helps a lot for me to understand what the problem is. Thanks for providing me a testing server to reproduce this issue and debug.

Here's the root cause and how to solve/avoid similar issue:

Why it happened

Dovecot will update mailbox quota (with dict quota) with 2 SQL commands if there's incorrect values (e.g. empty value) of two columns in SQL database: mailbox.bytes, mailbox.messages.

- DELETE FROM mailbox WHERE username='xxx@yyy.com';
- INSERT INTO mailbox (username, bytes, messages) VALUES ('xxx@yyy.com', xx, xx);

First SQL command will delete our mail user.

How to solve/avoid similar issue

= UPDATED on Dec 08, 2011 =
To avoid similar issue, we have to store realtime mailbox quota in a seperate SQL table.
Here's steps to fix it:

- Store realtime mailbox quota usage in seperate SQL table
  http://iredmail.org/wiki/index.php?titl … _SQL_table

Hope it helps you understand what the problem is and how to avoid similar issue.


Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee


Re: user suddenly gone from iRedMail

You`re very welcome Zhang, that`s why we are here wink
I am impressed that you found a solution for this issue in no time !

I will test the fix and will let You know!

Thank You very much for helping again and thank You for very quick responses on the email !!