emersion / go-imap

📥 An IMAP library for clients and servers
MIT License
2.1k stars 297 forks source link

[v1] Returning NO/BAD from ListMessages when messages have been deleted #535

Closed dvcrn closed 1 year ago

dvcrn commented 1 year ago

Hi,

I'm aware that development has shifted to v2 but I wanted to ask anyway. From the way I understand, server should return NO or BAD when a message has been moved on the server side and is no longer available:

C: a001 UID FETCH 23 BODY[HEADER]
S: a001 NO No message with UID 23

List messages has this signature:

ListMessages(uid bool, seqset *imap.SeqSet, items []imap.FetchItem, ch chan<- *imap.Message)

So I'm wondering how to properly send a BAD/NO response from ListMessages back to the client. The current fetch command is also not exposing the conn object to ListMessages.

Before I start and add a custom Fetch command that does expose conn to ListMessages I figured I'd just ask here first 😄