woj-tek commented on code in PR #2386:
URL: https://github.com/apache/james-project/pull/2386#discussion_r1726692863
##########
protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java:
##########
@@ -444,14 +444,10 @@ protected Optional<MessageRange>
messageRange(SelectedMailbox selected, IdRange
private MessageRange msnRangeToMessageRange(SelectedMailbox selected, long
lowVal, long highVal)
throws MessageRangeException {
- // Take care of "*" and "*:*" values by return the last message in
+ // Take care of "*", "1:*" and "*:*" values by return the last message
in
// the mailbox. See IMAP-289
- if (lowVal == Long.MAX_VALUE && highVal == Long.MAX_VALUE) {
- Optional<MessageUid> last = selected.getLastUid();
- if (!last.isPresent()) {
- throw new MessageRangeException("Mailbox is empty");
- }
- return last.get().toRange();
+ if ((lowVal == Long.MAX_VALUE || lowVal == 1) && highVal ==
Long.MAX_VALUE) {
+ return MessageRange.all();
}
Review Comment:
I actually added all those variants (i.e. `1:*`, `*:*` and `*`):
https://github.com/apache/james-project/pull/2386/commits/8283f2ed9b2f0f2d46d1728600fc8920037f27f3#diff-bccae2dfc450f23b2e358900c6953df48b210c9ca79d08e8b4a9749684ce7c1fR104
but... only to empty mailbox test :D
I'll try extending the tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]