imapkit 4.0.2 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -19
- package/bin/imapkit.js +12 -16
- package/dist/cjs/addressparser.d.ts +21 -0
- package/dist/cjs/addressparser.js +277 -0
- package/dist/cjs/arguments.d.ts +31 -0
- package/{lib → dist/cjs}/arguments.js +9 -21
- package/dist/cjs/bodystructure.d.ts +25 -0
- package/dist/cjs/bodystructure.js +150 -0
- package/dist/cjs/cert.d.ts +2 -0
- package/dist/cjs/cert.js +7 -0
- package/dist/cjs/command-states.d.ts +36 -0
- package/dist/cjs/command-states.js +102 -0
- package/dist/cjs/commands/append.d.ts +88 -0
- package/dist/cjs/commands/append.js +299 -0
- package/dist/cjs/commands/capability.d.ts +2 -0
- package/dist/cjs/commands/capability.js +44 -0
- package/dist/cjs/commands/check.d.ts +2 -0
- package/dist/cjs/commands/check.js +28 -0
- package/dist/cjs/commands/close.d.ts +2 -0
- package/dist/cjs/commands/close.js +35 -0
- package/dist/cjs/commands/copy.d.ts +30 -0
- package/dist/cjs/commands/copy.js +107 -0
- package/dist/cjs/commands/create.d.ts +2 -0
- package/dist/cjs/commands/create.js +53 -0
- package/dist/cjs/commands/delete.d.ts +2 -0
- package/dist/cjs/commands/delete.js +63 -0
- package/dist/cjs/commands/examine.d.ts +2 -0
- package/dist/cjs/commands/examine.js +19 -0
- package/dist/cjs/commands/expunge.d.ts +2 -0
- package/dist/cjs/commands/expunge.js +32 -0
- package/dist/cjs/commands/fetch.d.ts +23 -0
- package/dist/cjs/commands/fetch.js +208 -0
- package/dist/cjs/commands/handlers/fetch.d.ts +12 -0
- package/dist/cjs/commands/handlers/fetch.js +195 -0
- package/dist/cjs/commands/handlers/flags.d.ts +17 -0
- package/dist/cjs/commands/handlers/flags.js +39 -0
- package/dist/cjs/commands/handlers/search.d.ts +85 -0
- package/dist/cjs/commands/handlers/search.js +504 -0
- package/dist/cjs/commands/handlers/status.d.ts +34 -0
- package/dist/cjs/commands/handlers/status.js +81 -0
- package/dist/cjs/commands/handlers/store.d.ts +3 -0
- package/dist/cjs/commands/handlers/store.js +117 -0
- package/dist/cjs/commands/index.d.ts +2 -0
- package/dist/cjs/commands/index.js +61 -0
- package/dist/cjs/commands/list.d.ts +2 -0
- package/dist/cjs/commands/list.js +86 -0
- package/dist/cjs/commands/login.d.ts +2 -0
- package/dist/cjs/commands/login.js +62 -0
- package/dist/cjs/commands/logout.d.ts +2 -0
- package/dist/cjs/commands/logout.js +40 -0
- package/dist/cjs/commands/lsub.d.ts +2 -0
- package/dist/cjs/commands/lsub.js +79 -0
- package/dist/cjs/commands/noop.d.ts +2 -0
- package/dist/cjs/commands/noop.js +28 -0
- package/dist/cjs/commands/rename.d.ts +2 -0
- package/dist/cjs/commands/rename.js +98 -0
- package/dist/cjs/commands/search.d.ts +10 -0
- package/dist/cjs/commands/search.js +71 -0
- package/dist/cjs/commands/select.d.ts +19 -0
- package/dist/cjs/commands/select.js +230 -0
- package/dist/cjs/commands/status.d.ts +2 -0
- package/dist/cjs/commands/status.js +57 -0
- package/dist/cjs/commands/store.d.ts +10 -0
- package/dist/cjs/commands/store.js +134 -0
- package/dist/cjs/commands/subscribe.d.ts +2 -0
- package/dist/cjs/commands/subscribe.js +51 -0
- package/dist/cjs/commands/uid-copy.d.ts +2 -0
- package/dist/cjs/commands/uid-copy.js +19 -0
- package/dist/cjs/commands/uid-fetch.d.ts +3 -0
- package/dist/cjs/commands/uid-fetch.js +17 -0
- package/dist/cjs/commands/uid-search.d.ts +3 -0
- package/dist/cjs/commands/uid-search.js +17 -0
- package/dist/cjs/commands/uid-store.d.ts +3 -0
- package/dist/cjs/commands/uid-store.js +17 -0
- package/dist/cjs/commands/unsubscribe.d.ts +2 -0
- package/dist/cjs/commands/unsubscribe.js +50 -0
- package/dist/cjs/dates.d.ts +64 -0
- package/dist/cjs/dates.js +124 -0
- package/dist/cjs/deflate-layer.d.ts +83 -0
- package/dist/cjs/deflate-layer.js +232 -0
- package/dist/cjs/encoded-words.d.ts +15 -0
- package/dist/cjs/encoded-words.js +85 -0
- package/dist/cjs/envelope.d.ts +33 -0
- package/dist/cjs/envelope.js +86 -0
- package/dist/cjs/esearch.d.ts +96 -0
- package/dist/cjs/esearch.js +190 -0
- package/dist/cjs/framing.d.ts +66 -0
- package/{lib → dist/cjs}/framing.js +9 -26
- package/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/index.js +56 -0
- package/dist/cjs/list-extensions.d.ts +50 -0
- package/dist/cjs/list-extensions.js +35 -0
- package/dist/cjs/load-plugins.d.ts +21 -0
- package/dist/cjs/load-plugins.js +89 -0
- package/dist/cjs/mailbox-name.d.ts +26 -0
- package/dist/cjs/mailbox-name.js +127 -0
- package/dist/cjs/mimeparser.d.ts +137 -0
- package/dist/cjs/mimeparser.js +727 -0
- package/dist/cjs/mock-client.d.ts +39 -0
- package/dist/cjs/mock-client.js +236 -0
- package/dist/cjs/numbers.d.ts +28 -0
- package/dist/cjs/numbers.js +52 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/plugins/acl.d.ts +2 -0
- package/dist/cjs/plugins/acl.js +888 -0
- package/dist/cjs/plugins/appendlimit.d.ts +16 -0
- package/dist/cjs/plugins/appendlimit.js +87 -0
- package/dist/cjs/plugins/auth-plain.d.ts +2 -0
- package/dist/cjs/plugins/auth-plain.js +89 -0
- package/dist/cjs/plugins/binary.d.ts +30 -0
- package/dist/cjs/plugins/binary.js +247 -0
- package/dist/cjs/plugins/catenate.d.ts +14 -0
- package/dist/cjs/plugins/catenate.js +250 -0
- package/dist/cjs/plugins/compress.d.ts +7 -0
- package/dist/cjs/plugins/compress.js +79 -0
- package/dist/cjs/plugins/condstore.d.ts +5 -0
- package/dist/cjs/plugins/condstore.js +492 -0
- package/dist/cjs/plugins/context-search.d.ts +8 -0
- package/dist/cjs/plugins/context-search.js +304 -0
- package/dist/cjs/plugins/context-sort.d.ts +6 -0
- package/dist/cjs/plugins/context-sort.js +32 -0
- package/dist/cjs/plugins/create-special-use.d.ts +7 -0
- package/dist/cjs/plugins/create-special-use.js +101 -0
- package/dist/cjs/plugins/enable.d.ts +23 -0
- package/dist/cjs/plugins/enable.js +127 -0
- package/dist/cjs/plugins/esearch.d.ts +6 -0
- package/dist/cjs/plugins/esearch.js +142 -0
- package/dist/cjs/plugins/esort.d.ts +6 -0
- package/dist/cjs/plugins/esort.js +60 -0
- package/dist/cjs/plugins/id.d.ts +5 -0
- package/dist/cjs/plugins/id.js +123 -0
- package/dist/cjs/plugins/idle.d.ts +5 -0
- package/dist/cjs/plugins/idle.js +85 -0
- package/dist/cjs/plugins/imap4rev2.d.ts +6 -0
- package/dist/cjs/plugins/imap4rev2.js +184 -0
- package/dist/cjs/plugins/index.d.ts +2 -0
- package/dist/cjs/plugins/index.js +119 -0
- package/dist/cjs/plugins/list-extended.d.ts +2 -0
- package/dist/cjs/plugins/list-extended.js +235 -0
- package/dist/cjs/plugins/list-status.d.ts +6 -0
- package/dist/cjs/plugins/list-status.js +42 -0
- package/dist/cjs/plugins/literalminus.d.ts +8 -0
- package/dist/cjs/plugins/literalminus.js +32 -0
- package/dist/cjs/plugins/literalplus.d.ts +6 -0
- package/dist/cjs/plugins/literalplus.js +30 -0
- package/dist/cjs/plugins/logindisabled.d.ts +5 -0
- package/dist/cjs/plugins/logindisabled.js +54 -0
- package/dist/cjs/plugins/messagelimit.d.ts +19 -0
- package/dist/cjs/plugins/messagelimit.js +227 -0
- package/dist/cjs/plugins/metadata-server.d.ts +7 -0
- package/dist/cjs/plugins/metadata-server.js +24 -0
- package/dist/cjs/plugins/metadata.d.ts +11 -0
- package/dist/cjs/plugins/metadata.js +436 -0
- package/dist/cjs/plugins/move.d.ts +11 -0
- package/dist/cjs/plugins/move.js +96 -0
- package/dist/cjs/plugins/multiappend.d.ts +12 -0
- package/dist/cjs/plugins/multiappend.js +38 -0
- package/dist/cjs/plugins/multisearch.d.ts +6 -0
- package/dist/cjs/plugins/multisearch.js +263 -0
- package/dist/cjs/plugins/namespace.d.ts +5 -0
- package/dist/cjs/plugins/namespace.js +57 -0
- package/dist/cjs/plugins/notify.d.ts +2 -0
- package/dist/cjs/plugins/notify.js +628 -0
- package/dist/cjs/plugins/oauthbearer.d.ts +32 -0
- package/dist/cjs/plugins/oauthbearer.js +202 -0
- package/dist/cjs/plugins/objectid.d.ts +23 -0
- package/dist/cjs/plugins/objectid.js +221 -0
- package/dist/cjs/plugins/partial.d.ts +6 -0
- package/dist/cjs/plugins/partial.js +78 -0
- package/dist/cjs/plugins/preview.d.ts +31 -0
- package/dist/cjs/plugins/preview.js +378 -0
- package/dist/cjs/plugins/qresync.d.ts +11 -0
- package/dist/cjs/plugins/qresync.js +473 -0
- package/dist/cjs/plugins/quota.d.ts +18 -0
- package/dist/cjs/plugins/quota.js +254 -0
- package/dist/cjs/plugins/replace.d.ts +14 -0
- package/dist/cjs/plugins/replace.js +130 -0
- package/dist/cjs/plugins/sasl-ir.d.ts +5 -0
- package/dist/cjs/plugins/sasl-ir.js +24 -0
- package/dist/cjs/plugins/savedate.d.ts +17 -0
- package/dist/cjs/plugins/savedate.js +64 -0
- package/dist/cjs/plugins/savelimit.d.ts +10 -0
- package/dist/cjs/plugins/savelimit.js +30 -0
- package/dist/cjs/plugins/searchres.d.ts +6 -0
- package/dist/cjs/plugins/searchres.js +91 -0
- package/dist/cjs/plugins/sort-display.d.ts +11 -0
- package/dist/cjs/plugins/sort-display.js +37 -0
- package/dist/cjs/plugins/sort.d.ts +11 -0
- package/dist/cjs/plugins/sort.js +125 -0
- package/dist/cjs/plugins/special-use.d.ts +10 -0
- package/dist/cjs/plugins/special-use.js +95 -0
- package/dist/cjs/plugins/starttls.d.ts +5 -0
- package/dist/cjs/plugins/starttls.js +55 -0
- package/dist/cjs/plugins/status-size.d.ts +7 -0
- package/dist/cjs/plugins/status-size.js +30 -0
- package/dist/cjs/plugins/thread-orderedsubject.d.ts +11 -0
- package/dist/cjs/plugins/thread-orderedsubject.js +28 -0
- package/dist/cjs/plugins/thread-references.d.ts +11 -0
- package/dist/cjs/plugins/thread-references.js +28 -0
- package/dist/cjs/plugins/uidonly.d.ts +15 -0
- package/dist/cjs/plugins/uidonly.js +126 -0
- package/dist/cjs/plugins/uidplus.d.ts +15 -0
- package/dist/cjs/plugins/uidplus.js +119 -0
- package/dist/cjs/plugins/unauthenticate.d.ts +7 -0
- package/dist/cjs/plugins/unauthenticate.js +32 -0
- package/dist/cjs/plugins/unselect.d.ts +5 -0
- package/dist/cjs/plugins/unselect.js +36 -0
- package/dist/cjs/plugins/utf8-accept.d.ts +6 -0
- package/dist/cjs/plugins/utf8-accept.js +72 -0
- package/dist/cjs/plugins/x-gm-ext-1.d.ts +26 -0
- package/dist/cjs/plugins/x-gm-ext-1.js +422 -0
- package/dist/cjs/plugins/xoauth2.d.ts +2 -0
- package/dist/cjs/plugins/xoauth2.js +155 -0
- package/dist/cjs/plugins/xtoybird.d.ts +2 -0
- package/dist/cjs/plugins/xtoybird.js +236 -0
- package/dist/cjs/server.d.ts +876 -0
- package/dist/cjs/server.js +2597 -0
- package/dist/cjs/smtp-listener.d.ts +13 -0
- package/dist/cjs/smtp-listener.js +47 -0
- package/dist/cjs/sorting.d.ts +77 -0
- package/dist/cjs/sorting.js +290 -0
- package/dist/cjs/threading.d.ts +30 -0
- package/dist/cjs/threading.js +318 -0
- package/dist/cjs/types.d.ts +327 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/utf8-session.d.ts +17 -0
- package/dist/cjs/utf8-session.js +148 -0
- package/dist/cjs/vanished.d.ts +21 -0
- package/dist/cjs/vanished.js +55 -0
- package/dist/esm/addressparser.d.ts +21 -0
- package/{lib → dist/esm}/addressparser.js +102 -123
- package/dist/esm/arguments.d.ts +31 -0
- package/dist/esm/arguments.js +96 -0
- package/dist/esm/bodystructure.d.ts +25 -0
- package/{lib → dist/esm}/bodystructure.js +17 -33
- package/dist/esm/cert.d.ts +2 -0
- package/dist/esm/cert.js +4 -0
- package/dist/esm/command-states.d.ts +36 -0
- package/{lib → dist/esm}/command-states.js +4 -16
- package/dist/esm/commands/append.d.ts +88 -0
- package/{lib → dist/esm}/commands/append.js +47 -85
- package/dist/esm/commands/capability.d.ts +2 -0
- package/dist/esm/commands/capability.js +29 -0
- package/dist/esm/commands/check.d.ts +2 -0
- package/dist/esm/commands/check.js +13 -0
- package/dist/esm/commands/close.d.ts +2 -0
- package/dist/esm/commands/close.js +20 -0
- package/dist/esm/commands/copy.d.ts +30 -0
- package/{lib → dist/esm}/commands/copy.js +31 -55
- package/dist/esm/commands/create.d.ts +2 -0
- package/{lib → dist/esm}/commands/create.js +25 -39
- package/dist/esm/commands/delete.d.ts +2 -0
- package/{lib → dist/esm}/commands/delete.js +25 -41
- package/dist/esm/commands/examine.d.ts +2 -0
- package/dist/esm/commands/examine.js +4 -0
- package/dist/esm/commands/expunge.d.ts +2 -0
- package/dist/esm/commands/expunge.js +17 -0
- package/dist/esm/commands/fetch.d.ts +23 -0
- package/{lib → dist/esm}/commands/fetch.js +34 -75
- package/dist/esm/commands/handlers/fetch.d.ts +12 -0
- package/{lib → dist/esm}/commands/handlers/fetch.js +11 -42
- package/dist/esm/commands/handlers/flags.d.ts +17 -0
- package/{lib → dist/esm}/commands/handlers/flags.js +3 -11
- package/dist/esm/commands/handlers/search.d.ts +85 -0
- package/{lib → dist/esm}/commands/handlers/search.js +33 -71
- package/dist/esm/commands/handlers/status.d.ts +34 -0
- package/{lib → dist/esm}/commands/handlers/status.js +1 -9
- package/dist/esm/commands/handlers/store.d.ts +3 -0
- package/{lib → dist/esm}/commands/handlers/store.js +20 -44
- package/dist/esm/commands/index.d.ts +2 -0
- package/dist/esm/commands/index.js +55 -0
- package/dist/esm/commands/list.d.ts +2 -0
- package/dist/esm/commands/list.js +71 -0
- package/dist/esm/commands/login.d.ts +2 -0
- package/{lib → dist/esm}/commands/login.js +24 -44
- package/dist/esm/commands/logout.d.ts +2 -0
- package/dist/esm/commands/logout.js +25 -0
- package/dist/esm/commands/lsub.d.ts +2 -0
- package/dist/esm/commands/lsub.js +64 -0
- package/dist/esm/commands/noop.d.ts +2 -0
- package/dist/esm/commands/noop.js +13 -0
- package/dist/esm/commands/rename.d.ts +2 -0
- package/{lib → dist/esm}/commands/rename.js +32 -51
- package/dist/esm/commands/search.d.ts +10 -0
- package/dist/esm/commands/search.js +54 -0
- package/dist/esm/commands/select.d.ts +19 -0
- package/dist/esm/commands/select.js +214 -0
- package/dist/esm/commands/status.d.ts +2 -0
- package/{lib → dist/esm}/commands/status.js +18 -39
- package/dist/esm/commands/store.d.ts +10 -0
- package/{lib → dist/esm}/commands/store.js +39 -73
- package/dist/esm/commands/subscribe.d.ts +2 -0
- package/{lib → dist/esm}/commands/subscribe.js +22 -39
- package/dist/esm/commands/uid-copy.d.ts +2 -0
- package/dist/esm/commands/uid-copy.js +4 -0
- package/dist/esm/commands/uid-fetch.d.ts +3 -0
- package/dist/esm/commands/uid-fetch.js +3 -0
- package/dist/esm/commands/uid-search.d.ts +3 -0
- package/dist/esm/commands/uid-search.js +3 -0
- package/dist/esm/commands/uid-store.d.ts +3 -0
- package/dist/esm/commands/uid-store.js +3 -0
- package/dist/esm/commands/unsubscribe.d.ts +2 -0
- package/{lib → dist/esm}/commands/unsubscribe.js +22 -37
- package/dist/esm/dates.d.ts +64 -0
- package/{lib → dist/esm}/dates.js +6 -14
- package/dist/esm/deflate-layer.d.ts +83 -0
- package/{lib → dist/esm}/deflate-layer.js +9 -26
- package/dist/esm/encoded-words.d.ts +15 -0
- package/{lib → dist/esm}/encoded-words.js +9 -25
- package/dist/esm/envelope.d.ts +33 -0
- package/{lib → dist/esm}/envelope.js +8 -19
- package/dist/esm/esearch.d.ts +96 -0
- package/{lib → dist/esm}/esearch.js +12 -39
- package/dist/esm/framing.d.ts +66 -0
- package/dist/esm/framing.js +82 -0
- package/dist/esm/index.d.ts +9 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/list-extensions.d.ts +50 -0
- package/{lib → dist/esm}/list-extensions.js +1 -4
- package/dist/esm/load-plugins.d.ts +21 -0
- package/{lib → dist/esm}/load-plugins.js +9 -43
- package/dist/esm/mailbox-name.d.ts +26 -0
- package/{lib → dist/esm}/mailbox-name.js +5 -26
- package/dist/esm/mimeparser.d.ts +137 -0
- package/{lib → dist/esm}/mimeparser.js +74 -152
- package/dist/esm/mock-client.d.ts +39 -0
- package/{lib → dist/esm}/mock-client.js +26 -40
- package/dist/esm/numbers.d.ts +28 -0
- package/{lib → dist/esm}/numbers.js +1 -8
- package/dist/esm/package.json +3 -0
- package/dist/esm/plugins/acl.d.ts +2 -0
- package/{lib → dist/esm}/plugins/acl.js +146 -240
- package/dist/esm/plugins/appendlimit.d.ts +16 -0
- package/{lib → dist/esm}/plugins/appendlimit.js +5 -16
- package/dist/esm/plugins/auth-plain.d.ts +2 -0
- package/{lib → dist/esm}/plugins/auth-plain.js +11 -31
- package/dist/esm/plugins/binary.d.ts +30 -0
- package/{lib → dist/esm}/plugins/binary.js +17 -43
- package/dist/esm/plugins/catenate.d.ts +14 -0
- package/{lib → dist/esm}/plugins/catenate.js +19 -40
- package/dist/esm/plugins/compress.d.ts +7 -0
- package/dist/esm/plugins/compress.js +61 -0
- package/dist/esm/plugins/condstore.d.ts +5 -0
- package/{lib → dist/esm}/plugins/condstore.js +66 -152
- package/dist/esm/plugins/context-search.d.ts +8 -0
- package/{lib → dist/esm}/plugins/context-search.js +53 -88
- package/dist/esm/plugins/context-sort.d.ts +6 -0
- package/{lib → dist/esm}/plugins/context-sort.js +4 -9
- package/dist/esm/plugins/create-special-use.d.ts +7 -0
- package/{lib → dist/esm}/plugins/create-special-use.js +33 -55
- package/dist/esm/plugins/enable.d.ts +23 -0
- package/dist/esm/plugins/enable.js +111 -0
- package/dist/esm/plugins/esearch.d.ts +6 -0
- package/{lib → dist/esm}/plugins/esearch.js +13 -42
- package/dist/esm/plugins/esort.d.ts +6 -0
- package/{lib → dist/esm}/plugins/esort.js +7 -25
- package/dist/esm/plugins/id.d.ts +5 -0
- package/dist/esm/plugins/id.js +108 -0
- package/dist/esm/plugins/idle.d.ts +5 -0
- package/dist/esm/plugins/idle.js +70 -0
- package/dist/esm/plugins/imap4rev2.d.ts +6 -0
- package/{lib → dist/esm}/plugins/imap4rev2.js +24 -60
- package/dist/esm/plugins/index.d.ts +2 -0
- package/dist/esm/plugins/index.js +113 -0
- package/dist/esm/plugins/list-extended.d.ts +2 -0
- package/{lib → dist/esm}/plugins/list-extended.js +28 -66
- package/dist/esm/plugins/list-status.d.ts +6 -0
- package/{lib → dist/esm}/plugins/list-status.js +5 -12
- package/dist/esm/plugins/literalminus.d.ts +8 -0
- package/{lib → dist/esm}/plugins/literalminus.js +2 -5
- package/dist/esm/plugins/literalplus.d.ts +6 -0
- package/{lib → dist/esm}/plugins/literalplus.js +2 -5
- package/dist/esm/plugins/logindisabled.d.ts +5 -0
- package/dist/esm/plugins/logindisabled.js +39 -0
- package/dist/esm/plugins/messagelimit.d.ts +19 -0
- package/{lib → dist/esm}/plugins/messagelimit.js +18 -41
- package/dist/esm/plugins/metadata-server.d.ts +7 -0
- package/{lib → dist/esm}/plugins/metadata-server.js +3 -7
- package/dist/esm/plugins/metadata.d.ts +11 -0
- package/dist/esm/plugins/metadata.js +421 -0
- package/dist/esm/plugins/move.d.ts +11 -0
- package/{lib → dist/esm}/plugins/move.js +37 -66
- package/dist/esm/plugins/multiappend.d.ts +12 -0
- package/{lib → dist/esm}/plugins/multiappend.js +2 -5
- package/dist/esm/plugins/multisearch.d.ts +6 -0
- package/{lib → dist/esm}/plugins/multisearch.js +24 -48
- package/dist/esm/plugins/namespace.d.ts +5 -0
- package/dist/esm/plugins/namespace.js +42 -0
- package/dist/esm/plugins/notify.d.ts +2 -0
- package/{lib → dist/esm}/plugins/notify.js +90 -134
- package/dist/esm/plugins/oauthbearer.d.ts +32 -0
- package/{lib → dist/esm}/plugins/oauthbearer.js +18 -48
- package/dist/esm/plugins/objectid.d.ts +23 -0
- package/{lib → dist/esm}/plugins/objectid.js +21 -58
- package/dist/esm/plugins/partial.d.ts +6 -0
- package/{lib → dist/esm}/plugins/partial.js +7 -15
- package/dist/esm/plugins/preview.d.ts +31 -0
- package/{lib → dist/esm}/plugins/preview.js +28 -66
- package/dist/esm/plugins/qresync.d.ts +11 -0
- package/{lib → dist/esm}/plugins/qresync.js +64 -134
- package/dist/esm/plugins/quota.d.ts +18 -0
- package/{lib → dist/esm}/plugins/quota.js +89 -135
- package/dist/esm/plugins/replace.d.ts +14 -0
- package/{lib → dist/esm}/plugins/replace.js +21 -51
- package/dist/esm/plugins/sasl-ir.d.ts +5 -0
- package/{lib → dist/esm}/plugins/sasl-ir.js +3 -6
- package/dist/esm/plugins/savedate.d.ts +17 -0
- package/{lib → dist/esm}/plugins/savedate.js +5 -15
- package/dist/esm/plugins/savelimit.d.ts +10 -0
- package/{lib → dist/esm}/plugins/savelimit.js +3 -6
- package/dist/esm/plugins/searchres.d.ts +6 -0
- package/{lib → dist/esm}/plugins/searchres.js +13 -22
- package/dist/esm/plugins/sort-display.d.ts +11 -0
- package/{lib → dist/esm}/plugins/sort-display.js +6 -10
- package/dist/esm/plugins/sort.d.ts +11 -0
- package/{lib → dist/esm}/plugins/sort.js +24 -46
- package/dist/esm/plugins/special-use.d.ts +10 -0
- package/{lib → dist/esm}/plugins/special-use.js +9 -24
- package/dist/esm/plugins/starttls.d.ts +5 -0
- package/{lib → dist/esm}/plugins/starttls.js +20 -37
- package/dist/esm/plugins/status-size.d.ts +7 -0
- package/{lib → dist/esm}/plugins/status-size.js +4 -11
- package/dist/esm/plugins/thread-orderedsubject.d.ts +11 -0
- package/{lib → dist/esm}/plugins/thread-orderedsubject.js +3 -6
- package/dist/esm/plugins/thread-references.d.ts +11 -0
- package/{lib → dist/esm}/plugins/thread-references.js +3 -6
- package/dist/esm/plugins/uidonly.d.ts +15 -0
- package/{lib → dist/esm}/plugins/uidonly.js +11 -35
- package/dist/esm/plugins/uidplus.d.ts +15 -0
- package/{lib → dist/esm}/plugins/uidplus.js +25 -45
- package/dist/esm/plugins/unauthenticate.d.ts +7 -0
- package/dist/esm/plugins/unauthenticate.js +17 -0
- package/dist/esm/plugins/unselect.d.ts +5 -0
- package/dist/esm/plugins/unselect.js +21 -0
- package/dist/esm/plugins/utf8-accept.d.ts +6 -0
- package/{lib → dist/esm}/plugins/utf8-accept.js +10 -21
- package/dist/esm/plugins/x-gm-ext-1.d.ts +26 -0
- package/{lib → dist/esm}/plugins/x-gm-ext-1.js +48 -100
- package/dist/esm/plugins/xoauth2.d.ts +2 -0
- package/dist/esm/plugins/xoauth2.js +140 -0
- package/dist/esm/plugins/xtoybird.d.ts +2 -0
- package/dist/esm/plugins/xtoybird.js +218 -0
- package/dist/esm/server.d.ts +876 -0
- package/dist/esm/server.js +2543 -0
- package/dist/esm/smtp-listener.d.ts +13 -0
- package/{lib → dist/esm}/smtp-listener.js +5 -12
- package/dist/esm/sorting.d.ts +77 -0
- package/{lib → dist/esm}/sorting.js +40 -53
- package/dist/esm/threading.d.ts +30 -0
- package/{lib → dist/esm}/threading.js +29 -70
- package/dist/esm/types.d.ts +327 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/utf8-session.d.ts +17 -0
- package/{lib → dist/esm}/utf8-session.js +15 -25
- package/dist/esm/vanished.d.ts +21 -0
- package/{lib → dist/esm}/vanished.js +16 -21
- package/dist/plugin-help.json +298 -0
- package/package.json +54 -11
- package/lib/commands/capability.js +0 -47
- package/lib/commands/check.js +0 -21
- package/lib/commands/close.js +0 -30
- package/lib/commands/examine.js +0 -7
- package/lib/commands/expunge.js +0 -27
- package/lib/commands/list.js +0 -100
- package/lib/commands/logout.js +0 -41
- package/lib/commands/lsub.js +0 -87
- package/lib/commands/noop.js +0 -21
- package/lib/commands/search.js +0 -76
- package/lib/commands/select.js +0 -289
- package/lib/commands/uid copy.js +0 -7
- package/lib/commands/uid fetch.js +0 -5
- package/lib/commands/uid search.js +0 -5
- package/lib/commands/uid store.js +0 -5
- package/lib/plugins/compress.js +0 -76
- package/lib/plugins/enable.js +0 -155
- package/lib/plugins/id.js +0 -138
- package/lib/plugins/idle.js +0 -105
- package/lib/plugins/logindisabled.js +0 -50
- package/lib/plugins/metadata.js +0 -475
- package/lib/plugins/namespace.js +0 -67
- package/lib/plugins/unauthenticate.js +0 -28
- package/lib/plugins/unselect.js +0 -36
- package/lib/plugins/xoauth2.js +0 -188
- package/lib/plugins/xtoybird.js +0 -282
- package/lib/server.js +0 -2880
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = messagelimitPlugin;
|
|
4
|
+
exports.getLimit = getLimit;
|
|
5
|
+
exports.addSaveLimit = addSaveLimit;
|
|
6
|
+
const search_js_1 = require("../commands/handlers/search.js");
|
|
7
|
+
const esearch_js_1 = require("../esearch.js");
|
|
8
|
+
const numbers_js_1 = require("../numbers.js");
|
|
9
|
+
/**
|
|
10
|
+
* @help Adds MESSAGELIMIT [RFC9738] capability, advertised as MESSAGELIMIT=<n>
|
|
11
|
+
* @help Server option "messageLimit" sets n (default 1000). FETCH, STORE, SEARCH, MOVE, UID EXPUNGE
|
|
12
|
+
* @help and their UID variants only work on the n messages with the highest UIDs and add
|
|
13
|
+
* @help [MESSAGELIMIT n uid] to the tagged OK. COPY, APPEND (MULTIAPPEND), SORT and THREAD of
|
|
14
|
+
* @help more messages fail with NO [MESSAGELIMIT ...]. Adds the UIDAFTER and UIDBEFORE search keys.
|
|
15
|
+
* @help Can not be loaded with SAVELIMIT
|
|
16
|
+
*
|
|
17
|
+
* MESSAGELIMIT: https://www.rfc-editor.org/rfc/rfc9738
|
|
18
|
+
*/
|
|
19
|
+
// RFC 9738 section 3: the advertised limit SHOULD NOT be lower than 1000
|
|
20
|
+
const DEFAULT_LIMIT = 1000;
|
|
21
|
+
// RFC 9738 section 3.1: commands that operate on the messages with the highest UIDs and return the MESSAGELIMIT response code.
|
|
22
|
+
// EXPUNGE, CLOSE and STATUS UNSEEN MUST NOT be limited
|
|
23
|
+
const PARTIAL_COMMANDS = new Set(['FETCH', 'UID FETCH', 'STORE', 'UID STORE', 'MOVE', 'UID MOVE', 'UID EXPUNGE']);
|
|
24
|
+
const SEARCH_COMMANDS = new Set(['SEARCH', 'UID SEARCH']);
|
|
25
|
+
// RFC 9738 section 3.3: SORT and THREAD can not be run on more messages than the limit
|
|
26
|
+
const SORT_COMMANDS = new Set(['SORT', 'UID SORT', 'THREAD', 'UID THREAD']);
|
|
27
|
+
/**
|
|
28
|
+
* Reads the limit from the "messageLimit" server option
|
|
29
|
+
*
|
|
30
|
+
* @param {Object} server IMAPServer
|
|
31
|
+
* @param {String} name Capability name for the error message
|
|
32
|
+
* @return {Number} limit
|
|
33
|
+
*/
|
|
34
|
+
function getLimit(server, name) {
|
|
35
|
+
if (server.messageLimit) {
|
|
36
|
+
// RFC 9738 section 3: SAVELIMIT is advertised instead of MESSAGELIMIT, never both
|
|
37
|
+
throw new Error(name + ' can not be enabled together with ' + server.messageLimit.name);
|
|
38
|
+
}
|
|
39
|
+
const limit = 'messageLimit' in server.options ? server.options.messageLimit : DEFAULT_LIMIT;
|
|
40
|
+
// message-limit = nz-number
|
|
41
|
+
if (!Number.isSafeInteger(limit) || limit < 1 || limit > numbers_js_1.MAX_NUMBER) {
|
|
42
|
+
throw new TypeError('Invalid messageLimit option, expecting a positive integer');
|
|
43
|
+
}
|
|
44
|
+
server.messageLimit = { name, limit };
|
|
45
|
+
return limit;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Refuses COPY and APPEND of more messages than the limit, shared with the SAVELIMIT plugin. COPY and
|
|
49
|
+
* MULTIAPPEND APPEND are atomic, so nothing is copied or appended (RFC 9738 section 3.1)
|
|
50
|
+
*
|
|
51
|
+
* @param {Object} server IMAPServer
|
|
52
|
+
* @param {Number} limit Message limit
|
|
53
|
+
*/
|
|
54
|
+
function addSaveLimit(server, limit) {
|
|
55
|
+
server.appendChecks.push((connection, mailbox, messages, options) => {
|
|
56
|
+
if (messages.length <= limit) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
if (options.command) {
|
|
60
|
+
return { code: ['MESSAGELIMIT', limit], text: options.command + ' exceeds the limit of ' + limit + ' messages, nothing was appended' };
|
|
61
|
+
}
|
|
62
|
+
// MOVE is not atomic, it is cut to the limit before it gets here
|
|
63
|
+
if (!options.move) {
|
|
64
|
+
// the lowest UID the command would have processed, the messages are in UID order
|
|
65
|
+
const lastUid = messages[messages.length - limit].uid;
|
|
66
|
+
return { code: ['MESSAGELIMIT', limit, lastUid], text: 'Too many messages to copy, try a smaller subset' };
|
|
67
|
+
}
|
|
68
|
+
return false;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function messagelimitPlugin(server) {
|
|
72
|
+
const limit = getLimit(server, 'MESSAGELIMIT');
|
|
73
|
+
server.registerCapability('MESSAGELIMIT=' + limit);
|
|
74
|
+
addSaveLimit(server, limit);
|
|
75
|
+
const commandName = (parsed) => String(parsed.command || '').toUpperCase();
|
|
76
|
+
// FETCH, STORE, MOVE and UID EXPUNGE only operate on the messages with the highest UIDs, "the server is REQUIRED
|
|
77
|
+
// to process messages from highest to lowest UID". COPY is refused by addSaveLimit instead
|
|
78
|
+
server.rangeLimits.push((connection, parsed, range) => {
|
|
79
|
+
const command = commandName(parsed);
|
|
80
|
+
// a FETCH with the PARTIAL modifier was checked before it ran, its range is not cut
|
|
81
|
+
if (!PARTIAL_COMMANDS.has(command) || parsed.partialFetch) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
// UID EXPUNGE only operates on the \Deleted messages of the set
|
|
85
|
+
const operated = command === 'UID EXPUNGE' ? range.filter(entry => entry[1].flags.indexOf('\\Deleted') >= 0) : range;
|
|
86
|
+
if (operated.length <= limit) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
const dropped = new Set(operated.slice(0, -limit));
|
|
90
|
+
parsed.messageLimitUid = operated[operated.length - limit][1].uid;
|
|
91
|
+
// section 3.1: "when the MESSAGELIMIT response code is returned, the server is REQUIRED to process messages
|
|
92
|
+
// from highest to lowest UID", the FETCH, STORE, MOVE and UID EXPUNGE examples respond in that order
|
|
93
|
+
parsed.highestFirst = true;
|
|
94
|
+
return range.filter(entry => !dropped.has(entry)).reverse();
|
|
95
|
+
});
|
|
96
|
+
// RFC 9738 section 3.1: with the PARTIAL FETCH modifier (RFC 9394 section 3.3), the PARTIAL range is the message
|
|
97
|
+
// count, a larger range is refused without doing any work. The PARTIAL plugin answers an invalid modifier with BAD
|
|
98
|
+
server.commandChecks.push((connection, parsed) => {
|
|
99
|
+
const modifiers = server.capabilities.PARTIAL && parsed.attributes && parsed.attributes[2];
|
|
100
|
+
const command = commandName(parsed);
|
|
101
|
+
if (!Array.isArray(modifiers) || (command !== 'FETCH' && command !== 'UID FETCH')) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
const position = modifiers.findIndex((item, i) => !(i % 2) && item && item.type === 'ATOM' && String(item.value).toUpperCase() === 'PARTIAL');
|
|
105
|
+
let range;
|
|
106
|
+
try {
|
|
107
|
+
range = position >= 0 && (0, esearch_js_1.parsePartialRange)(modifiers[position + 1], true);
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
if (range && range.to - range.from + 1 > limit) {
|
|
113
|
+
return { command: 'NO', code: ['MESSAGELIMIT', limit], text: command + ' exceeds the limit of ' + limit + ' messages' };
|
|
114
|
+
}
|
|
115
|
+
return false;
|
|
116
|
+
});
|
|
117
|
+
// RFC 9738 section 3.1: SEARCH counts the searched messages, not the matching ones. The messages a search
|
|
118
|
+
// looks at are the ones its top level sequence set, UID, UIDAFTER and UIDBEFORE keys allow
|
|
119
|
+
server.searchLimits.push((connection, messages, query) => {
|
|
120
|
+
// the running command, SEARCH and SORT do not pass it to the search
|
|
121
|
+
const parsed = connection._runningCommand && connection._runningCommand.parsed;
|
|
122
|
+
const command = parsed ? commandName(parsed) : '';
|
|
123
|
+
if (messages.length <= limit || (!SEARCH_COMMANDS.has(command) && !SORT_COMMANDS.has(command))) {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
const candidates = messages.filter(message => isCandidate(query, message));
|
|
127
|
+
if (candidates.length <= limit) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
if (SORT_COMMANDS.has(command)) {
|
|
131
|
+
const err = new Error(command + ' exceeds the limit of ' + limit + ' messages, narrow it down with UIDAFTER or UIDBEFORE');
|
|
132
|
+
err.imapResponse = 'NO';
|
|
133
|
+
err.responseCode = ['MESSAGELIMIT', limit];
|
|
134
|
+
throw err;
|
|
135
|
+
}
|
|
136
|
+
// with SEARCHRES, only these results are saved in "$" (RFC 9738 section 3.4)
|
|
137
|
+
parsed.messageLimitUid = candidates[candidates.length - limit].uid;
|
|
138
|
+
return candidates.slice(-limit);
|
|
139
|
+
});
|
|
140
|
+
// RFC 9738 section 3.2: UIDAFTER <uid> is "UID <uid>+1:*", UIDBEFORE <uid> is "UID 1:<uid>-1"
|
|
141
|
+
const parseUniqueId = (value) => {
|
|
142
|
+
// uniqueid = nz-number
|
|
143
|
+
if (!(0, numbers_js_1.isNzNumber)(value)) {
|
|
144
|
+
throw (0, search_js_1.badError)('UIDAFTER and UIDBEFORE expect a UID');
|
|
145
|
+
}
|
|
146
|
+
return Number(value);
|
|
147
|
+
};
|
|
148
|
+
const uidAfter = (connection, message, index, uid) => message.uid > uid;
|
|
149
|
+
uidAfter.argumentTypes = () => [parseUniqueId];
|
|
150
|
+
const uidBefore = (connection, message, index, uid) => message.uid < uid;
|
|
151
|
+
uidBefore.argumentTypes = () => [parseUniqueId];
|
|
152
|
+
server.searchHandlers.UIDAFTER = uidAfter;
|
|
153
|
+
server.searchHandlers.UIDBEFORE = uidBefore;
|
|
154
|
+
const outputHandler = (connection, response, description, parsed, data) => {
|
|
155
|
+
// section 3.1 UID SEARCH example: the results go from the highest UID down, (MODSEQ n) of CONDSTORE stays last
|
|
156
|
+
if (parsed && parsed.messageLimitUid && response.tag === '*' && response.command === 'SEARCH' && Array.isArray(response.attributes)) {
|
|
157
|
+
const modseq = response.attributes.filter(Array.isArray);
|
|
158
|
+
response.attributes = response.attributes
|
|
159
|
+
.filter(attr => !Array.isArray(attr))
|
|
160
|
+
.reverse()
|
|
161
|
+
.concat(modseq);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (!parsed || !parsed.messageLimitUid || response.tag !== parsed.tag) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const lastUid = parsed.messageLimitUid;
|
|
168
|
+
parsed.messageLimitUid = false;
|
|
169
|
+
if (response.command !== 'OK') {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
// resp-text-code =/ "MESSAGELIMIT" SP message-limit [SP uniqueid]
|
|
173
|
+
const code = { type: 'SECTION', section: [{ type: 'ATOM', value: 'MESSAGELIMIT' }, limit, lastUid] };
|
|
174
|
+
const attributes = response.attributes || [];
|
|
175
|
+
if (attributes[0] && attributes[0].type === 'SECTION') {
|
|
176
|
+
// RFC 9738 section 3.1: when the tagged OK carries another response code (EXPUNGEISSUED there, and here
|
|
177
|
+
// also HIGHESTMODSEQ, MODIFIED), MESSAGELIMIT is sent in an untagged NO
|
|
178
|
+
connection.send({
|
|
179
|
+
tag: '*',
|
|
180
|
+
command: 'NO',
|
|
181
|
+
attributes: [code, { type: 'TEXT', value: 'Only the last ' + limit + ' messages were processed' }]
|
|
182
|
+
}, 'MESSAGELIMIT', parsed, data);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
response.attributes = [code].concat(attributes);
|
|
186
|
+
};
|
|
187
|
+
// registered once every plugin is loaded, so that the response codes other plugins add to the tagged OK
|
|
188
|
+
// are already there
|
|
189
|
+
server.once('pluginsLoaded', () => server.outputHandlers.push(outputHandler));
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Checks if a message passes the keys of a search query that every match must pass: sequence sets,
|
|
193
|
+
* UID, UIDAFTER and UIDBEFORE at the top level, or in parenthesized lists at the top level
|
|
194
|
+
*
|
|
195
|
+
* @param {Object} node AND node of the query tree, see commands/handlers/search.ts
|
|
196
|
+
* @param {Object} message Message
|
|
197
|
+
* @return {Boolean} true if the message has to be searched
|
|
198
|
+
*/
|
|
199
|
+
function isCandidate(node, message) {
|
|
200
|
+
return node.args.every((arg) => {
|
|
201
|
+
switch (arg.key) {
|
|
202
|
+
case 'AND':
|
|
203
|
+
return isCandidate(arg, message);
|
|
204
|
+
case '_SEQ':
|
|
205
|
+
case 'UID':
|
|
206
|
+
return arg.set.has(message);
|
|
207
|
+
case 'UIDAFTER':
|
|
208
|
+
return message.uid > arg.args[0];
|
|
209
|
+
case 'UIDBEFORE':
|
|
210
|
+
return message.uid < arg.args[0];
|
|
211
|
+
default:
|
|
212
|
+
return true;
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
{
|
|
217
|
+
const defaultExport = exports.default;
|
|
218
|
+
if (defaultExport && (typeof defaultExport === 'function' || typeof defaultExport === 'object')) {
|
|
219
|
+
for (const key of Object.keys(exports)) {
|
|
220
|
+
if (key !== 'default' && !(key in defaultExport)) {
|
|
221
|
+
defaultExport[key] = exports[key];
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
Object.defineProperty(defaultExport, 'default', { value: defaultExport, enumerable: false, writable: true, configurable: true });
|
|
225
|
+
module.exports = defaultExport;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IMAPServer } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* @help Adds METADATA-SERVER [RFC5464] capability, like METADATA but
|
|
4
|
+
* @help only for server annotations (mailbox name ""). With METADATA
|
|
5
|
+
* @help also loaded, only METADATA is advertised
|
|
6
|
+
*/
|
|
7
|
+
export default function metadataServerPlugin(server: IMAPServer): void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = metadataServerPlugin;
|
|
4
|
+
const metadata_js_1 = require("./metadata.js");
|
|
5
|
+
/**
|
|
6
|
+
* @help Adds METADATA-SERVER [RFC5464] capability, like METADATA but
|
|
7
|
+
* @help only for server annotations (mailbox name ""). With METADATA
|
|
8
|
+
* @help also loaded, only METADATA is advertised
|
|
9
|
+
*/
|
|
10
|
+
function metadataServerPlugin(server) {
|
|
11
|
+
(0, metadata_js_1.setup)(server, false);
|
|
12
|
+
}
|
|
13
|
+
{
|
|
14
|
+
const defaultExport = exports.default;
|
|
15
|
+
if (defaultExport && (typeof defaultExport === 'function' || typeof defaultExport === 'object')) {
|
|
16
|
+
for (const key of Object.keys(exports)) {
|
|
17
|
+
if (key !== 'default' && !(key in defaultExport)) {
|
|
18
|
+
defaultExport[key] = exports[key];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(defaultExport, 'default', { value: defaultExport, enumerable: false, writable: true, configurable: true });
|
|
22
|
+
module.exports = defaultExport;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IMAPServer } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Sets up METADATA or METADATA-SERVER. With both plugins loaded, METADATA wins (RFC 5464 section 1:
|
|
4
|
+
* a server with mailbox annotations advertises METADATA)
|
|
5
|
+
*
|
|
6
|
+
* @param {Object} server IMAPServer instance
|
|
7
|
+
* @param {Boolean} mailboxes If true, mailbox annotations are supported, otherwise only server annotations
|
|
8
|
+
*/
|
|
9
|
+
declare function setup(server: IMAPServer, mailboxes: boolean): void;
|
|
10
|
+
export default function metadataPlugin(server: IMAPServer): void;
|
|
11
|
+
export { setup };
|