Re: Error previously found in net 3.11.0 persisting in 3.11.1
"Gary D. Gregory" <[email protected]> Mon, 26 Aug 2024 19:07:43 -0000
| Newsgroups | gmane.comp.jakarta.commons.user |
|---|---|
| Message-ID | <pony-ff9f9da3-21d4-4395-a081-9a8747474487-user@commons.apache.org> |
Hello Stuart,
I addressed this in git master by increasing the message limit in IMAPReply.UNTAGGED_RESPONSE from 160 to 500 characters.
See also snapshot builds in https://repository.apache.org/content/repositories/snapshots/
Gary
On 2024/08/26 16:57:59 Stuart Maclean wrote:
> I had found issue in Commons Net 3.11.0, whereby an 'untagged IMAP'
> reply of sufficient length would cause a Pattern mismatch and the
> following stack trace:
>
> org.apache.commons.net.MalformedServerReplyException: Received
>
> unexpected IMAP protocol response from server: '* OK The Microsoft
> Exchange IMAP4 service is ready. [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]'.
> at
> org.apache.commons.net.imap.IMAPReply.getReplyCode(IMAPReply.java:119)
> at
> org.apache.commons.net.imap.IMAPReply.getUntaggedReplyCode(IMAPReply.java:130)
> at org.apache.commons.net.imap.IMAP.getReply(IMAP.java:288)
> at org.apache.commons.net.imap.IMAP._connectAction_(IMAP.java:152)
>
> This was apparently fixed in 3.11.1.
>
> Browsing the latest source code, I see this regex
>
> private static final String UNTAGGED_RESPONSE = "^\\*
> (\\S{1,80}).{0,160}";
>
> If I am correct, this can match against a string of max length 240 chars ??
>
> I am still seeing the error, even in 3.11.1. Here is a recent example:
>
> org.apache.commons.net.MalformedServerReplyException: Received
> unexpected IMAP protocol response from server: '* OK The Microsoft
> Exchange IMAP4 service is ready.
> [TQBXADIAUABSADIAMQAwADEAQwBBADAAMAAzADYALgBuAGEAbQBwAHIAZAAyADEALgBwAHIAbwBkAC4AbwB1AHQAbABvAG8AawAuAGMAbwBtAA==]'.
> at
> org.apache.commons.net.imap.IMAPReply.getReplyCode(IMAPReply.java:119)
> at
> org.apache.commons.net.imap.IMAPReply.getUntaggedReplyCode(IMAPReply.java:130)
>
> The string between the single quotes, which I suspect is the 'untagged
> response', is 265 bytes in length, which is longer than the regex
> definition.
>
> Stuart
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>