POP3 mailbox locked forever - need manual unlock

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
arkypita
New user
New user
Posts: 23
Joined: 2011-08-26 10:59

POP3 mailbox locked forever - need manual unlock

Post by arkypita » 2012-03-06 13:43

Dear developer
My setup is hMailServer 5.3.3 B1879 (last stable version).
I have some users using IMAP and some other users using POP3. Totally about 20 users.

Is all fine for most of them. Only one user is calling me about one time at month (this is the fourth) because he is experiencing "MAILBOX ALREADY LOCKED" problem. He is using only one client (outlook express on windows XP) on a desktop PC. No mobile phone or tablet.

Sometime it's mailbox will lock and there is no way to unlock, neither waiting one day without trying access.

Looking at log that's what I see:

Code: Select all

------------------------  01/03/2012  ------------------------

Some other POP3 session from same IP, relater to other family user account (no problem)

Session: 22057
"POP3D" 1852 22057 "2012-03-01 09:24:14.081" "87.4.**.**" "SENT: +OK POP3"
"POP3D" 1852 22057 "2012-03-01 09:24:14.237" "87.4.**.**" "RECEIVED: USER theuser@myhost.com"
"POP3D" 1852 22057 "2012-03-01 09:24:14.237" "87.4.**.**" "SENT: +OK Send your password"
"POP3D" 1852 22057 "2012-03-01 09:24:14.269" "87.4.**.**" "RECEIVED: PASS ***"
"POP3D" 1852 22057 "2012-03-01 09:24:14.284" "87.4.**.**" "SENT: +OK Mailbox locked and ready"
"POP3D" 1852 22057 "2012-03-01 09:24:14.316" "87.4.**.**" "RECEIVED: STAT"
"POP3D" 1852 22057 "2012-03-01 09:24:14.316" "87.4.**.**" "SENT: +OK 6 53452"
"POP3D" 1852 22057 "2012-03-01 09:24:14.472" "87.4.**.**" "RECEIVED: LIST"
"POP3D" 1852 22057 "2012-03-01 09:24:14.472" "87.4.**.**" "SENT: +OK 6 messages (53452 octets)"
"POP3D" 1852 22057 "2012-03-01 09:24:14.472" "87.4.**.**" "SENT: 1 12248[nl]2 7326[nl]3 10069[nl]4 12529[nl]5 8888[nl]6 2392[nl]."
"POP3D" 1852 22057 "2012-03-01 09:24:14.784" "87.4.**.**" "RECEIVED: RETR 1"
"POP3D" 1852 22057 "2012-03-01 09:24:14.847" "87.4.**.**" "SENT: ."
[...]
"POP3D" 1852 22057 "2012-03-01 09:24:16.706" "87.4.**.**" "RECEIVED: DELE 6"
"POP3D" 1852 22057 "2012-03-01 09:24:16.706" "87.4.**.**" "SENT: +OK msg deleted"
"POP3D" 1852 22057 "2012-03-01 09:24:16.784" "87.4.**.**" "RECEIVED: QUIT"
"POP3D" 1852 22057 "2012-03-01 09:24:16.831" "87.4.**.**" "SENT: +OK POP3 server saying goodbye..."

Session: 22064
"POP3D" 1852 22064 "2012-03-01 09:25:13.566" "87.4.**.**" "SENT: +OK POP3"
"POP3D" 1852 22064 "2012-03-01 09:25:13.597" "87.4.**.**" "RECEIVED: USER theuser@myhost.com"
"POP3D" 1852 22064 "2012-03-01 09:25:13.597" "87.4.**.**" "SENT: +OK Send your password"
"POP3D" 1852 22064 "2012-03-01 09:25:13.628" "87.4.**.**" "RECEIVED: PASS ***"
"POP3D" 1852 22064 "2012-03-01 09:25:13.628" "87.4.**.**" "SENT: +OK Mailbox locked and ready"
"POP3D" 1852 22064 "2012-03-01 09:25:13.675" "87.4.**.**" "RECEIVED: STAT"
"POP3D" 1852 22064 "2012-03-01 09:25:13.675" "87.4.**.**" "SENT: +OK 0 0"
"POP3D" 1852 22064 "2012-03-01 09:25:13.706" "87.4.**.**" "RECEIVED: QUIT"
"POP3D" 1852 22064 "2012-03-01 09:25:13.706" "87.4.**.**" "SENT: +OK POP3 server saying goodbye..."

