davidmoten / subethasmtp

SubEtha SMTP is a Java library for receiving SMTP mail

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NoSuchElementException on authentication

martijnhoekstra opened this issue · comments

I have a stack trace, but sadly no reproduction case

java.util.NoSuchElementException: null at java.base/java.util.StringTokenizer.nextToken(StringTokenizer.java:349) at org.subethamail.smtp.auth.LoginAuthenticationHandlerFactory$Handler.auth(LoginAuthenticationHandlerFactory.java:71) at org.subethamail.smtp.auth.MultipleAuthenticationHandlerFactory$Handler.auth(MultipleAuthenticationHandlerFactory.java:99) at org.subethamail.smtp.internal.command.AuthCommand.execute(AuthCommand.java:97) at org.subethamail.smtp.internal.server.RequireTLSCommandWrapper.execute(RequireTLSCommandWrapper.java:32) at org.subethamail.smtp.internal.server.CommandHandler.handleCommand(CommandHandler.java:86) at org.subethamail.smtp.server.Session.runCommandLoop(Session.java:252) at org.subethamail.smtp.server.Session.run(Session.java:166) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

clientInput must be null or empty here, but I didn't look in to what that means.

Can you be more specific about what input brings this about and what you want to happen?

I found the issue, and created a PR for it: #105

The issue occurs for AUTH LOGIN when the username or password is empty. The first call to nextToken then fails with NoSuchElementException.

Thanks very much @martijnhoekstra for PR! It has been merged and is in release 6.0.6 which is on Maven Central now.