mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2024-11-10 09:32:19 +08:00
IMAP SEARCH by sequence number fix
This commit is contained in:
parent
dab9735f8c
commit
7152dcdb3a
3 changed files with 12 additions and 10 deletions
|
@ -2,6 +2,15 @@
|
||||||
|
|
||||||
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
|
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
## [0.5.2] - 2024-01-xx
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- IMAP command `SEARCH <seqnum>` is using UIDs rather than sequence numbers.
|
||||||
|
|
||||||
## [0.5.1] - 2024-01-02
|
## [0.5.1] - 2024-01-02
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
|
|
@ -125,7 +125,7 @@ impl SessionData {
|
||||||
) -> Result<search::Response, StatusResponse> {
|
) -> Result<search::Response, StatusResponse> {
|
||||||
// Run query
|
// Run query
|
||||||
let (result_set, include_highest_modseq) = self
|
let (result_set, include_highest_modseq) = self
|
||||||
.query(arguments.filter, &mailbox, &prev_saved_search, is_uid)
|
.query(arguments.filter, &mailbox, &prev_saved_search)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
// Obtain modseq
|
// Obtain modseq
|
||||||
|
@ -250,7 +250,6 @@ impl SessionData {
|
||||||
imap_filter: Vec<Filter>,
|
imap_filter: Vec<Filter>,
|
||||||
mailbox: &SelectedMailbox,
|
mailbox: &SelectedMailbox,
|
||||||
prev_saved_search: &Option<Option<Arc<Vec<ImapId>>>>,
|
prev_saved_search: &Option<Option<Arc<Vec<ImapId>>>>,
|
||||||
is_uid: bool,
|
|
||||||
) -> Result<(ResultSet, bool), StatusResponse> {
|
) -> Result<(ResultSet, bool), StatusResponse> {
|
||||||
// Obtain message ids
|
// Obtain message ids
|
||||||
let mut filters = Vec::with_capacity(imap_filter.len() + 1);
|
let mut filters = Vec::with_capacity(imap_filter.len() + 1);
|
||||||
|
@ -431,11 +430,7 @@ impl SessionData {
|
||||||
return Err(StatusResponse::no("No saved search found."));
|
return Err(StatusResponse::no("No saved search found."));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for id in mailbox
|
for id in mailbox.sequence_to_ids(&sequence, uid_filter).await?.keys() {
|
||||||
.sequence_to_ids(&sequence, is_uid || uid_filter)
|
|
||||||
.await?
|
|
||||||
.keys()
|
|
||||||
{
|
|
||||||
set.insert(*id);
|
set.insert(*id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,9 +75,7 @@ impl SessionData {
|
||||||
is_uid: bool,
|
is_uid: bool,
|
||||||
) -> Result<Response, StatusResponse> {
|
) -> Result<Response, StatusResponse> {
|
||||||
// Run query
|
// Run query
|
||||||
let (result_set, _) = self
|
let (result_set, _) = self.query(arguments.filter, &mailbox, &None).await?;
|
||||||
.query(arguments.filter, &mailbox, &None, is_uid)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
// Synchronize mailbox
|
// Synchronize mailbox
|
||||||
if !result_set.results.is_empty() {
|
if !result_set.results.is_empty() {
|
||||||
|
|
Loading…
Reference in a new issue