Some other POP3 session from same IP, relater to other family user account (no problem)

Session: 22096
"POP3D" 1852 22096 "2012-03-01 09:43:25.878" "87.4.**.**" "SENT: +OK POP3"
"POP3D" 1852 22096 "2012-03-01 09:43:25.909" "87.4.**.**" "RECEIVED: USER theuser@myhost.com"
"POP3D" 1852 22096 "2012-03-01 09:43:25.909" "87.4.**.**" "SENT: +OK Send your password"
"POP3D" 444 22096 "2012-03-01 09:43:25.941" "87.4.**.**" "RECEIVED: PASS ***"
"POP3D" 444 22096 "2012-03-01 09:43:25.956" "87.4.**.**" "SENT: +OK Mailbox locked and ready"
"POP3D" 444 22096 "2012-03-01 09:43:25.987" "87.4.**.**" "RECEIVED: STAT"
"POP3D" 444 22096 "2012-03-01 09:43:25.987" "87.4.**.**" "SENT: +OK 1 9203"
"POP3D" 444 22096 "2012-03-01 09:43:26.019" "87.4.**.**" "RECEIVED: LIST"
"POP3D" 444 22096 "2012-03-01 09:43:26.019" "87.4.**.**" "SENT: +OK 1 messages (9203 octets)"
"POP3D" 444 22096 "2012-03-01 09:43:26.019" "87.4.**.**" "SENT: 1 9203[nl]."
"POP3D" 444 22096 "2012-03-01 09:43:26.269" "87.4.**.**" "RECEIVED: RETR 1"
"POP3D" 444 22096 "2012-03-01 09:43:26.269" "87.4.**.**" "SENT: ."
"POP3D" 444 22096 "2012-03-01 09:43:26.409" "87.4.**.**" "RECEIVED: DELE 1"
"POP3D" 444 22096 "2012-03-01 09:43:26.409" "87.4.**.**" "SENT: +OK msg deleted"
"POP3D" 444 22096 "2012-03-01 09:43:26.441" "87.4.**.**" "RECEIVED: QUIT"
"POP3D" 444 22096 "2012-03-01 09:43:26.441" "87.4.**.**" "SENT: +OK POP3 server saying goodbye..."

Session: 22098
"POP3D" 1852 22098 "2012-03-01 09:44:11.612" "87.4.**.**" "SENT: +OK POP3"
"POP3D" 1852 22098 "2012-03-01 09:44:11.644" "87.4.**.**" "RECEIVED: USER theuser@myhost.com"
"POP3D" 1852 22098 "2012-03-01 09:44:11.644" "87.4.**.**" "SENT: +OK Send your password"
"POP3D" 1852 22098 "2012-03-01 09:44:11.675" "87.4.**.**" "RECEIVED: PASS ***"
"POP3D" 1852 22098 "2012-03-01 09:44:11.675" "87.4.**.**" "SENT: +OK Mailbox locked and ready"
"POP3D" 1852 22098 "2012-03-01 09:44:11.706" "87.4.**.**" "RECEIVED: STAT"
"POP3D" 1852 22098 "2012-03-01 09:44:11.706" "87.4.**.**" "SENT: +OK 0 0"
"POP3D" 1852 22098 "2012-03-01 09:44:11.753" "87.4.**.**" "RECEIVED: QUIT"
"POP3D" 1852 22098 "2012-03-01 09:44:11.753" "87.4.**.**" "SENT: +OK POP3 server saying goodbye..."

Some other POP3 session from same IP, relater to other family user account (no problem)

