IMAP folder moved -> unable to re-subscribe

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
User avatar
Acrolyte
Normal user
Normal user
Posts: 84
Joined: 2007-11-26 14:17
Location: GER

IMAP folder moved -> unable to re-subscribe

Post by Acrolyte » 2009-11-19 14:10

Aloha!

I have a new problem with one of my clients. He moved one of his folders (I name it "myfolder" in this thread) which contains several subfolders directly to the INBOX. As my client stated Thunderbird (2.0.0.23) came up with an error message he couldn't remember... OK, so far for the brain.exe...

He closed TB and opened it again. As a result of this movement TB states "Folder could not be found" when the client tries to access "myfolder" in it's old directory structure.

I took a look on his subscriptions in TB and found "myfolder" in the top-level structure of INBOX. It also lists all subfolders of "myfolder". When I subscribe to this folder including the subfolders it only displays "myfolder" but with nothing in it.

It looks like this inside TB:

<account.name>

<inbox>

[+]<folder1>
[+]<folder2>
[+]<folder3>
[ ]<myfolder>
[+]<...>

<trash>

So the big question: how can I gain access to the subfolders or the content of "myfolder" again?

Thx in advance for any help.

Greetz

8) Acro

westdam
Senior user
Senior user
Posts: 728
Joined: 2006-08-01 21:24
Location: Padova, Italy
Contact:

Re: IMAP folder moved -> unable to re-subscribe

Post by westdam » 2009-11-19 15:04

i think he have lost the folder, maybe was safer moving first the subfolder and then the root folder..

User avatar
Acrolyte
Normal user
Normal user
Posts: 84
Joined: 2007-11-26 14:17
Location: GER

Re: IMAP folder moved -> unable to re-subscribe

Post by Acrolyte » 2009-11-19 15:51

Uh, ok... So in the case of loss: how can it be restored? I have 2 methods of daily backups:

- Acronis Image of both SQL & hMailServer
- shadow copy function enabled

:shock: :shock:

westdam
Senior user
Senior user
Posts: 728
Joined: 2006-08-01 21:24
Location: Padova, Italy
Contact:

Re: IMAP folder moved -> unable to re-subscribe

Post by westdam » 2009-11-19 16:34

unfortunately even if you restore data from backup , hmailserver do not restore imap folder.
all the email goes into inbox..

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: IMAP folder moved -> unable to re-subscribe

Post by martin » 2009-11-19 17:57

westdam,
What do you mean hMailServer do not restoer IMAP folder? That doesn't make any sense. If he has an Acronis Image on both SQL and hMailServer, how would the IMAP folders *not* be restored if he restored that? The folder information is stored in the database. Any backup which contains the database can contain message lists.

acrolyte,
This is of tricky, but it's very unlikely that the messages are lost, even if you don't want to restore a backup. What version of hMailServer are you using?
The problem is most likely that the folder structure information in the database has become corrupt. The folders are stored within the hm_imapfolders table. Each folder has a folderparentid column which points at the parent folder. When you access the account, hMailServer builds a list of all folders by going through every row in this table which is connected to the account (using the folderaccountid column). The problem is most likely that one folder has an invalid value in the folderparentid column. :-\ The place to start would be to check what IMAP folders are connected to this specific account by issuing

Code: Select all

select accountid from hm_accounts where accountaddress = 'address@example.com'
select * from hm_imapfolders where folderaccountid = <account-id-from-last-query>

westdam
Senior user
Senior user
Posts: 728
Joined: 2006-08-01 21:24
Location: Padova, Italy
Contact:

Re: IMAP folder moved -> unable to re-subscribe

Post by westdam » 2009-11-20 09:57

sorry, havent seen the acronis backup, just shadow copy. I believe he hasnt the DB.

User avatar
Acrolyte
Normal user
Normal user
Posts: 84
Joined: 2007-11-26 14:17
Location: GER

Re: IMAP folder moved -> unable to re-subscribe

Post by Acrolyte » 2009-11-20 11:46

westdam wrote:I believe he hasnt the DB.
@westdam: :?: Why shouldn't I have the DB (backed up?) when I quoted this before? Both SQL and hMS are backed up every night in an Acronis image... In addition to this I use the shadow copy functions of W2003, which are usefull but no real backup strategy (what's not the point).

@martin: I use hMailServer-5.2-B356 with MySQL 5.1.34. I'll run the commands/queries on the server and will keep you informed about the results :lol:

User avatar
Acrolyte
Normal user
Normal user
Posts: 84
Joined: 2007-11-26 14:17
Location: GER

Re: IMAP folder moved -> unable to re-subscribe

Post by Acrolyte » 2009-11-21 16:15

@ martin:

Short question for the query syntax: <account-id-from-last-query> = which format? I found the account id ("23").

Should it be:
select * from hm_imapfolders where folderaccountid = '23'
:?:

Greetz

Acro

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: IMAP folder moved -> unable to re-subscribe

Post by ^DooM^ » 2009-11-21 16:18

correct but add a ; at the end
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

User avatar
Acrolyte
Normal user
Normal user
Posts: 84
Joined: 2007-11-26 14:17
Location: GER

Re: IMAP folder moved -> unable to re-subscribe

Post by Acrolyte » 2009-11-22 19:41

Hm...

While diggin' through the SQL data I also tried to re-access the mentioned folders et voila: everything was right there and accessible including the messages... :? :?:

I didn't change anything in the SQL table nor did I change anything in the client's TB settings... hMS and MySQL were stopped three times for backups... That was all. Really strange.

Perhaps I should stick to M$ Exchange? :lol: :lol: :lol: Muhaha, just kiddin' (there's nothing else I hate more like Exchange or SBS from M$).

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: IMAP folder moved -> unable to re-subscribe

Post by martin » 2009-11-22 19:42

Did you restart the hMailServer service after the problem had started to occur? If so, did it still not work afterwards?

I understand that it works now, I just wonder whether one restart of the service would have been enough. That would indicate that somehow the cache of IMAP folders became invalid.

User avatar
Acrolyte
Normal user
Normal user
Posts: 84
Joined: 2007-11-26 14:17
Location: GER

Re: IMAP folder moved -> unable to re-subscribe

Post by Acrolyte » 2009-11-22 19:52

After the first phone call of my client I manually restarted both hMS and MySQL. I also rebooted the client's workstation with no positive effects. So since the first problem report of my client and the "working again" scenario hMS & SQL were restarted for a total of 4 times.

User avatar
Acrolyte
Normal user
Normal user
Posts: 84
Joined: 2007-11-26 14:17
Location: GER

Re: IMAP folder moved -> unable to re-subscribe

Post by Acrolyte » 2009-11-26 11:35

The error occurred once more. This time my client simply renamed the folder. For a quick "repair" I had to kill Thunderbird's Application Data folder and re-added his IMAP account in TB. After this the renamed IMAP folder and it's subfolders were accessible again.

Is this a pure fault of TB? Can it be prevented by changing any settings inside TB or it's about:config?

Greetz 8)

Acro

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Re: IMAP folder moved -> unable to re-subscribe

Post by martin » 2009-11-26 19:46

I have found and reported a very similar error here:
http://www.hmailserver.com/devnet/?page ... ssueid=274
I found it just yesterday. I don't think this is the cause of your problem though. The problem I've reported above doesn't solve itself by recreating Thunderbirds application data folder.

If your problem is solved if you "kill Thunderbird's Application Data folder and re-added his IMAP account in TB", it really sounds like a Thunderbird bug. Have you checked the IMAP Thunderbird logs to see what happens when Thunderbird fails to access the folder?

Post Reply