Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMAP Search incorrectly returns UID instead of SeqNum #1519

Open
jackmahoney opened this issue Jun 10, 2024 · 0 comments
Open

IMAP Search incorrectly returns UID instead of SeqNum #1519

jackmahoney opened this issue Jun 10, 2024 · 0 comments

Comments

@jackmahoney
Copy link

jackmahoney commented Jun 10, 2024

IMAP SEARCH command incorrectly returns UID of messages. It ought to return SeqNums. UID should only be returned from UID SEARCH commands. (See RFC3501)

Reproduce:
Run smtp4dev and send an email to it. There is one email with SeqNum=1 UID=2. Then search like so:

* OK smtp4dev
a001 LOGIN test test
a001 OK LOGIN completed.
a002 SELECT INBOX
* 1 EXISTS
* 0 RECENT
* OK [UNSEEN 1] Message 1 is the first unseen.
* OK [UIDNEXT 3] Predicted next message UID.
* OK [UIDVALIDITY 1234] Folder UID value.
* FLAGS (\Deleted \Seen)
* OK [PERMANENTFLAGS (\Deleted \Seen)] Avaliable permanent flags.
a002 OK [READ-WRITE] SELECT completed in 0.01 seconds.
a003 UID SEARCH SINCE 1-Jan-2021
* SEARCH 2
a003 OK SEARCH completed in 0.01 seconds.
a004 SEARCH SINCE 1-Jan-2021
* SEARCH 2
a004 OK SEARCH completed in 0.00 seconds.

Notice that both SEARCH and UID SEARCH return the same number! SEARCH should return 1 not 2.

The line that needs to change is here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant