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

Recreating a user fails with NPE #522

Closed
marcelmay opened this issue Jan 29, 2023 · 0 comments
Closed

Recreating a user fails with NPE #522

marcelmay opened this issue Jan 29, 2023 · 0 comments
Assignees
Labels
backport_1_6_x Backport to old bugfixing branch 1.6.x bug
Milestone

Comments

@marcelmay
Copy link
Member

marcelmay commented Jan 29, 2023

Reported in #521 for version 1.6.12

Re-creating a user fails with NPE when receiving mails

802     ERROR      commands.DataCommand| Can not send state '250 OK', aborted.
java.lang.IllegalStateException: Can not deliver message MovingMessage{toAddresses=[foo@localhost], returnPath=foo@localhost, message=jakarta.mail.internet.MimeMessage@7ebdad14} to foo@localhost
	at com.icegreen.greenmail.smtp.SmtpManager$Incoming.handle(SmtpManager.java:89) ~[classes/:?]
	at com.icegreen.greenmail.smtp.SmtpManager$Incoming.enqueue(SmtpManager.java:80) ~[classes/:?]
	at com.icegreen.greenmail.smtp.SmtpManager.send(SmtpManager.java:55) ~[classes/:?]
	at com.icegreen.greenmail.smtp.commands.DataCommand.execute(DataCommand.java:63) ~[classes/:?]
	at com.icegreen.greenmail.smtp.SmtpHandler.handleCommand(SmtpHandler.java:92) ~[classes/:?]
	at com.icegreen.greenmail.smtp.SmtpHandler.run(SmtpHandler.java:46) ~[classes/:?]
	at com.icegreen.greenmail.server.AbstractServer.lambda$handleClientSocket$0(AbstractServer.java:165) ~[classes/:?]
	at java.lang.Thread.run(Thread.java:750) ~[?:1.8.0_362]
Caused by: java.lang.IllegalStateException: Can not deliver MovingMessage{toAddresses=[foo@localhost], returnPath=foo@localhost, message=jakarta.mail.internet.MimeMessage@7ebdad14} for user UserImpl{email='foo@localhost', login='foo@localhost'}
	at com.icegreen.greenmail.user.UserImpl.deliver(UserImpl.java:65) ~[classes/:?]
	at com.icegreen.greenmail.user.UserManager.deliver(UserManager.java:146) ~[classes/:?]
	at com.icegreen.greenmail.smtp.SmtpManager$Incoming.handle(SmtpManager.java:87) ~[classes/:?]
	... 7 more
Caused by: java.lang.NullPointerException
	at com.icegreen.greenmail.user.UserImpl.deliver(UserImpl.java:63) ~[classes/:?]
	at com.icegreen.greenmail.user.UserManager.deliver(UserManager.java:146) ~[classes/:?]
	at com.icegreen.greenmail.smtp.SmtpManager$Incoming.handle(SmtpManager.java:87) ~[classes/:?]
	... 7 more

java.lang.IllegalStateException: Can not send message jakarta.mail.internet.MimeMessage@72967906

	at com.icegreen.greenmail.util.GreenMailUtil.sendMimeMessage(GreenMailUtil.java:272)
	at com.icegreen.greenmail.util.GreenMailUtil.sendTextEmail(GreenMailUtil.java:260)
	at com.icegreen.greenmail.test.SmtpServerTest.testSendAndReCreateUser(SmtpServerTest.java:254)
...
Caused by: com.sun.mail.smtp.SMTPSendFailedException: 451 Requested action aborted: local error in processing
	at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2374)
	at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:2095)
	at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1301)
	at jakarta.mail.Transport.send0(Transport.java:231)
	at jakarta.mail.Transport.send(Transport.java:100)
	at com.icegreen.greenmail.util.GreenMailUtil.sendMimeMessage(GreenMailUtil.java:270)
	... 30 more
@marcelmay marcelmay added bug backport_1_6_x Backport to old bugfixing branch 1.6.x labels Jan 29, 2023
@marcelmay marcelmay added this to the 2.0.0-alpha-4 milestone Jan 29, 2023
@marcelmay marcelmay self-assigned this Jan 29, 2023
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 bug
Projects
None yet
Development

No branches or pull requests

1 participant