-
Notifications
You must be signed in to change notification settings - Fork 294
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
go-imap v2 Backend interface work #374
Conversation
f65fed6
to
b88370e
Compare
Speaking of backendutil helpers, I extracted https://github.com/foxcpp/go-imap-sequpdate from my go-imap-maildir experiments. I am not putting it into this PR as I believe it is not polished out enough yet. |
Note to self: go-imap-namespace needs updating for the new Interface |
RFC 3501 requires NIL for missing fields and "" for empty fields, however, acknowledges the fact some servers may return NIL for empty fields. We do not bother complicating the structure and do the same. It is believed that empty-but-present header fields are rare enough to be ignored, while returning "" for missing fields is more of an issue. The main reason for this change is to silence imaptest, though.
Count header size for SIZE matching. Check header fields for TEXT matching. Correctly truncate time.Time in criteria and arguments.
Note to self: SendUpdate might need synchronization. |
Another note to self: Need to somehow workaround sending of updates in response to CLOSE. This is potentially harmful deviation from RFC 3501. |
…h links to the GitHub wiki pages
At least with my mail, a bunch of things in messages, including content-disposition headers, have uppercase keys. This lowercases those strings.
This extension is built-in now.
…to User This is a preparation for dropping in-library updates dispatching. The goal is to minimize creating Mailbox objects for commands that are not related to the currently selected mailbox thus reserving Mailbox to only represent currently selected mailbox.
It was observed that while using certain approaches to implement stable sequence numbers view work done during mailbox selection and one done on Status call overlaps. In order to avoid complex contracts like "Status is always called immediately after GetMailbox" or requesting backend to do duplicate work both calls are merged so backend implementation can exploit that and do work only once.
This permits backend to send appropriate updates for each connection and maintain per-connection sequence number view correctly.
EXAMINE command has a number of differences from SELECT and implementing some of them requires backend to be aware that EXAMINE command is used. In particular, FETCH should always work as if BODY.PEEK is used instead of BODY. That is, \Seen flag should not be auto-added to messages.
CHECK command is largely unused and is often implemented as a no-op. It is even removed in IMAP4rev2. This commit replaces corresponding method with Poll(). Newly added argument for Poll is reserved for future extensions that may require explicit polling but cannot allow sending EXPUNGE updates.
This is necessary to generate EXISTS update as a result as required ("SHOULD") by RFC 3501 if the current mailbox is selected.
memory backend is also updated to conform with that and return backend.ErrNoSuchMailbox.
…t update handling
Since go-imap now has to actively request updates to be sent, we need to do so for Idle command as well.
Just rebased it onto master. If we synchronize dev with master conflicts should be gone. |
IDLE was changed into a built-in extension, but the default capabilities list was never updated to include it. The go-imap/client library (and probably any other sane IMAP client) resorts to polling if the IDLE cap isn't present. Co-authored-by: sblinch <sblinch@users.noreply.github.com> Closes emersion#453.
Closing because this is superseded by go-imap v2. |
See messages for individual commits.
Closes #323.