Session: 22681
"POP3D" 1852 22681 "2012-03-01 14:45:42.441" "87.4.**.**" "SENT: +OK POP3"
"POP3D" 1852 22681 "2012-03-01 14:45:42.472" "87.4.**.**" "RECEIVED: USER theuser@myhost.com"
"POP3D" 1852 22681 "2012-03-01 14:45:42.472" "87.4.**.**" "SENT: +OK Send your password"
"POP3D" 1852 22681 "2012-03-01 14:45:42.503" "87.4.**.**" "RECEIVED: PASS ***"
"POP3D" 1852 22681 "2012-03-01 14:45:42.519" "87.4.**.**" "SENT: +OK Mailbox locked and ready"
"POP3D" 1852 22681 "2012-03-01 14:45:42.550" "87.4.**.**" "RECEIVED: STAT"
"POP3D" 1852 22681 "2012-03-01 14:45:42.550" "87.4.**.**" "SENT: +OK 4 40122"
"POP3D" 1852 22681 "2012-03-01 14:45:42.581" "87.4.**.**" "RECEIVED: LIST"
"POP3D" 1852 22681 "2012-03-01 14:45:42.581" "87.4.**.**" "SENT: +OK 4 messages (40122 octets)"
"POP3D" 1852 22681 "2012-03-01 14:45:42.581" "87.4.**.**" "SENT: 1 12292[nl]2 11178[nl]3 7060[nl]4 9592[nl]."
"POP3D" 1852 22681 "2012-03-01 14:45:42.800" "87.4.**.**" "RECEIVED: RETR 1"
"POP3D" 1852 22681 "2012-03-01 14:45:42.831" "87.4.**.**" "SENT: ."
"POP3D" 1852 22681 "2012-03-01 14:45:43.003" "87.4.**.**" "RECEIVED: RETR 2"
"POP3D" 1852 22681 "2012-03-01 14:45:43.019" "87.4.**.**" "SENT: ."
"POP3D" 3356 22681 "2012-03-01 14:45:43.019" "87.4.**.**" "SENT: ."
"POP3D" 444 22681 "2012-03-01 14:45:43.394" "87.4.**.**" "RECEIVED: RETR 3"
"POP3D" 444 22681 "2012-03-01 14:45:43.394" "87.4.**.**" "SENT: ."
"POP3D" 2768 22681 "2012-03-01 14:45:43.425" "87.4.**.**" "RECEIVED: RETR 4"
"POP3D" 2768 22681 "2012-03-01 14:45:43.425" "87.4.**.**" "SENT: ."
"POP3D" 2768 22681 "2012-03-01 14:45:43.503" "87.4.**.**" "RECEIVED: DELE 1"
"POP3D" 2768 22681 "2012-03-01 14:45:43.503" "87.4.**.**" "SENT: +OK msg deleted"
"POP3D" 2768 22681 "2012-03-01 14:45:43.550" "87.4.**.**" "RECEIVED: DELE 2"
"POP3D" 2768 22681 "2012-03-01 14:45:43.550" "87.4.**.**" "SENT: +OK msg deleted"

THIS IS WHEN THE PROBLEM BEGIN!!!

Session: 22815
"POP3D" 1852 22815 "2012-03-01 16:08:16.191" "87.4.**.**" "SENT: +OK POP3"
"POP3D" 1852 22815 "2012-03-01 16:08:16.222" "87.4.**.**" "RECEIVED: USER theuser@myhost.com"
"POP3D" 1852 22815 "2012-03-01 16:08:16.222" "87.4.**.**" "SENT: +OK Send your password"
"POP3D" 1852 22815 "2012-03-01 16:08:16.269" "87.4.**.**" "RECEIVED: PASS ***"
"POP3D" 1852 22815 "2012-03-01 16:08:16.269" "87.4.**.**" "SENT: -ERR Your mailbox is already locked"

NO OTHER POP3 SESSION FOR theuser@myhost.com

Some other POP3 session from same IP, relater to other family user account (no problem)


