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

go-imap v2 Backend interface work #374

Closed
wants to merge 54 commits into from
Closed

Conversation

foxcpp
Copy link
Collaborator

@foxcpp foxcpp commented Jul 26, 2020

See messages for individual commits.

Closes #323.

@foxcpp foxcpp changed the base branch from master to dev July 26, 2020 18:55
@foxcpp foxcpp force-pushed the backend-v2 branch 2 times, most recently from f65fed6 to b88370e Compare July 26, 2020 20:37
@foxcpp
Copy link
Collaborator Author

foxcpp commented Jul 26, 2020

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.

@foxcpp
Copy link
Collaborator Author

foxcpp commented Aug 2, 2020

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.
@foxcpp
Copy link
Collaborator Author

foxcpp commented Aug 3, 2020

Note to self: SendUpdate might need synchronization.

@foxcpp
Copy link
Collaborator Author

foxcpp commented Aug 3, 2020

Another note to self: Need to somehow workaround sending of updates in response to CLOSE. This is potentially harmful deviation from RFC 3501.

@foxcpp foxcpp mentioned this pull request Aug 24, 2020
sqwishy and others added 3 commits August 27, 2020 14:19
At least with my mail, a bunch of things in messages, including
content-disposition headers, have uppercase keys.

This lowercases those strings.
foxcpp and others added 24 commits September 7, 2021 18:23
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.
Since go-imap now has to actively request updates to be sent,
we need to do so for Idle command as well.
@foxcpp
Copy link
Collaborator Author

foxcpp commented Jan 5, 2022

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.
@emersion
Copy link
Owner

emersion commented Apr 4, 2023

Closing because this is superseded by go-imap v2.

@emersion emersion closed this Apr 4, 2023
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

Successfully merging this pull request may close these issues.