Mailbox already locked

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
parag_aj
New user
New user
Posts: 1
Joined: 2011-07-05 08:14

Mailbox already locked

Post by parag_aj » 2011-07-05 08:42

Hi,

I am reading the messages through my Java program and it works superb.

However, it works perfect when IMAP is used. But if I use POP to read the messages through my Java code I get an error: Your mailbox is already locked. Below is the stacktrace:

1.

Code: Select all

javax.mail.AuthenticationFailedException: Your mailbox is already locked
	at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:104)
	at javax.mail.Service.connect(Service.java:234)
	at Testclass.connect(Testclass.java:241)
2. I already gone through some of the posts with this kind of problem and performed some steps like "Empty account" and "Unlock" on my email account. But that does not solve the problem.

3. I also tried to delete the email account and added it again, but problem persists.

4. That email account is using by multiple Java/Thunderbird clients and there were some cases when it may not have been closed correctly. It is usually closed through the Java program. I understand if multiple clients want to access the same email account IMAP should be used and not POP. But I was testing my functionality and I used POP and now I cannot connect to it.

5. Below is the log from hMailServer: This is the only log I have since I turn it ON just now.

Code: Select all

"DEBUG"	4164	"2011-07-05 12:06:17.370"	"Creating session 91"
"POP3D"	4164	91	"2011-07-05 12:06:17.372"	"10.253.190.153"	"SENT: +OK POP3"
"POP3D"	3120	91	"2011-07-05 12:06:17.375"	"10.253.190.153"	"RECEIVED: USER info@something.com"
"POP3D"	3120	91	"2011-07-05 12:06:17.377"	"10.253.190.153"	"SENT: +OK Send your password"
"POP3D"	3120	91	"2011-07-05 12:06:17.378"	"10.253.190.153"	"RECEIVED: PASS ***"
"POP3D"	3120	91	"2011-07-05 12:06:17.384"	"10.253.190.153"	"SENT: +OK Mailbox locked and ready"
"POP3D"	3196	91	"2011-07-05 12:06:17.391"	"10.253.190.153"	"RECEIVED: STAT"
"POP3D"	3196	91	"2011-07-05 12:06:17.393"	"10.253.190.153"	"SENT: +OK 0 0"
"DEBUG"	4164	"2011-07-05 12:06:17.642"	"Creating session 92"
"POP3D"	4164	92	"2011-07-05 12:06:17.644"	"10.253.190.153"	"SENT: +OK POP3"
"POP3D"	4164	92	"2011-07-05 12:06:17.647"	"10.253.190.153"	"RECEIVED: USER info@something.com"
"POP3D"	4164	92	"2011-07-05 12:06:17.649"	"10.253.190.153"	"SENT: +OK Send your password"
"POP3D"	3436	92	"2011-07-05 12:06:17.652"	"10.253.190.153"	"RECEIVED: PASS ***"
"POP3D"	3436	92	"2011-07-05 12:06:17.658"	"10.253.190.153"	"SENT: -ERR Your mailbox is already locked"
"POP3D"	3528	92	"2011-07-05 12:06:17.660"	"10.253.190.153"	"RECEIVED: QUIT"
"POP3D"	3528	92	"2011-07-05 12:06:17.662"	"10.253.190.153"	"SENT: +OK POP3 server saying goodbye..."
"DEBUG"	3436	"2011-07-05 12:06:17.664"	"Closing TCP/IP socket"
"DEBUG"	3436	"2011-07-05 12:06:17.667"	"Ending session 92"
"DEBUG"	2540	"2011-07-05 12:06:17.820"	"Ending session 91"
6. I also have one more doubt, when I go to Settings -> POP3 -> Connections. It has value 0 (by default) and it means unlimited simultaneous connections can be made using POP?

I am using hMailServer 5.3.3-B1879, JDK1.6, Mozila Thunderbird 3.1.10.

Thanks in advance,
Parag

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

Re: Mailbox already locked

Post by mattg » 2011-07-05 11:05

parag_aj wrote:I understand if multiple clients want to access the same email account IMAP should be used and not POP. But I was testing my functionality and I used POP and now I cannot connect to it.
Correct.

The connection will time out after a hard coded 30 minutes.
parag_aj wrote:6. I also have one more doubt, when I go to Settings -> POP3 -> Connections. It has value 0 (by default) and it means unlimited simultaneous connections can be made using POP?
This connection limit is per server, not per account.
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

ozgurerdogan
Senior user
Senior user
Posts: 268
Joined: 2010-11-19 18:50

Re: Mailbox already locked

Post by ozgurerdogan » 2011-07-05 13:49

mattg, is / will there a way to make it per account or change default time out value? I heard future versions will have such setting.

Thanks

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

Re: Mailbox already locked

Post by Bill48105 » 2011-07-05 16:07

I put INI settings to set timeouts of about every aspect of hmail. You could try setting the pop3 timeout shorter (if you are on 5.4) and see if that helps but understand you can make other clients timeout too soon causing problems as well. Your best bet is to FIX OR REPLACE YOUR CLIENT.

Your logs make it look like it is doing concurrent mailbox access so your already locked error is showing hmail doing its job. (The 2nd login attempt is 1/2 second after the initial successful login). POP spec does not allow for concurrent access so it is expected to get mailbox locked error (more like 'hey btw the box is in use, try again later' vs error) and is a side-effect you live with if you must do pop access from more than 1 box. The answer is to use IMAP or setup a boxes for each pop user/client & have sever cc's or distribution list go to each box. (Obviously pros/cons to any option)

As far as your box getting locked 'forever' that is because one of your clients is not behaving. It should QUIT & logout to unlock the box. Odds are your java client needs to be fixed for that issue if you want to stop the extended locks rather than mess with the timeouts. Btw, we've seen the same issue with unreliable connections (like a cell phone) where the client logs in then the connection drops or moves to another tower or such before QUITE/close can occur & not much can be done to help that besides reducing timeouts or using IMAP.
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. ***

MehmetDelen
New user
New user
Posts: 14
Joined: 2013-04-28 15:22

Re: Mailbox already locked

Post by MehmetDelen » 2013-05-09 23:49

to imap solution?
Think of user systems with 4000.
When IMAP processor, ram usage will reach very large values​​.
Hmail right solution 'in that it cancel the lock.
key feature should be optional.
Allow the solution to the style of concurrent mailbox access.

Post Reply