------------------------  02/03/2012  ------------------------


Session: 23487
"POP3D" 1852 23487 "2012-03-02 00:00:47.878" "87.4.**.**" "SENT: +OK POP3"
"POP3D" 1852 23487 "2012-03-02 00:00:47.925" "87.4.**.**" "RECEIVED: USER theuser@myhost.com"
"POP3D" 1852 23487 "2012-03-02 00:00:47.925" "87.4.**.**" "SENT: +OK Send your password"
"POP3D" 1852 23487 "2012-03-02 00:00:47.956" "87.4.**.**" "RECEIVED: PASS ***"
"POP3D" 1852 23487 "2012-03-02 00:00:47.956" "87.4.**.**" "SENT: -ERR Your mailbox is already locked"

About ten attempts for theuser@myhost.com without success

------------------------  03/03/2012  ------------------------

Other attempts for theuser@myhost.com without success
The user is calling me...


So... it is evident that the problem begin with an unclean client logout (Session: 22681 does not QUIT).
But WHY hMailserver did not reset the lock automatically??? Must do it!

I search the forum for this problem. I see some similar thread in 2005, 2006, 2008 with older versions, but now in 2012 I hoped that this problem was solved.

Is there any workaround or any attempt that i can make for fix this behavior?
Pleas don't replay with "use IMAP instead of POP".

User avatar
mattg
Moderator
Moderator
Posts: 22435
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: POP3 mailbox locked forever - need manual unlock

Post by mattg » 2012-03-06 13:56

hMailserver will automatically release the lock after 30 minutes of no action. (This is not configurable.)
arkypita wrote:Only one user is calling me about one time at month (this is the fourth) because he is experiencing "MAILBOX ALREADY LOCKED" problem. He is using only one client (outlook express on windows XP) on a desktop PC. No mobile phone or tablet.
I'd be surprised.
To my knowledge this error ONLY occurs when multiple programs connect to the same account via POP3 simultaneously.

Look in the log in the minutes leading up to the error that you see.
Locking occurs by account, not by IP address.

It could have been two mail clients on same machine.
It could be two separate computers / devices on the same LAN, but they could also be on different LANs.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

arkypita
New user
New user
Posts: 23
Joined: 2011-08-26 10:59

Re: POP3 mailbox locked forever - need manual unlock

Post by arkypita » 2012-03-06 14:32

I am trying some test at the office in LAN environment using telnet. I have created a new user for testing.

Telnetting server 110 ad simulating an unclean POP3 session (exiting without QUIT) by terminate telnet client with task-manager does not deceive hMailserver and the immediately next telnet session was fine. I suppose hMailserver can recognize this situation because of a low-level tcp-ip socket disconnected message.

Instead if I drop the connection physically, disconnecting my PC network cable, the mailbox remain locked. I reconnect the cable and I try again and I perform the "mailbox already locked" message. I wait about 15 minutes and mailbox was return available. That's all fine!

But with the user i tell you, this does not happens. It's mailbox will remain locked for hours and hours (even if not stressing with frequent attempt) until i manually unlock the mailbox using administrator interface.
I am sure that no second client was involved (no webmail, no iPhone, no second PC). Maybe a second instance of outlook if previous was not really terminated?

The user has been warned that the problem may be caused by multiple clients and assured me that this is not it's situation. However the mailbox should unlock after a short time, also in double client environment!

I am recording all log even debug and TCP. Is there any diagnosis that I can make for this problem?
Now i will make the same telnet test on the real user mailbox, instead of the foo account.

Thanks a lot!
Last edited by arkypita on 2012-03-06 14:56, edited 2 times in total.

arkypita
New user
New user
Posts: 23
Joined: 2011-08-26 10:59

Re: POP3 mailbox locked forever - need manual unlock

Post by arkypita » 2012-03-06 15:09

Question: how POP3 locking is implemented on hMailserver? Locked flag is only an in-memory flag for the user account or correspond to a file in account folder, or to a flag in DB? I am asking because if I know how locking work I could make a more accurate diagnosis.


