Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalStateException: Mailbox already exists #598

Open
ynoir opened this issue Oct 3, 2023 · 0 comments
Open

IllegalStateException: Mailbox already exists #598

ynoir opened this issue Oct 3, 2023 · 0 comments
Labels
backport_1_6_x Backport to old bugfixing branch 1.6.x backport_2_0_x Backport to branch 2.0.x bug
Milestone

Comments

@ynoir
Copy link

ynoir commented Oct 3, 2023

Version: 2.0.0.

We are sometimes getting this error on a somewhat slow Jenkins server:

Caused by: java.lang.IllegalStateException: Unexpected error handling connection
	at com.icegreen.greenmail.smtp.SmtpHandler.run(SmtpHandler.java:55)
	at com.icegreen.greenmail.server.AbstractServer.lambda$handleClientSocket$0(AbstractServer.java:174)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.IllegalStateException: Mailbox -371627052 already exists in [HierarchicalFolder{name='-371627052', parent=HierarchicalFolder{name='#mail', parent=null, isSelectable=false}, isSelectable=false}]
	at com.icegreen.greenmail.store.HierarchicalFolder.createChild(HierarchicalFolder.java:100)
	at com.icegreen.greenmail.store.InMemoryStore.createMailbox(InMemoryStore.java:63)
	at com.icegreen.greenmail.imap.ImapHostManagerImpl.createPrivateMailAccount(ImapHostManagerImpl.java:93)
	at com.icegreen.greenmail.user.UserImpl.create(UserImpl.java:35)
	at com.icegreen.greenmail.user.UserManager.createUser(UserManager.java:61)
	at com.icegreen.greenmail.user.UserManager.test(UserManager.java:87)
	at com.icegreen.greenmail.smtp.commands.AuthCommand.authLogin(AuthCommand.java:115)
	at com.icegreen.greenmail.smtp.commands.AuthCommand.execute(AuthCommand.java:68)
	at com.icegreen.greenmail.smtp.SmtpHandler.handleCommand(SmtpHandler.java:92)
	at com.icegreen.greenmail.smtp.SmtpHandler.run(SmtpHandler.java:46)
	... 2 more

Could it be that the checking for an existing user in UserManager#test and the mailbox creation in HierarchicalFolder#createChild need to be synchonized?

@marcelmay marcelmay added the bug label Oct 3, 2023
@marcelmay marcelmay modified the milestones: 2.1, 2.1.0-alpha-3 Oct 3, 2023
@marcelmay marcelmay added backport_1_6_x Backport to old bugfixing branch 1.6.x backport_2_0_x Backport to branch 2.0.x labels Oct 3, 2023
@marcelmay marcelmay modified the milestones: 2.1.0-alpha-3, 2.1.0-alpha-4 Nov 4, 2023
@marcelmay marcelmay modified the milestones: 2.1.0-alpha-4, 2.1.0-rc-1 Jan 28, 2024
@marcelmay marcelmay modified the milestones: 2.1.0-rc-1, 2.1.0 May 31, 2024
@marcelmay marcelmay modified the milestones: 2.1.0, 2.1.x Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport_1_6_x Backport to old bugfixing branch 1.6.x backport_2_0_x Backport to branch 2.0.x bug
Projects
None yet
Development

No branches or pull requests

2 participants