rust-imap icon indicating copy to clipboard operation
rust-imap copied to clipboard

add support for the imap quota extension (RFC 2087)

Open urkle opened this issue 3 years ago • 4 comments

Here is my first-stab at adding in support for the quota extension (already in imap-proto).

A few things I don't like with it right now.

  1. it exposes some of the imap-proto structs (QuotaResource)
  • I can create local QuotaResource and map them.
  1. the "getquotaroot" is "fun" as it returns 2 resources, (1) QUOTAROOT and (n) QUOTAs.
  • The issue here is that I have to run parse_many_into twice to get both resource sets. (unless I just don't use parse_many_into and just duplicate most of that in the method which I may do)
  • this also causes a difference in response types.. e.g. set_quota and get_quota return a local Quota struct, but I the get_quota_root returns the imap-proto Quota struct (I did not see any easy way to convert ouroboros structs).

Anyways, it's starting point.. Please provide feedback. (this and #227) are two pieces of functionality I'll need for the application I'm building.


This change is Reviewable

urkle avatar Jul 16 '22 17:07 urkle

@jonhoo a bunch of changes and I applied all your feedback.. the result is much cleaner IMHO that the first draft.

And once #228 is merged in I'll add more integration tests..

urkle avatar Jul 18 '22 01:07 urkle

@jonhoo once #227 is merged I'll rebase this and apply the same changes to this branch.

urkle avatar Sep 12 '22 18:09 urkle

@urkle #227 is now merged :tada:

jonhoo avatar Sep 17 '22 22:09 jonhoo

Codecov Report

Merging #235 (9d9a3ce) into main (3a65407) will increase coverage by 1.2%. The diff coverage is 93.3%.

Additional details and impacted files
Impacted Files Coverage Δ
src/lib.rs 100.0% <ø> (ø)
src/types/quota.rs 87.6% <87.6%> (ø)
src/client.rs 93.1% <94.9%> (+0.6%) :arrow_up:
src/parse.rs 89.9% <95.1%> (+0.5%) :arrow_up:
src/utils.rs 100.0% <100.0%> (ø)

codecov[bot] avatar Sep 26 '22 18:09 codecov[bot]

@jonhoo fixups pushed and your comments have been either fixed or replied to (For further discussion)

urkle avatar Oct 19 '22 02:10 urkle

@jonhoo ooh.. you merged it with the fixup commits.. you probably should have either used the github squash merge or asked me to squash it down..

urkle avatar Oct 31 '22 14:10 urkle

Oops, yes, completely forgot about those! My bad. Oh well, not the end of the world 😅

jonhoo avatar Oct 31 '22 15:10 jonhoo