Note!
The test i made with telnet on the real user account reveal the same result: mailbox will remain locked if I drop the connection disconnecting the cable, but mailbox lock will be released in about 10 minutes (not 30 as you say).

The evidence is that all is fine! But sometime it is not.
This is the fourth time I had to proceed with a manual unlock.

User avatar
mattg
Moderator
Moderator
Posts: 22435
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: POP3 mailbox locked forever - need manual unlock

Post by mattg » 2012-03-06 16:46

mattg wrote:To my knowledge this error ONLY occurs when multiple programs connect to the same account via POP3 simultaneously.
Your logs will tell you for sure.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

arkypita
New user
New user
Posts: 23
Joined: 2011-08-26 10:59

Re: POP3 mailbox locked forever - need manual unlock

Post by arkypita » 2012-03-07 12:23

mattg wrote:
mattg wrote:To my knowledge this error ONLY occurs when multiple programs connect to the same account via POP3 simultaneously.
Your logs will tell you for sure.
I am sorry but you are in error.

The user was warned about multiple client problem, and tell me for sure that this is not it's situation.
Anyway you can check it yourself: i filter out all unrelated/uninteresting log messages and prepared an .xls file that put in evidence the problem.

http://dl.dropbox.com/u/21662123/extract.xls

The uncleaned session #22681 at 14:45 o' clock cause the mailbox remain locked. The next access attempt is more then one hour later, at 16:08, and result in "mailbox already locked" condition. Successive attempt was the next day, and again mailbox was in "mailbox already locked" status. This would append the next next day again (not reported in .xls file) and the user call me for assistance.

I'm not joking you, please stop saying obvious things and consider you have a bug on POP3 locking system.
I could give you an hand in debugging if you tell me whatever I can do.

The difficulty is that the problem is sporadic and the attempt of unclean session i made at office was correctly managed by hMailserver (lock -> 10min -> unlock) so I cannot easily reproduce that.

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

Re: POP3 mailbox locked forever - need manual unlock

Post by ^DooM^ » 2012-03-07 13:25

arkypita wrote:I'm not joking you, please stop saying obvious things and consider you have a bug on POP3 locking system.
Getting pissy with people trying to help you just makes them not want to bother helping you any more. If you want to get all pissy at someone, go pay for support as they have to listen to you, we dont, we do this for free.

Matt kindly offered you a suggestion. Now zip up unaltered logs and put them somewhere we can download them.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

User avatar
mattg
Moderator
Moderator
Posts: 22435
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: POP3 mailbox locked forever - need manual unlock

Post by mattg » 2012-03-07 14:10

arkypita wrote:The user was warned about multiple client problem, and tell me for sure that this is not it's situation.
I don't believe what users tell me unless it is corroborated by hard evidence, especially when they are denying doing something...
arkypita wrote:.. please stop saying obvious things and consider you have a bug on POP3 locking system.
I love it.

http://www.hmailserver.com/?page=statistics
Damn near 5 million emails a week, and you find a 'bug' that no-one else has seen.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

arkypita
New user
New user
Posts: 23
Joined: 2011-08-26 10:59

Re: POP3 mailbox locked forever - need manual unlock

Post by arkypita » 2012-03-07 16:35

^DooM^ wrote:
arkypita wrote:I'm not joking you, please stop saying obvious things and consider you have a bug on POP3 locking system.
Getting pissy with people trying to help you just makes them not want to bother helping you any more. If you want to get all pissy at someone, go pay for support as they have to listen to you, we dont, we do this for free.

Matt kindly offered you a suggestion. Now zip up unaltered logs and put them somewhere we can download them.

dear Doom
is not my intention make you wasting time with a problem that does not exist. Before asking your advice I checked the situation very well. In three months, fortunately and unfortunately it has happened only 4 times (always with the same user, but most of the other uses IMAP). This time, fortunately I have all the LOG.

