Commit Graph
91 Commits
Author SHA1 Message Date
David Evans 0c304df4e2 Enable splitting a mailbox name (#252)
* Enable splitting a mailbox name

* Extra test cases

* Fix sanity

* Improve docs

* Update MailboxInfo.swift

* Update MailboxName.swift
2020-07-09 14:48:47 +01:00
David Evans 93a801b650 Cleanup parse nstring (#266)
* Cleanup

* Fix sanity
2020-07-09 14:00:05 +01:00
David Evans 1082a1aa7c Fix parsing BODYSTRUCTURE (#265)
* Fix parsing and add test cases

* Fix sanity
2020-07-09 13:37:21 +01:00
Daniel Eggert a3e3867aa2 Make flags case-insensitive, but case-preserving. (#264) 2020-07-09 11:43:04 +01:00
David Evans e5f5c52e32 Fix MessageAttribute documentation (#261)
* Fix documentation

* Rename structure to hasExtensionData

* Fix sanity
2020-07-09 10:36:53 +01:00
David Evans 05bf679fd0 Remove String typealias (#259)
* Convert NString into a struct

* Fix sanity

* Just use ByteBuffer?
2020-07-09 09:36:33 +01:00
Daniel Eggert e1d5de1c10 RawRepresentable (#262) 2020-07-09 09:20:09 +01:00
Daniel Eggert c401b8e251 Cleanup various names related to BodyStructure (#257)
* BodyStructure: Naming cleanup

* octetCount

* lineCount

* Disposition.kind
2020-07-09 08:50:30 +01:00
David Evans f58e239a59 Extra tests for non-standard capabilities (#251)
* Minor modifications

* Fix tests
2020-07-08 14:56:10 +01:00
David Evans 2599f0d94d Re-add BodyStructureTests (#250)
* Re-add tests

* Uncomment tests

* Fix sanity

* Refactor Body Field Language

* Add humungous example

* Fix sanity

* Remove unused extension (PR review nit)
2020-07-06 22:44:28 +01:00
David Evans a5c31cf51f Refactor capability literal+ API (#247)
* Refactor literal+

* Fix tests

* Add documentation

* Fix doc nit

* Fix sanity

* Fix tests
2020-07-06 19:11:11 +01:00
David Evans 46c52f84b2 Camel-case months when encoding (#248)
* Camel-case months

* Fix tests
2020-07-06 19:05:46 +01:00
David Evans fd9905098c Refactor Search and UID Search (#242)
* Refactor Search and UID Search

* Uncomment tests

* Fix sanity
2020-07-06 18:57:38 +01:00
David Evans 6716144eb4 Be more lenient when parsing spaces (#238)
* Update space parser

* Remove typo

* Extra tests

* Fix parsing spaces

* Re-add missing tests

* Fix sanity
2020-07-06 18:55:55 +01:00
David Evans 1add02eaa4 Don't uppercase keywords (#249) 2020-07-06 18:51:42 +01:00
Daniel Eggert 3c20af6f53 Use encoding options specific to the transport direction. (#240)
* Use encoding options specific to the transport direction.

* Add description to precondition failure.

* Make properties on EncodingOptions public.

* Rename files.

* Change APPEND to use CommandEncodingOptions.
2020-07-06 18:37:16 +01:00
David Evans ffed95aa72 Remove writeAString (#239) 2020-07-02 19:05:34 +01:00
David Evans 9757506063 Make synchronising use configurable (#226)
* Make synchronising use configurable

* Fix sanity

* Rename

* Rename

* Fix text encoding

* Switch to an option set

* Embed options in struct

* Fix UInt8 test

* Fix UTF-7 encoding and tests

* Fix sanity

* Refactor

* Fix sanity
2020-07-01 16:45:13 +01:00
Daniel Eggert 42ac3f717a Add parenthesis around search keys when ambiguous (#237)
Fixes #210
2020-07-01 09:14:00 +01:00
David Evans 4d8f545414 Always use parseNewline (#234) 2020-06-30 12:56:46 +01:00
Daniel Eggert 7bb7916a1a Allow space before newline (for CAPABILITY). (#233)
See also: #232
2020-06-30 11:23:11 +01:00
Johannes WeissandDavid Evans 525d58d1fa non-happy path tests: over/underflows (#220)
* Support encoding append commands

* Yay it works

* Cleanup 1

* Cleanup 2

* Fix sanity

* Fix command decoder test

* Fix parsing partial commands sync literals

* Fix parser stress tests

* Fix tests

* Remove unused code

* Code refactor and cleanup

* Fix sanity

Co-authored-by: David Evans <d.evans@apple.com>
2020-06-26 14:47:40 +01:00
Daniel Eggert 4e19396c19 Range for FETCH need to be encoded as <offset.count> (#214)
* Range for FETCH need to be encoded as <offset.count>

From RFC 3501:
> This is done by appending an open angle bracket ("<"), the octet position of the first desired octet, a period, the maximum number of octets desired, and a close angle bracket (">") to the part specifier.

* Check for overflow.

* Add more test cases. Limit to UInt32.max
2020-06-26 10:47:30 +01:00
David Evans b307ac1404 Remove capability preconditions (#230)
* Remove preconditions

* Fix sanity
2020-06-25 17:58:02 +01:00
Daniel Eggert 1fe1cd4c10 Allow continuation request without space or text. (#222) 2020-06-25 17:34:40 +01:00
David Evans 2f185c1abd Make keywords case sensitive (#227)
* Make keywords case sensitive

* Fix sanity
2020-06-22 14:48:29 +01:00
David Evans c34e3889cb Refactor search key (#223)
* More search key tests

* Remove sent search type

* Rename smaller and larger

* Rename search key sequence set case

* Documentation

* Add documentation

* And

* Fix tests

* Documentation
2020-06-22 13:48:02 +01:00
David Evans 49b44c521f Only send return when supported and options exist (#208)
* Only send return when supported and options exist

* Fix sanity

* Throw an error when encoding

* Fix tests

* Fix sanity

* Fire error through pipeline

* Update ByteBuffer+WriteLiteral.swift
2020-06-22 12:17:11 +01:00
David Evans c04c7bae95 Add name and value to capability (#221)
* Add name and value to capability

* Fix sanity
2020-06-18 22:20:35 +01:00
David Evans e44a55ca8d Flatten RFC822 into FetchAttribute (#219)
* Flatten RFC822

* Fix sanity

* Fix tests
2020-06-18 13:38:53 +01:00
Daniel Eggert 1a88c6edd9 Encode FETCH attributes using macros when possible. (#216) 2020-06-17 14:56:50 +01:00
Daniel Eggert 84bf22edd4 Use flag case from RFC 3501 for system flags. (#217) 2020-06-17 14:54:49 +01:00
David Evans f97bfee82f Don't defer to literal8 (#209)
* Don't defer to literal8

* Use literal if more than 70 characters
2020-06-17 14:51:45 +01:00
David Evans 2a8b8ec78e Add extra capabilities (#211) 2020-06-17 13:08:10 +01:00
Daniel Eggert 03c8a323dc Replace Date.Month with Int (#203)
* Change Date.Month -> Int

* Change property order to year, month, day.

* Fix style.

* Fix lowercase / uppercase month name.

* Use preconditionFailure()
2020-06-17 12:48:44 +01:00
Daniel EggertandDavid Evans 418f718635 SectionSpecifier convenience. (#197)
Co-authored-by: David Evans <d.evans@apple.com>
2020-06-17 11:46:24 +01:00
Daniel Eggert 148232a79b Add documentation to MessageAttribute (#196) 2020-06-17 10:42:59 +01:00
Daniel Eggert 774135b482 Simplify Date.DateTime -> use InternalDate (#191)
* Simplify Date.DateTime -> use InternalDate

Fixes #74

* Changes according to feedback from @Davidde94

* Fix code style.

* More cleanup.
2020-06-15 18:27:34 +01:00
David Evans 2fe4f0227d Make BodyStructure a RandomAccessCollection (#194)
* Implement start index

* Implement index before

* Implement index after

* Implement position

* Fix sanity

* Refactor

* Fix sanity
2020-06-15 17:42:48 +01:00
David Evans e71dc4a8ca Fix public api (#192) 2020-06-09 16:39:03 +01:00
David Evans 1a66129e86 Begin to make encoding capability aware (#188)
* Primitive capability support

* Sample move capability requirement

* More examples

* Write binary literals

* Sanity

* Rename to encoding options

* Fix sanity

* Fix

* Add IMAP base options

* Rename

* Update Capability.swift

* Fix

* Use EncodeBuffer

* Fix writing greeting

* Fix sanity

* Fix assert

* Use EncodeBuffers everywhere

* Use EncodingCapabilities

* Remove base capabilities

* Create CommandEncodeBuffer

* Dedicated buffer types

* Fix sanity

* Clear test buffer

* PR review changes

* Remove has more chunks

* Remove dead code

* Fix sanity

* Fix
2020-06-04 14:56:18 +01:00
David Evans 645e9742a1 Refactor section specifier (#190)
* Rename

* Create new section part type

* Refactor into a struct

* Fix sanity
2020-06-02 18:41:30 +01:00
David Evans 1c424b0eb8 Implement EncodeBuffer.hasMoreChunks (#189)
* Implement has more chunks

* Fix sanity

* Re-add precondition
2020-06-01 16:56:25 +01:00
David Evans 1705b21ccd Move greeting under untagged response (#183) 2020-05-28 14:06:12 +01:00
David Evans a06b3898aa Hide incomplete message errors (#135)
* Hide incomplete message errors

* Fix sanity

* Throw error

* Fix rebase

* Refactor

* Log not throw

* Improve roundtrip handler

* Fix sanity

* Update comments

* Remove error case

* Logging

* PR review

* Simplify loop

* Use NIOSinglestep...

* Fix sanity

* Even more efficiency

* Fix sanity
2020-05-28 13:49:11 +01:00
David Evans 45f6ad2649 Convert partial to be a range (#182)
* Convert partial to be a range

* Sanity
2020-05-27 18:09:24 +01:00
David Evans e98dfa1182 Refactor mailbox flags (#181)
* Refactor mailbox flags

* Fix sanity
2020-05-27 18:09:16 +01:00
David Evans 7da7dc5b54 Remove FetchType (#180)
* Fix tests

* Fix sanity
2020-05-27 13:35:00 +01:00
Daniel Eggert 30cdf896ff Create type for UID / UIDSet and use UIDs vs. Sequence Numbers (#166)
* Create type for UID / UIDSet and use UIDs vs. Sequence Numbers as appropriate.

* Remove commented out code.

* Linting.
2020-05-26 11:08:08 +01:00
Daniel Eggert 1ac7aa5677 Renaming: StoreAttributeFlagsType → StoreFlags 2020-05-22 16:53:35 +01:00