IMAP subscriptions are deleted

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
prisma
Senior user
Senior user
Posts: 309
Joined: 2010-07-09 13:16

IMAP subscriptions are deleted

Post by prisma » 2010-08-06 17:55

We are using one info@ account simultaneously with 4 mailclients (Thunderbird).
It happened 2 times in 3 weeks that one morning all subscribed IMAP-folders have been un-subscribed at all 4 Mailclients. Only INBOX and trash have been left. After re-subscription everything is fine for some days.

I'm not proficient in IMAP-protocol. Is it technical possible that hMailServer sends a command that resets any subscription? Or a other malfunction that resets the subscriptions? What else could cause this phenomenon? For what to search in logfiles?

User avatar
Caspar
Senior user
Senior user
Posts: 377
Joined: 2008-09-08 11:47
Contact:

Re: IMAP subscriptions are deleted

Post by Caspar » 2010-08-06 18:29

can you post the logs here (after filtering out anything that you don't want us to read) as an atachement, so we can look what happens in the logs?
If you have strange problems or errors use the log analyzer! http://log.damnation.org.uk
Join us on IRC! http://hmailserver.com/irc_fullscreen.php

prisma
Senior user
Senior user
Posts: 309
Joined: 2010-07-09 13:16

found that error-log entry from a day before

Post by prisma » 2010-08-09 13:47

IMAP logging was disabled, because of the huge mass of accumulated logging data. For the next time it is now enabled. I only found following error log. But it is from the day/night before every IMAP subscription was deleted at the client side. So it is less supposable that it stands in direct connection with the effect. On the other hand, the last time it happened I believe to remember that there was a similar error. What are these SQL-Statements for?

Code: Select all

"ERROR"	208	"2010-08-04 04:06:28.532"	"Severity: 2 (High), Code: HM5032, Source: DALConnection::Execute, Description: Source: SQLCEConnection::Execute(), Code: HM10044, Description: Error while executing SQL statement: 
delete from hm_securityranges where rangeexpires = 1 AND rangeexpirestime < '2010-08-04 04:06:28'
Microsoft SQL Server Compact OLE DB Provider
"
"ERROR"	388	"2010-08-04 04:06:43.985"	"Severity: 2 (High), Code: HM5033, Source: DALRecordset::Open, Description: Source: SQLCEConnection::Execute, Code: HM10046, Description: Unknown error when executing SQL statement. 
SELECT  TOP (25000)  *  FROM hm_messages WHERE messagetype = 2 AND NOT EXISTS (SELECT metadata_messageid FROM hm_message_metadata WHERE hm_messages.messagetype = 2 and hm_messages.messageid = hm_message_metadata.metadata_messageid)
Microsoft SQL Server Compact OLE DB Provider
"
It must have something to do with the circumstance that the mailserver is a VM, running on a Server, that has restarted after updates at 4.00. So maybe it is a shutdown/restart problem of the whole VM. For this reason I configured now the Hmailserver-service for delayed start (so I don't have to configure dependencies).

Anyway, does anybody now what are these SQL-Statements for?

User avatar
dzekas
Senior user
Senior user
Posts: 2486
Joined: 2005-10-13 21:28
Location: Lithuania

Re: found that error-log entry from a day before

Post by dzekas » 2010-08-09 16:13

prisma wrote:IMAP logging was disabled, because of the huge mass of accumulated logging data. For the next time it is now enabled. I only found following error log. But it is from the day/night before every IMAP subscription was deleted at the client side. So it is less supposable that it stands in direct connection with the effect. On the other hand, the last time it happened I believe to remember that there was a similar error. What are these SQL-Statements for?

Code: Select all

"ERROR"	208	"2010-08-04 04:06:28.532"	"Severity: 2 (High), Code: HM5032, Source: DALConnection::Execute, Description: Source: SQLCEConnection::Execute(), Code: HM10044, Description: Error while executing SQL statement: 
delete from hm_securityranges where rangeexpires = 1 AND rangeexpirestime < '2010-08-04 04:06:28'
Microsoft SQL Server Compact OLE DB Provider
"
"ERROR"	388	"2010-08-04 04:06:43.985"	"Severity: 2 (High), Code: HM5033, Source: DALRecordset::Open, Description: Source: SQLCEConnection::Execute, Code: HM10046, Description: Unknown error when executing SQL statement. 
SELECT  TOP (25000)  *  FROM hm_messages WHERE messagetype = 2 AND NOT EXISTS (SELECT metadata_messageid FROM hm_message_metadata WHERE hm_messages.messagetype = 2 and hm_messages.messageid = hm_message_metadata.metadata_messageid)
Microsoft SQL Server Compact OLE DB Provider
"
It must have something to do with the circumstance that the mailserver is a VM, running on a Server, that has restarted after updates at 4.00. So maybe it is a shutdown/restart problem of the whole VM. For this reason I configured now the Hmailserver-service for delayed start (so I don't have to configure dependencies).

Anyway, does anybody now what are these SQL-Statements for?
These messages are not related to folder subscriptions. Although errors indicate some serious issues with your database. Maybe database is corrupted.

IMAP protocol does not have commands that reset folder subscriptions on clients. Subscriptions can be lost only when server loses folder subscription information (DB corruption in hMailServer) or some user (PEBCAK or Beavis/Cartman type) unsubscribes all folders.

prisma
Senior user
Senior user
Posts: 309
Joined: 2010-07-09 13:16

THANK YOU, the first hint!

Post by prisma » 2010-08-09 17:05

These messages are not related to folder subscriptions. Although errors indicate some serious issues with your database. Maybe database is corrupted
Yes maybe. But to be more explicit: The database- and datafolder resides an a CIFS share. Maybe the database-error could be related with the impossibility to connect to that share at service startup. Is it possible to determine when this database-error occurs? Startup?
In the meantime I defined a delayed start for the service AND (to be sure) now also the dependencies of LanManWorkstation and SamSs.
IMAP protocol does not have commands that reset folder subscriptions on clients.
Important information, thank you!
Subscriptions can be lost only when server loses folder subscription information (DB corruption in hMailServer)
Possible, see above. Restarted service, no DBerror at the moment. Must have been temporary malfunctioning. How to ceck database integrity to be sure?
I'm using build in MSSQL, no client-server-scenario.
or some user (PEBCAK or Beavis/Cartman type) unsubscribes all folders.
No, 4 email-clients+Webmail have been loosing their subcripted folders at the same time. Other singularly used accounts have not been affected by this effect. PEBCAK or Beavis/Cartman type??

User avatar
dzekas
Senior user
Senior user
Posts: 2486
Joined: 2005-10-13 21:28
Location: Lithuania

Re: THANK YOU, the first hint!

Post by dzekas » 2010-08-09 17:17

prisma wrote:PEBCAK or Beavis/Cartman type??
Problem exists between chair and keyboard or some idiocy or malice. You said that you use one mailbox in four email clients. Subscription information is stored on server. If one client unsubscribes folder, all four clients are unsubscribed.
prisma wrote:
Subscriptions can be lost only when server loses folder subscription information (DB corruption in hMailServer)
Possible, see above. Restarted service, no DBerror at the moment. Must have been temporary malfunctioning. How to ceck database integrity to be sure?
I'm using build in MSSQL, no client-server-scenario.
Maybe you can do that in http://www.hmailserver.com/documentatio ... t_to_mssql
Last edited by dzekas on 2010-08-09 17:27, edited 1 time in total.

prisma
Senior user
Senior user
Posts: 309
Joined: 2010-07-09 13:16

Re: IMAP subscriptions are deleted

Post by prisma » 2010-08-09 17:26

:lol: Understand... Working in support is a hard thing...

To short up questions and context:
  • * Is it possible to determine when (where in the code) the database-error seen above occurs?
    (* How to ceck build in MSSQL database integrity?)

Bill48105
Developer
Developer
Posts: 6189
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: IMAP subscriptions are deleted

Post by Bill48105 » 2010-08-09 19:10

1. Odds are the SQL query could be found in the source for the version you are using. Martin would need to be the one to check though.
2. http://www.hmailserver.com/documentatio ... t_to_mssql
(Once you follow those steps you'll have some tools on Start menu)
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

prisma
Senior user
Senior user
Posts: 309
Joined: 2010-07-09 13:16

Re: IMAP subscriptions are deleted

Post by prisma » 2010-08-10 11:49

I repaired the databasefile, but I think it was OK. The Log shows only this:

Code: Select all

Source      : D:\Users\Optik\Desktop\hMailServer.sdf
Destination : D:\Users\Optik\Desktop\hMailServer.sdf.B4E412B.tmp
Repairing - verMajor: 3, verMinor: 5, verBuild: 5386, verPoint: 0
Time - 2010-10-08 11:22:58.321
I'd say, this database has not been corrupt. Would be nice if somebody could copy my estimation.
Problem exists between chair and keyboard or some idiocy or malice. You said that you use one mailbox in four email clients. Subscription information is stored on server. If one client unsubscribes folder, all four clients are unsubscribed.
@dzekas: Connected with SQL Server Management Studio I saw a table storing Imap subscriptions. You're right, maybe the problem really existed only between chair and keyboard. Or, it's possible that somebody has connected to hMailServer with an old Client. I remember, Outlook Express breaks some RFCs, doesn't it? There have been also some new additional folders after this artefact. The most supposable is, that an old client connected the first time to this account, made his folders and droped in relation with this process the subscriptions.

THANK YOU ALL. If it should happen again, and if my estimation is no more matching that time, I'd continue this thread.
BYE!!

prisma
Senior user
Senior user
Posts: 309
Joined: 2010-07-09 13:16

Re: IMAP subscriptions are deleted

Post by prisma » 2010-08-18 22:36

... have to bring up this thread for a short feedback:

To make clear what happened, it's important to know that hmailserver was running in a VM, which was running herself on a fileserver that hosted hmails database and datafolder. Don't ask why. If you'd know our requirements, you would do it the same way.

The database error above was caused be the fact, that the fileserver restarted after update in the night, but he was not able to shut down early enough the VM with hmailserver. So the service continued working, while the UNC-path with database and datafolder wasn't accessible any more. VERY SPECIAL!!

Solution: Triggering a task on the fileserver by protocol SYSTEM, source USER32, eventID 1074 (=shutdown) executing:

Code: Select all

winRM -r:MAILSERVER net stop hMailServer
JESUS CHRIST!! (...and of course this had nothing to do with the deleted IMAP subscritions...)

Bill48105
Developer
Developer
Posts: 6189
Joined: 2010-04-24 23:16
Location: Michigan, USA

Re: IMAP subscriptions are deleted

Post by Bill48105 » 2010-08-18 23:00

LMAO! Glad you figured it out. My money is on had any of us suspected your setup alarm bells would have been ringing. hehe
Bill
hMailServer build LIVE on my servers: 5.4-B2014050402
#hmailserver on FreeNode IRC https://webchat.freenode.net/?channels=#hmailserver
*** ABSENT FROM hMail! Those in IRC know how to find me if urgent. ***

Post Reply