jakartaee / jakartaee/mail-api

Caused by: com.sun.mail.iap.ConnectionException: * BYE Jakarta Mail Exception: java.lang.ArrayIndexOutOfBoundsException

Open
#570 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
285
Forks
109
Avg merge
15h 19m
Merged PRs (30d)
1

Description

javax.mail.MessagingException: * BYE Jakarta Mail Exception: java.lang.ArrayIndexOutOfBoundsException
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:714) ~[jakarta.mail.jar:1.6.4]
at javax.mail.Service.connect(Service.java:342) ~[jakarta.mail.jar:1.6.4]
at javax.mail.Service.connect(Service.java:222) ~[jakarta.mail.jar:1.6.4]
at javax.mail.Service.connect(Service.java:171) ~[jakarta.mail.jar:1.6.4]

Caused by: com.sun.mail.iap.ConnectionException: * BYE Jakarta Mail Exception: java.lang.ArrayIndexOutOfBoundsException
at com.sun.mail.iap.Protocol.handleResult(Protocol.java:418) ~[jakarta.mail.jar:1.6.4]
at com.sun.mail.imap.protocol.IMAPProtocol.handleLoginResult(IMAPProtocol.java:1043) ~[jakarta.mail.jar:1.6.4]
at com.sun.mail.imap.protocol.IMAPProtocol.authntlm(IMAPProtocol.java:842) ~[jakarta.mail.jar:1.6.4]
at com.sun.mail.imap.IMAPStore.authenticate(IMAPStore.java:895) ~[jakarta.mail.jar:1.6.4]
at com.sun.mail.imap.IMAPStore.login(IMAPStore.java:800) ~[jakarta.mail.jar:1.6.4]
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:681) ~[jakarta.mail.jar:1.6.4]

* OK The Microsoft Exchange IMAP4 service is ready.
DQ0 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=NTLM AUTH=GSSAPI SASL-IR UIDPLUS MOVE ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
DQ0 OK CAPABILITY completed.
DEBUG IMAPS: AUTH: PLAIN
DEBUG IMAPS: AUTH: NTLM
DEBUG IMAPS: AUTH: GSSAPI
DEBUG IMAPS: protocolConnect login, host= --- remove this info.
DEBUG IMAPS: mechanism PLAIN disabled by property: mail.imaps.auth.plain.disable
DEBUG IMAPS: mechanism LOGIN disabled by property: mail.imaps.auth.login.disable
DEBUG IMAPS: AUTHENTICATE NTLM command trace suppressed
DEBUG NTLM: type 1 message: 4E 54 4C 4D 53 53 50 00 01 00 00 00 03 B2 08 00 05 00 05 00 2F 00 00 00 0F 00 0F 00 20 00 00 00 64 63 6D 69 64 61 76 70 73 69 63 30 30 32 37 4E 41 4D 51 41
DEBUG NTLM: type 2 message: 4E 54 4C 4D 53 53 50 00 02 00 00 00 0A 00 0A 00 38 00 00 00 05 82 89 02 C8 6D 6E C1 CF D8 FE C3 00 00 00 00 00 00 00 00 06 01 06 01 42 00 00 00 0A 00 39 38 00 00 00 0F 4E 00 41 00 4D 00 51 00 41 00 02 00 0A 00 4E 00 41 00 4D 00 51 00 41 00 01 00 1A 00 44 00 43 00 57 00 49 00 54 00 50 00 45 00 58 00 43 00 4D 00 30 00 30 00 35 00 04 00 3A 00 4E 00 41 00 4D 00 51 00 41 00 2E 00 43 00 4F 00 52 00 50 00 51 00 41 00 2E 00 47 00 45 00 55 00 43 00 2E 00 43 00 4F 00 52 00 50 00 2E 00 47 00 4D 00 2E 00 43 00 4F 00 4D 00 03 00 56 00 44 00 43 00 57 00 49 00 54 00 50 00 45 00 58 00 43 00 4D 00 30 00 30 00 35 00 2E 00 4E 00 41 00 4D 00 51 00 41 00 2E 00 43 00 4F 00 52 00 50 00 51 00 41 00 2E 00 47 00 45 00 55 00 43 00 2E 00 43 00 4F 00 52 00 50 00 2E 00 47 00 4D 00 2E 00 43 00 4F 00 4D 00 05 00 2E 00 43 00 4F 00 52 00 50 00 51 00 41 00 2E 00 47 00 45 00 55 00 43 00 2E 00 43 00 4F 00 52 00 50 00 2E 00 47 00 4D 00 2E 00 43 00 4F 00 4D 00 07 00 08 00 8F 2E 74 FF 78 85 D7 01 00 00 00 00
DEBUG NTLM: Using NTLMv2
DEBUG IMAPS: IMAPStore non-store connection dead
DEBUG IMAPS: AUTHENTICATE NTLM command result: * BYE Jakarta Mail Exception: java.lang.ArrayIndexOutOfBoundsException

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the NTLM authentication path in IMAPProtocol.authntlm and IMAPStore.authenticate, then follow Protocol.handleResult in Protocol.java. Reproduce the failure against the Microsoft Exchange IMAP service described in the trace and determine the cause of the ArrayIndexOutOfBoundsException. Done means the connection no longer fails with this exception and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.