After reading related post in this forum the first thing I indicated to the user 3 months ago is the possibility of a "race condition" with a second client. We excluded this possibility.

I am a software programmer for automation. I know that 99% of errors occur between chair and keyboard, but I know that may also exist errors in software.

My claim is due to the fact that Matt seems to negate this possibility in this case.

I would be happy to help you understand and eventually solve this problem, if you want to help me understand if the problem really exists. Yesterday and today I have "wasted" a morning of work by reading the log and trying to simulate the situation, but I was unable to replicate the issue. This means that hMailServer works well!

I just posted one. Zip with the last days of logs. For the presence of many sensitive data (email addresses, IP etc ...) I would prefer not to publish the link. tell me how I can let you have in private.

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

Re: POP3 mailbox locked forever - need manual unlock

Post by Caspar » 2012-03-07 16:48

You can do this to either join us on IRC (link is at the comunity if i'm correct) or send him a PM.
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

arkypita
New user
New user
Posts: 23
Joined: 2011-08-26 10:59

Re: POP3 mailbox locked forever - need manual unlock

Post by arkypita » 2012-03-07 16:57

Caspar wrote:You can do this to either join us on IRC (link is at the comunity if i'm correct) or send him a PM.
Thank you caspar

arkypita
New user
New user
Posts: 23
Joined: 2011-08-26 10:59

Re: POP3 mailbox locked forever - need manual unlock

Post by arkypita » 2012-03-07 17:02

mattg wrote:
arkypita wrote:The user was warned about multiple client problem, and tell me for sure that this is not it's situation.
I don't believe what users tell me unless it is corroborated by hard evidence, especially when they are denying doing something...
arkypita wrote:.. please stop saying obvious things and consider you have a bug on POP3 locking system.
I love it.

http://www.hmailserver.com/?page=statistics
Damn near 5 million emails a week, and you find a 'bug' that no-one else has seen.
Maybe this is not a bug in software.
Could be a strange combination of condition on server machine, i.e a wrong permission on filesystem or a problem on database? This is why I asked you how locking system is implemented.

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

Re: POP3 mailbox locked forever - need manual unlock

Post by Bill48105 » 2012-03-07 18:15

FYI: Newer builds of 5.4 have INI setting for POPD timeout that could be used if needed BUT understand if mailbox is staying locked you have a problem that should be fixed.. Usually it is because email client is not properly QUIT'ing or antivirus/proxy is holding it open. I also see it on some connections like cell phones speeding down the freeway or where signal is weak etc.
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. ***

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

Re: POP3 mailbox locked forever - need manual unlock

Post by Bill48105 » 2012-03-07 19:01

Looked at the code & it appears there is a chance it is a bug in hmail.. I didn't spent much time on it but quite glance looks as though hmail never unlocks a box after timeout which would be bad. I'd need to test here to confirm. I made a change to the source here but untested. arkypita, you willing to test it?
Thx
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. ***

arkypita
New user
New user
Posts: 23
Joined: 2011-08-26 10:59

Re: POP3 mailbox locked forever - need manual unlock

Post by arkypita » 2012-03-07 19:41

Bill48105 wrote: I'd need to test here to confirm. I made a change to the source here but untested. arkypita, you willing to test it?
Yes, i could make some test. I have a PC where I can install a test environment.
The problem is that I don't know for sure how to reproduce the bug, do you have some hint?

If needed, I could write a software to make a "stress test" of popd with unclean session.

Now i go @ home and relax, my working day is finish. See you tomorrow.

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

Re: POP3 mailbox locked forever - need manual unlock

Post by dzekas » 2012-03-07 20:23

Could you check list of open connections with netstat when mailbox is locked?

I think windows verifies idle connection only once in two hours by default.

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

Re: POP3 mailbox locked forever - need manual unlock

Post by Bill48105 » 2012-03-07 21:04

arkypita wrote:
Bill48105 wrote: I'd need to test here to confirm. I made a change to the source here but untested. arkypita, you willing to test it?
Yes, i could make some test. I have a PC where I can install a test environment.
The problem is that I don't know for sure how to reproduce the bug, do you have some hint?

If needed, I could write a software to make a "stress test" of popd with unclean session.

Now i go @ home and relax, my working day is finish. See you tomorrow.
OK cool I can make a test build. Based on the code it looks like hmail is not programmed to delete the session (unlock the box) after timeout, just after QUIT is sent by client. No idea what RFC says but clearly that would be a problem & would explain what you are seeing. Just amazed no one had noticed before!

So to duplicate I'd imagine it should just take a connect then remove connection like disconnect wifi/lan/etc while still connected. TELNET mailserver 110 would suffice.

Btw due to another known bug in hmail this issue might have gone unnoticed.. hmail incorrectly unlocks a box after ANY QUIT command, even after "mailbox locked" error. Because of that odds are if someone's connection timed out & was still locked they'd get locked message on next try but it'd get unlocked so next try after that would work ok. So an annoyance more than a big issue. We've seen many people complain about locked mailboxes using cell phones or wifi but always assumed they just weren't waiting long enough for it to timeout. In your case the close clearly show a timeout but no unlock of the box.

I already have the code changes done (1 simple line) but haven't tested yet. Can post it up (probably send it to you in PM) so it can be tested. If it turns out to fix your issue & doesn't cause other problems I'd post it on the experimentals thread.
Thx
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. ***

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

Re: POP3 mailbox locked forever - need manual unlock

Post by Bill48105 » 2012-03-07 21:08

arkypita wrote:Maybe this is not a bug in software.
Could be a strange combination of condition on server machine, i.e a wrong permission on filesystem or a problem on database? This is why I asked you how locking system is implemented.
Btw the locking is simply an array in memory so not likely permissions etc. As matter of fact if you restart hmail all locks are reset due to that fact since the memory is reset. Actually I think even pausing (stop in hmail admin on older builds) then starting again will clear them but would need to verify.
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. ***

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

Re: POP3 mailbox locked forever - need manual unlock

Post by dzekas » 2012-03-07 21:35

Bill48105 wrote:No idea what RFC says
Maildrop is locked until client enters update state to prevent maildrop modifications. Update state is reached when client executes QUIT. If server has some automatic timeout features, minimal timeout time is 10 minutes. Timer is reset every time client executes some command. Maildrop does not support shared access. You won't pass auth state, if other client is holding same mailbox.

some rfc numbers are easy to remember as they can be linked to historical events.

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

Re: POP3 mailbox locked forever - need manual unlock

Post by Bill48105 » 2012-03-07 21:58

dzekas wrote:
Bill48105 wrote:No idea what RFC says
Maildrop is locked until client enters update state to prevent maildrop modifications. Update state is reached when client executes QUIT. If server has some automatic timeout features, minimal timeout time is 10 minutes. Timer is reset every time client executes some command. Maildrop does not support shared access. You won't pass auth state, if other client is holding same mailbox.

some rfc numbers are easy to remember as they can be linked to historical events.
Thanks dzekas. Yeah I definitely understand why locking occurs with POP but does that mean it is OK per RFC to unlock box after timeout or not? Seems it SHOULD be allowed but many RFC recommendations make little sense for real world. And need to be head rocket scientist to read & understand the 10,000 words in each. :D
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. ***

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

Re: POP3 mailbox locked forever - need manual unlock

Post by dzekas » 2012-03-07 22:28

Bill48105 wrote:but does that mean it is OK per RFC to unlock box after timeout or not?
Unlocking after dropping connection without QUIT is not defined in rfc. Author missed it or was over optimistic. You might assume that lock can be dropped as connection leaves transaction state. Main thing is that server must forget all mail deletions, if connection is dropped without QUIT.

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

Re: POP3 mailbox locked forever - need manual unlock

Post by Bill48105 » 2012-03-07 22:35

dzekas wrote:
Bill48105 wrote:but does that mean it is OK per RFC to unlock box after timeout or not?
Unlocking after dropping connection without QUIT is not defined in rfc. Author missed it or was over optimistic. You might assume that lock can be dropped as connection leaves transaction state. Main thing is that server must forget all mail deletions, if connection is dropped without QUIT.
OK cool thanks. Yeah kind of what I was thinking. :D Worst case we add an setting for user to over-ride if needed but I suspect common sense prevails in that if connection is gone mailbox should be made available aka unlocked. I'll have to look at unlock code but suspect at point of unlock no transactions are saved.
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. ***

arkypita
New user
New user
Posts: 23
Joined: 2011-08-26 10:59

Re: POP3 mailbox locked forever - need manual unlock

Post by arkypita » 2012-03-08 17:49

Bill48105 wrote:
arkypita wrote:
Bill48105 wrote: I'd need to test here to confirm. I made a change to the source here but untested. arkypita, you willing to test it?
Yes, i could make some test. I have a PC where I can install a test environment.
The problem is that I don't know for sure how to reproduce the bug, do you have some hint?

If needed, I could write a software to make a "stress test" of popd with unclean session.

Now i go @ home and relax, my working day is finish. See you tomorrow.
OK cool I can make a test build. Based on the code it looks like hmail is not programmed to delete the session (unlock the box) after timeout, just after QUIT is sent by client. No idea what RFC says but clearly that would be a problem & would explain what you are seeing. Just amazed no one had noticed before!

So to duplicate I'd imagine it should just take a connect then remove connection like disconnect wifi/lan/etc while still connected. TELNET mailserver 110 would suffice.
[...]

Unfortunately today I had to follow other kinds of problem (with a crashed PC) and I cannot make any test on hMail. Tomorrow i will make test by sure.
I'm waiting for patched code version. For now I will execute tests on actual 5.3.3 version

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

Re: POP3 mailbox locked forever - need manual unlock

Post by Bill48105 » 2012-03-09 01:39

arkypita: I hadn't had time to build & post it but sounds like you weren't able to test anyway. Hope to get it done tonight.
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. ***

arkypita
New user
New user
Posts: 23
Joined: 2011-08-26 10:59

Re: POP3 mailbox locked forever - need manual unlock

Post by arkypita » 2012-03-11 18:15

I started do tests with telnet, but failed to reproduce mailbox permanent locking.

hMailServer acts in two different way if i close the connection without send QUIT
- Sometime mailbox result locked at the first login attempt, but result unlocked the next one
- Sometime it remain locked for a long time, this time is maximum 10 minutes.

If I drop connection, ie. disable network card, detach LAN cable, shutting down ADSL router etc mailbox remain locked too. In that cases mailbox will be released after 10 minutes. The lock is removed, and I can login again.

So I wrote a small software to perform many continuous login attempt (on many account) and it measure the time between the last successfully login and now, keeping track of the maximum "mailbox already locked" time interval.

In this way I hope to reproduce a permanent locking (like the one that happen a week ago) but that seems to happen only sporadically. At this moment it is under test on six account made for test, but nothing happens (only 10 minutes of maximum lock time).

Here you can find source code and executable of test software i made: http://dl.dropbox.com/u/21662123/POP3Lock.rar

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

Re: POP3 mailbox locked forever - need manual unlock

Post by Bill48105 » 2012-03-11 18:48

arkypita,
OK cool thanks. One thing you will find is what I've mentioned before: There is a known bug in how hmail unlocks POP boxes when it shouldn't. The reason is an unlock is done after a QUIT even if the login was rejected due to the mailbox being locked. So if you do a test & login to lock then while still connected in that session login again & get the 'already locked' error then login again with 1st session still locked you will be let in without a lock error. I've known about this for some time now but have been reluctant to fix as fixing it can 'break' things or at least make things not work as people have come to expect. The point being that in your test app not sure if you took that bug/feature into account..

But your tests seem to confirm how hmail SHOULD work in that after a 10 min timeout a mailbox should be unlocked. The problem is that does not support your claim above in your original post saying the mailbox does not get unlocked..
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