imapkit 4.0.3 → 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 +33 -74
- 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
|
@@ -1,26 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const mailboxName = require('./mailbox-name');
|
|
5
|
-
const { isEnabled } = require('./plugins/enable');
|
|
6
|
-
|
|
1
|
+
import { isUtf8 } from 'node:buffer';
|
|
2
|
+
import mailboxName, { encode as encodeMailboxName, decode as decodeMailboxName } from './mailbox-name.js';
|
|
3
|
+
import { isEnabled } from './plugins/enable.js';
|
|
7
4
|
/**
|
|
8
5
|
* UTF-8 support of a session, shared by the UTF8=ACCEPT (RFC 9755) and IMAP4rev2 (RFC 9051) plugins. Both
|
|
9
6
|
* turn on UTF-8 mailbox names and quoted strings with ENABLE, and they can be loaded in any order, so the
|
|
10
7
|
* state of a session is always computed from what it has enabled, see updateSession().
|
|
11
8
|
*/
|
|
12
|
-
|
|
13
9
|
// RFC 9755 section 3: mailbox names MUST NOT contain control characters, DEL, LINE SEPARATOR or
|
|
14
10
|
// PARAGRAPH SEPARATOR. RFC 5198 section 2 (Net-Unicode) also forbids a leading BOM and unassigned code points
|
|
15
11
|
// eslint-disable-next-line no-control-regex
|
|
16
12
|
const INVALID_NAME_CHARS = /[\u0000-\u001f\u007f-\u009f\u2028\u2029]|^\ufeff|\p{Cn}/u;
|
|
17
|
-
|
|
18
13
|
function badError(message) {
|
|
19
14
|
const err = new Error(message);
|
|
20
15
|
err.imapResponse = 'BAD';
|
|
21
16
|
return err;
|
|
22
17
|
}
|
|
23
|
-
|
|
24
18
|
/**
|
|
25
19
|
* Throws a BAD error for a mailbox name that is not Net-Unicode (RFC 9755 section 3, RFC 9051 section 5.1).
|
|
26
20
|
* RFC 5198 section 2 also requires Normalization Form C
|
|
@@ -37,7 +31,6 @@ function checkNetUnicode(decoded) {
|
|
|
37
31
|
}
|
|
38
32
|
return decoded;
|
|
39
33
|
}
|
|
40
|
-
|
|
41
34
|
/**
|
|
42
35
|
* Checks a modified UTF-7 mailbox name from a client that did not enable UTF-8. The RFC 9755
|
|
43
36
|
* section 3 rules apply to these names as well, e.g. "&AA0-" encodes CR
|
|
@@ -51,10 +44,9 @@ function importMutf7Name(name) {
|
|
|
51
44
|
if (error) {
|
|
52
45
|
throw badError(error);
|
|
53
46
|
}
|
|
54
|
-
checkNetUnicode(
|
|
47
|
+
checkNetUnicode(decodeMailboxName(name));
|
|
55
48
|
return name;
|
|
56
49
|
}
|
|
57
|
-
|
|
58
50
|
/**
|
|
59
51
|
* Converts a UTF-8 mailbox name from the client to the modified UTF-7 storage name
|
|
60
52
|
*
|
|
@@ -64,9 +56,8 @@ function importMutf7Name(name) {
|
|
|
64
56
|
*/
|
|
65
57
|
function importUtf8Name(name) {
|
|
66
58
|
const buf = Buffer.from(name, 'binary');
|
|
67
|
-
return
|
|
59
|
+
return encodeMailboxName(checkNetUnicode(isUtf8(buf) && buf.toString('utf-8')));
|
|
68
60
|
}
|
|
69
|
-
|
|
70
61
|
/**
|
|
71
62
|
* Converts a modified UTF-7 storage name to UTF-8. A name that is not valid modified UTF-7
|
|
72
63
|
* is sent as it is.
|
|
@@ -75,10 +66,9 @@ function importUtf8Name(name) {
|
|
|
75
66
|
* @return {String} Mailbox name as a binary string
|
|
76
67
|
*/
|
|
77
68
|
function exportUtf8Name(path) {
|
|
78
|
-
const decoded =
|
|
69
|
+
const decoded = decodeMailboxName(path);
|
|
79
70
|
return decoded === false ? path : Buffer.from(decoded, 'utf-8').toString('binary');
|
|
80
71
|
}
|
|
81
|
-
|
|
82
72
|
/**
|
|
83
73
|
* Sets the UTF-8 options of a session from the extensions it has enabled. Run it when the session starts,
|
|
84
74
|
* after ENABLE and after UNAUTHENTICATE (once the ENABLE plugin has cleared `connection.enabled`).
|
|
@@ -98,26 +88,26 @@ function updateSession(connection) {
|
|
|
98
88
|
const accept = isEnabled(connection, 'UTF8=ACCEPT');
|
|
99
89
|
const rev2 = isEnabled(connection, 'IMAP4rev2');
|
|
100
90
|
const utf8Names = accept || rev2;
|
|
101
|
-
|
|
102
91
|
// UTF-8 names and quoted strings are on, plugins check this instead of the extension names
|
|
103
92
|
connection.utf8Enabled = utf8Names;
|
|
104
93
|
connection.parserOptions.utf8 = !!server.utf8Accept || rev2;
|
|
105
94
|
connection.compilerOptions.utf8 = utf8Names;
|
|
106
95
|
connection.searchCharset = accept ? 'UTF-8' : false;
|
|
107
96
|
connection.defaultSearchCharset = rev2 ? 'UTF-8' : false;
|
|
108
|
-
|
|
109
97
|
if (utf8Names) {
|
|
110
98
|
connection.importMailboxName = importUtf8Name;
|
|
111
99
|
connection.exportMailboxName = exportUtf8Name;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
// back to the IMAPConnection methods, the overrides are own properties of the connection
|
|
103
|
+
const overrides = connection;
|
|
104
|
+
delete overrides.exportMailboxName;
|
|
115
105
|
if (server.utf8Accept) {
|
|
116
106
|
connection.importMailboxName = importMutf7Name;
|
|
117
|
-
}
|
|
118
|
-
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
delete overrides.importMailboxName;
|
|
119
110
|
}
|
|
120
111
|
}
|
|
121
112
|
}
|
|
122
|
-
|
|
123
|
-
module.exports = { updateSession };
|
|
113
|
+
export { updateSession };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VANISHED responses (RFC 7162 section 3.2.10) in place of EXPUNGE notifications. Used by QRESYNC
|
|
3
|
+
* and by UIDONLY (RFC 9586 section 3.4), which both report expunged messages by UID.
|
|
4
|
+
*/
|
|
5
|
+
import type { IMAPResponse, Notification } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Checks if a queued notification is an EXPUNGE response for a removed message
|
|
8
|
+
*
|
|
9
|
+
* @param {Object} notification Queued notification
|
|
10
|
+
* @return {Boolean} true for an EXPUNGE notification
|
|
11
|
+
*/
|
|
12
|
+
declare function isExpungeNotification(notification: Notification): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Replaces the EXPUNGE notifications of a queue with VANISHED responses, consecutive EXPUNGE
|
|
15
|
+
* notifications become one VANISHED response. The queue is not changed
|
|
16
|
+
*
|
|
17
|
+
* @param {Array} queue Queued notifications
|
|
18
|
+
* @return {Array} notifications to send
|
|
19
|
+
*/
|
|
20
|
+
declare function toVanished(queue: Notification[]): IMAPResponse[];
|
|
21
|
+
export { isExpungeNotification, toVanished };
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* VANISHED responses (RFC 7162 section 3.2.10) in place of EXPUNGE notifications. Used by QRESYNC
|
|
5
3
|
* and by UIDONLY (RFC 9586 section 3.4), which both report expunged messages by UID.
|
|
6
4
|
*/
|
|
7
|
-
|
|
8
|
-
const { toSequenceSet } = require('./esearch');
|
|
9
|
-
|
|
5
|
+
import { toSequenceSet } from './esearch.js';
|
|
10
6
|
/**
|
|
11
7
|
* Checks if a queued notification is an EXPUNGE response for a removed message
|
|
12
8
|
*
|
|
@@ -17,7 +13,6 @@ function isExpungeNotification(notification) {
|
|
|
17
13
|
const name = !!notification.message && !!notification.attributes && notification.attributes[1];
|
|
18
14
|
return !!name && name.type === 'ATOM' && String(name.value).toUpperCase() === 'EXPUNGE';
|
|
19
15
|
}
|
|
20
|
-
|
|
21
16
|
/**
|
|
22
17
|
* Replaces the EXPUNGE notifications of a queue with VANISHED responses, consecutive EXPUNGE
|
|
23
18
|
* notifications become one VANISHED response. The queue is not changed
|
|
@@ -34,24 +29,24 @@ function toVanished(queue) {
|
|
|
34
29
|
queue.forEach(notification => {
|
|
35
30
|
if (!isExpungeNotification(notification)) {
|
|
36
31
|
groups.push(notification);
|
|
37
|
-
}
|
|
32
|
+
}
|
|
33
|
+
else if (Array.isArray(groups[groups.length - 1])) {
|
|
34
|
+
// an EXPUNGE notification always carries its message
|
|
38
35
|
groups[groups.length - 1].push(notification.message);
|
|
39
|
-
}
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
40
38
|
groups.push([notification.message]);
|
|
41
39
|
}
|
|
42
40
|
});
|
|
43
41
|
// the removed messages go with the response for output handlers, like `message` of EXPUNGE
|
|
44
|
-
return groups.map(group =>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
: group
|
|
54
|
-
);
|
|
42
|
+
return groups.map(group => Array.isArray(group)
|
|
43
|
+
? {
|
|
44
|
+
tag: '*',
|
|
45
|
+
command: 'VANISHED',
|
|
46
|
+
attributes: [{ type: 'SEQUENCE', value: toSequenceSet(group.map(message => message.uid)) }],
|
|
47
|
+
notification: true,
|
|
48
|
+
messages: group
|
|
49
|
+
}
|
|
50
|
+
: group);
|
|
55
51
|
}
|
|
56
|
-
|
|
57
|
-
module.exports = { isExpungeNotification, toVanished };
|
|
52
|
+
export { isExpungeNotification, toVanished };
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ACL": [
|
|
3
|
+
"Adds ACL [RFC4314] capability with RIGHTS=texk",
|
|
4
|
+
"The owner (server option \"aclOwner\", default \"testuser\")",
|
|
5
|
+
"has all rights on every mailbox. Other users get rights",
|
|
6
|
+
"from the \"acl\" property of a mailbox in storage, e.g.",
|
|
7
|
+
"{\"otheruser\": \"lr\", \"anyone\": \"l\"}, or from SETACL. With",
|
|
8
|
+
"LIST-EXTENDED, LIST-MYRIGHTS [RFC8440] is supported as well"
|
|
9
|
+
],
|
|
10
|
+
"APPENDLIMIT": [
|
|
11
|
+
"Adds APPENDLIMIT [RFC7889] capability",
|
|
12
|
+
"Server option \"appendLimit\" sets the limit in octets for all",
|
|
13
|
+
"mailboxes, a mailbox in storage can set its own \"appendLimit\"",
|
|
14
|
+
"(null for no limit)"
|
|
15
|
+
],
|
|
16
|
+
"AUTH-PLAIN": [
|
|
17
|
+
"Adds AUTH=PLAIN capability",
|
|
18
|
+
"Supports SASL-IR [RFC4959] as well"
|
|
19
|
+
],
|
|
20
|
+
"BINARY": [
|
|
21
|
+
"Adds BINARY [RFC3516] capability"
|
|
22
|
+
],
|
|
23
|
+
"CATENATE": [
|
|
24
|
+
"Adds CATENATE [RFC4469] and URL-PARTIAL [RFC5550] capabilities",
|
|
25
|
+
"Only absolute-path URLs are accepted, eg. \"/INBOX/;UID=1/;SECTION=1\""
|
|
26
|
+
],
|
|
27
|
+
"COMPRESS": [
|
|
28
|
+
"Adds COMPRESS=DEFLATE [RFC4978] capability",
|
|
29
|
+
"Raw DEFLATE in both directions after the tagged OK,",
|
|
30
|
+
"every burst of responses ends with a sync flush"
|
|
31
|
+
],
|
|
32
|
+
"CONDSTORE": [
|
|
33
|
+
"Adds CONDSTORE [RFC7162] capability"
|
|
34
|
+
],
|
|
35
|
+
"CONTEXT-SEARCH": [
|
|
36
|
+
"Adds CONTEXT=SEARCH [RFC5267] capability, loads ESEARCH as well",
|
|
37
|
+
"SEARCH RETURN (UPDATE) sends ADDTO and REMOVEFROM updates as the result changes, until CANCELUPDATE or the mailbox is closed",
|
|
38
|
+
"SEARCH RETURN (PARTIAL 1:100) returns a window of the results, the CONTEXT hint is accepted and ignored",
|
|
39
|
+
"Server option \"maxSearchContexts\" (default 10) limits the updating contexts of a session, above it NOUPDATE is sent"
|
|
40
|
+
],
|
|
41
|
+
"CONTEXT-SORT": [
|
|
42
|
+
"Adds CONTEXT=SORT [RFC5267] capability, loads ESORT and CONTEXT=SEARCH as well",
|
|
43
|
+
"SORT RETURN (UPDATE) sends ADDTO and REMOVEFROM updates with context positions in sort order, PARTIAL and CONTEXT work for SORT too"
|
|
44
|
+
],
|
|
45
|
+
"CREATE-SPECIAL-USE": [
|
|
46
|
+
"Enables CREATE-SPECIAL-USE [RFC6154] capability",
|
|
47
|
+
"Allowed special flags can be set with server",
|
|
48
|
+
"option \"special-use\""
|
|
49
|
+
],
|
|
50
|
+
"ENABLE": [
|
|
51
|
+
"Adds ENABLE capability [RFC5161]",
|
|
52
|
+
"Plugins that can be enabled (eg. CONDSTORE)",
|
|
53
|
+
"can be loaded in any order"
|
|
54
|
+
],
|
|
55
|
+
"ESEARCH": [
|
|
56
|
+
"Adds ESEARCH [RFC4731] capability",
|
|
57
|
+
"SEARCH and UID SEARCH take the RETURN (MIN MAX ALL COUNT) result options and answer with ESEARCH"
|
|
58
|
+
],
|
|
59
|
+
"ESORT": [
|
|
60
|
+
"Adds ESORT [RFC5267] capability, loads SORT and ESEARCH as well",
|
|
61
|
+
"SORT and UID SORT take the RETURN (MIN MAX ALL COUNT) result options and answer with ESEARCH, results are in sort order"
|
|
62
|
+
],
|
|
63
|
+
"ID": [
|
|
64
|
+
"Adds ID [RFC2971] capability"
|
|
65
|
+
],
|
|
66
|
+
"IDLE": [
|
|
67
|
+
"Adds IDLE [RFC2177] capability"
|
|
68
|
+
],
|
|
69
|
+
"IMAP4REV2": [
|
|
70
|
+
"Adds IMAP4rev2 [RFC9051] capability next to IMAP4rev1 and loads",
|
|
71
|
+
"the extensions folded into IMAP4rev2 (RFC 9051 Appendix E).",
|
|
72
|
+
"A session follows RFC 9051 after ENABLE IMAP4rev2, others RFC 3501"
|
|
73
|
+
],
|
|
74
|
+
"LIST-EXTENDED": [
|
|
75
|
+
"Adds LIST-EXTENDED [RFC5258] capability: selection options",
|
|
76
|
+
"SUBSCRIBED, REMOTE and RECURSIVEMATCH, return options SUBSCRIBED",
|
|
77
|
+
"and CHILDREN, multiple mailbox patterns and CHILDINFO.",
|
|
78
|
+
"\\Noselect mailboxes are listed as \\NonExistent"
|
|
79
|
+
],
|
|
80
|
+
"LIST-STATUS": [
|
|
81
|
+
"Adds LIST-STATUS [RFC5819] capability, the STATUS return option",
|
|
82
|
+
"of LIST. Loads LIST-EXTENDED as well"
|
|
83
|
+
],
|
|
84
|
+
"LITERALMINUS": [
|
|
85
|
+
"Enables LITERAL- [RFC7888] capability",
|
|
86
|
+
"Non-synchronizing literals up to 4096 octets, a larger",
|
|
87
|
+
"one is dropped and answered with BAD [TOOBIG]",
|
|
88
|
+
"Can not be loaded with LITERAL+"
|
|
89
|
+
],
|
|
90
|
+
"LITERALPLUS": [
|
|
91
|
+
"Enables LITERAL+ [RFC7888] capability",
|
|
92
|
+
"Can not be loaded with LITERAL-"
|
|
93
|
+
],
|
|
94
|
+
"LOGINDISABLED": [
|
|
95
|
+
"Disables LOGIN support for unencrypted connections"
|
|
96
|
+
],
|
|
97
|
+
"MESSAGELIMIT": [
|
|
98
|
+
"Adds MESSAGELIMIT [RFC9738] capability, advertised as MESSAGELIMIT=<n>",
|
|
99
|
+
"Server option \"messageLimit\" sets n (default 1000). FETCH, STORE, SEARCH, MOVE, UID EXPUNGE",
|
|
100
|
+
"and their UID variants only work on the n messages with the highest UIDs and add",
|
|
101
|
+
"[MESSAGELIMIT n uid] to the tagged OK. COPY, APPEND (MULTIAPPEND), SORT and THREAD of",
|
|
102
|
+
"more messages fail with NO [MESSAGELIMIT ...]. Adds the UIDAFTER and UIDBEFORE search keys.",
|
|
103
|
+
"Can not be loaded with SAVELIMIT"
|
|
104
|
+
],
|
|
105
|
+
"METADATA-SERVER": [
|
|
106
|
+
"Adds METADATA-SERVER [RFC5464] capability, like METADATA but",
|
|
107
|
+
"only for server annotations (mailbox name \"\"). With METADATA",
|
|
108
|
+
"also loaded, only METADATA is advertised"
|
|
109
|
+
],
|
|
110
|
+
"METADATA": [
|
|
111
|
+
"Adds METADATA [RFC5464] capability (GETMETADATA and SETMETADATA)",
|
|
112
|
+
"for server and mailbox annotations. Mailboxes take initial entries",
|
|
113
|
+
"from a \"metadata\" object in storage, server entries come from the",
|
|
114
|
+
"\"metadata\" option. Limits: \"metadataMaxSize\" (octets per value,",
|
|
115
|
+
"default 65536), \"metadataMaxEntries\" (per mailbox and for the",
|
|
116
|
+
"server, default 100). \"metadataPrivate\": false turns /private",
|
|
117
|
+
"entries off. ENABLE METADATA turns on unsolicited METADATA responses"
|
|
118
|
+
],
|
|
119
|
+
"MOVE": [
|
|
120
|
+
"Adds MOVE [RFC6851] capability"
|
|
121
|
+
],
|
|
122
|
+
"MULTIAPPEND": [
|
|
123
|
+
"Adds MULTIAPPEND [RFC3502] capability",
|
|
124
|
+
"With UIDPLUS, APPENDUID lists the UIDs of all messages"
|
|
125
|
+
],
|
|
126
|
+
"MULTISEARCH": [
|
|
127
|
+
"Adds MULTISEARCH [RFC7377] capability, loads ESEARCH as well",
|
|
128
|
+
"ESEARCH IN (mailboxes \"a\" subtree \"b\" personal ...) RETURN (...) searches several mailboxes, also in the authenticated state"
|
|
129
|
+
],
|
|
130
|
+
"NAMESPACE": [
|
|
131
|
+
"Adds NAMESPACE [RFC2342] capability"
|
|
132
|
+
],
|
|
133
|
+
"NOTIFY": [
|
|
134
|
+
"Adds NOTIFY [RFC5465] capability. Events: MessageNew (with",
|
|
135
|
+
"fetch attributes for the selected mailbox), MessageExpunge,",
|
|
136
|
+
"FlagChange, MailboxName, SubscriptionChange, and with METADATA",
|
|
137
|
+
"MailboxMetadataChange and ServerMetadataChange.",
|
|
138
|
+
"server.notifyOverflow([connection]) sends",
|
|
139
|
+
"\"* OK [NOTIFICATIONOVERFLOW]\" and turns NOTIFY off"
|
|
140
|
+
],
|
|
141
|
+
"OAUTHBEARER": [
|
|
142
|
+
"Adds AUTH=OAUTHBEARER [RFC7628] capability",
|
|
143
|
+
"Works with and without SASL-IR [RFC4959]",
|
|
144
|
+
"Valid login info, same as for XOAUTH2:",
|
|
145
|
+
" Username (authzid, optional): testuser",
|
|
146
|
+
" Access Token: testtoken"
|
|
147
|
+
],
|
|
148
|
+
"OBJECTID": [
|
|
149
|
+
"Adds OBJECTID [RFC8474] capability",
|
|
150
|
+
"MAILBOXID, EMAILID and THREADID values are generated (F1, M1, T1, ...)",
|
|
151
|
+
"unless storage sets them for a mailbox (\"MAILBOXID\") or a message",
|
|
152
|
+
"(\"EMAILID\", \"THREADID\"). Messages are threaded by their Message-ID,",
|
|
153
|
+
"In-Reply-To and References headers across all mailboxes"
|
|
154
|
+
],
|
|
155
|
+
"PARTIAL": [
|
|
156
|
+
"Adds PARTIAL [RFC9394] capability, loads ESEARCH as well",
|
|
157
|
+
"SEARCH RETURN (PARTIAL 1:100) or (PARTIAL -1:-100) returns a window of the results, FETCH and UID FETCH take a PARTIAL modifier"
|
|
158
|
+
],
|
|
159
|
+
"PREVIEW": [
|
|
160
|
+
"Adds PREVIEW [RFC8970] capability",
|
|
161
|
+
"Previews come from the first text/plain or text/html body part,",
|
|
162
|
+
"or from the \"preview\" property of a message in storage.",
|
|
163
|
+
"PREVIEW (LAZY) returns NIL until a preview has been generated"
|
|
164
|
+
],
|
|
165
|
+
"QRESYNC": [
|
|
166
|
+
"Adds QRESYNC [RFC7162] capability, loads CONDSTORE and ENABLE as well",
|
|
167
|
+
"After ENABLE QRESYNC: SELECT/EXAMINE (QRESYNC (...)), UID FETCH (CHANGEDSINCE n VANISHED),",
|
|
168
|
+
"and VANISHED responses instead of EXPUNGE"
|
|
169
|
+
],
|
|
170
|
+
"QUOTA": [
|
|
171
|
+
"Adds QUOTA [RFC9208] capability with the STORAGE, MESSAGE and MAILBOX",
|
|
172
|
+
"resources and SETQUOTA. All personal mailboxes share one quota root, set",
|
|
173
|
+
"with the \"quota\" server option, eg. {\"root\": \"User quota\",",
|
|
174
|
+
"\"STORAGE\": 10240, \"MESSAGE\": 1000, \"MAILBOX\": 100, \"soft\": false}.",
|
|
175
|
+
"STORAGE is in units of 1024 octets. Hard limits make APPEND, COPY, MOVE",
|
|
176
|
+
"and CREATE fail with NO [OVERQUOTA], soft limits only send a warning"
|
|
177
|
+
],
|
|
178
|
+
"REPLACE": [
|
|
179
|
+
"Adds REPLACE [RFC8508] capability (REPLACE and UID REPLACE commands)"
|
|
180
|
+
],
|
|
181
|
+
"SASL-IR": [
|
|
182
|
+
"Enables SASL-IR [RFC4959] capability"
|
|
183
|
+
],
|
|
184
|
+
"SAVEDATE": [
|
|
185
|
+
"Adds SAVEDATE [RFC8514] capability",
|
|
186
|
+
"Every message gets a save date when it is added to a mailbox (APPEND,",
|
|
187
|
+
"COPY, MOVE, and when the storage is loaded), messages in storage can",
|
|
188
|
+
"set it with a \"SAVEDATE\" value. A mailbox with \"SAVEDATE\": false in",
|
|
189
|
+
"storage does not support save dates, FETCH returns NIL for its messages"
|
|
190
|
+
],
|
|
191
|
+
"SAVELIMIT": [
|
|
192
|
+
"Adds SAVELIMIT [RFC9738] capability, advertised as SAVELIMIT=<n>",
|
|
193
|
+
"Server option \"messageLimit\" sets n (default 1000). COPY and APPEND (MULTIAPPEND)",
|
|
194
|
+
"of more messages fail with NO [MESSAGELIMIT ...], other commands are not limited.",
|
|
195
|
+
"Can not be loaded with MESSAGELIMIT"
|
|
196
|
+
],
|
|
197
|
+
"SEARCHRES": [
|
|
198
|
+
"Adds SEARCHRES [RFC5182] capability, loads ESEARCH as well",
|
|
199
|
+
"SEARCH RETURN (SAVE) stores the result, \"$\" refers to it in place of a sequence set"
|
|
200
|
+
],
|
|
201
|
+
"SORT-DISPLAY": [
|
|
202
|
+
"Adds SORT=DISPLAY [RFC5957] capability, also loads SORT"
|
|
203
|
+
],
|
|
204
|
+
"SORT": [
|
|
205
|
+
"Adds SORT [RFC5256] capability"
|
|
206
|
+
],
|
|
207
|
+
"SPECIAL-USE": [
|
|
208
|
+
"Enables SPECIAL-USE [RFC6154] capability",
|
|
209
|
+
"Mailboxes need to have a \"special-use\"",
|
|
210
|
+
"property (String or Array) that will be used",
|
|
211
|
+
"as extra flag for LIST and LSUB responses.",
|
|
212
|
+
"With LIST-EXTENDED the SPECIAL-USE selection and",
|
|
213
|
+
"return options work with the other LIST options"
|
|
214
|
+
],
|
|
215
|
+
"STARTTLS": [
|
|
216
|
+
"Adds STARTTLS command"
|
|
217
|
+
],
|
|
218
|
+
"STATUS-SIZE": [
|
|
219
|
+
"Adds STATUS=SIZE [RFC8438] capability. The SIZE status item",
|
|
220
|
+
"is the sum of the RFC822.SIZE values of the messages, it can",
|
|
221
|
+
"also be used with LIST-STATUS"
|
|
222
|
+
],
|
|
223
|
+
"THREAD-ORDEREDSUBJECT": [
|
|
224
|
+
"Adds THREAD=ORDEREDSUBJECT [RFC5256] capability"
|
|
225
|
+
],
|
|
226
|
+
"THREAD-REFERENCES": [
|
|
227
|
+
"Adds THREAD=REFERENCES [RFC5256] capability"
|
|
228
|
+
],
|
|
229
|
+
"UIDONLY": [
|
|
230
|
+
"Adds UIDONLY [RFC9586] capability, loads ENABLE as well",
|
|
231
|
+
"After ENABLE UIDONLY: FETCH, STORE, SEARCH, COPY, MOVE, SORT, THREAD, REPLACE and",
|
|
232
|
+
"message numbers in UID SEARCH (SORT, THREAD) criteria are refused with BAD [UIDREQUIRED],",
|
|
233
|
+
"UIDFETCH responses replace FETCH responses and VANISHED replaces EXPUNGE.",
|
|
234
|
+
"Load UIDPLUS for COPYUID and UID EXPUNGE"
|
|
235
|
+
],
|
|
236
|
+
"UIDPLUS": [
|
|
237
|
+
"Adds UIDPLUS [RFC4315] capability"
|
|
238
|
+
],
|
|
239
|
+
"UNAUTHENTICATE": [
|
|
240
|
+
"Adds UNAUTHENTICATE [RFC8437] capability",
|
|
241
|
+
"Returns to the Not Authenticated state, everything",
|
|
242
|
+
"but TLS is reset (selected mailbox, ENABLE, COMPRESS)"
|
|
243
|
+
],
|
|
244
|
+
"UNSELECT": [
|
|
245
|
+
"Adds UNSELECT [RFC3691] capability"
|
|
246
|
+
],
|
|
247
|
+
"UTF8-ACCEPT": [
|
|
248
|
+
"Adds UTF8=ACCEPT [RFC9755] capability, loads ENABLE as well",
|
|
249
|
+
"After ENABLE UTF8=ACCEPT mailbox names are UTF-8 instead of",
|
|
250
|
+
"modified UTF-7 and strings are sent quoted as UTF-8"
|
|
251
|
+
],
|
|
252
|
+
"X-GM-EXT-1": [
|
|
253
|
+
"Adds Gmail specific X-GM-EXT-1 capability",
|
|
254
|
+
"(https://developers.google.com/workspace/gmail/imap/imap-extensions)",
|
|
255
|
+
" X-GM-MSGID and X-GM-THRID: FETCH and SEARCH. X-GM-THRID is the",
|
|
256
|
+
" X-GM-MSGID of the message unless storage sets an X-GM-THRID",
|
|
257
|
+
" value, so every message is its own thread unless the",
|
|
258
|
+
" fixture groups messages. With OBJECTID, the messages of a",
|
|
259
|
+
" THREADID share the X-GM-THRID of its first message",
|
|
260
|
+
" X-GM-LABELS: FETCH, STORE (+/-, .SILENT) and SEARCH. System",
|
|
261
|
+
" labels are atoms that start with \"\\\" (\\Inbox for INBOX, the",
|
|
262
|
+
" special-use attribute for special-use mailboxes), other labels",
|
|
263
|
+
" are mailbox names, sent like mailbox names (modified UTF-7, or",
|
|
264
|
+
" UTF-8 after ENABLE UTF8=ACCEPT, quoted when not atoms). Labels",
|
|
265
|
+
" have no side effects: the message is not copied to or removed",
|
|
266
|
+
" from other mailboxes. In SEARCH a label that starts with \"\\\"",
|
|
267
|
+
" is a system label",
|
|
268
|
+
" X-GM-RAW: a subset of the Gmail search syntax. Words and \"quoted",
|
|
269
|
+
" phrases\" (TEXT), -term, OR, (groups), {any of}, from: to: cc:",
|
|
270
|
+
" bcc: subject: label: in: (inbox sent drafts trash spam",
|
|
271
|
+
" anywhere, or a label) is: (read unread starred important)",
|
|
272
|
+
" larger: smaller: (k and m suffixes) after: before:",
|
|
273
|
+
" (YYYY/MM/DD) and rfc822msgid:. Other Gmail operators are",
|
|
274
|
+
" answered with NO"
|
|
275
|
+
],
|
|
276
|
+
"XOAUTH2": [
|
|
277
|
+
"Enables XOAUTH2 capability",
|
|
278
|
+
"Implementation difference - ImapKit requires",
|
|
279
|
+
"SASL-IR enabled and used while Gmail does not",
|
|
280
|
+
"Valid login info:",
|
|
281
|
+
" Username: testuser",
|
|
282
|
+
" Access Token: testtoken"
|
|
283
|
+
],
|
|
284
|
+
"XTOYBIRD": [
|
|
285
|
+
"Custom plugin to allow programmatic control of the server",
|
|
286
|
+
"Available commands:",
|
|
287
|
+
" XTOYBIRD SERVER dumps server internals",
|
|
288
|
+
" XTOYBIRD CONNECTION dumps connection internals",
|
|
289
|
+
" XTOYBIRD STORAGE dumps storage as JSON",
|
|
290
|
+
" XTOYBIRD USERADD \"username\" \"password\" adds or updates user",
|
|
291
|
+
" XTOYBIRD USERDEL \"username\" removes a user",
|
|
292
|
+
" XTOYBIRD SHUTDOWN Closes the server after the last client",
|
|
293
|
+
" disconnects. New connections are rejected.",
|
|
294
|
+
"Commands are only allowed after login, and only for the owner",
|
|
295
|
+
"(aclOwner option) when ACL is loaded. A test control plugin,",
|
|
296
|
+
"any user it allows can read and change everything"
|
|
297
|
+
]
|
|
298
|
+
}
|
package/package.json
CHANGED
|
@@ -1,25 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "imapkit",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Scriptable, strictly RFC compliant in-memory IMAP server for testing IMAP clients",
|
|
5
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/cjs/index.js",
|
|
7
|
+
"types": "./dist/cjs/index.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
"*": {
|
|
10
|
+
"lib/*": [
|
|
11
|
+
"dist/cjs/*.d.ts",
|
|
12
|
+
"dist/cjs/*/index.d.ts"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./dist/esm/index.js",
|
|
19
|
+
"require": "./dist/cjs/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./lib/server": {
|
|
22
|
+
"import": "./dist/esm/index.js",
|
|
23
|
+
"require": "./dist/cjs/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./lib/server.js": {
|
|
26
|
+
"import": "./dist/esm/index.js",
|
|
27
|
+
"require": "./dist/cjs/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./lib/*.js": {
|
|
30
|
+
"import": "./dist/esm/*.js",
|
|
31
|
+
"require": "./dist/cjs/*.js"
|
|
32
|
+
},
|
|
33
|
+
"./lib/*": {
|
|
34
|
+
"import": "./dist/esm/*.js",
|
|
35
|
+
"require": "./dist/cjs/*.js"
|
|
36
|
+
},
|
|
37
|
+
"./package.json": "./package.json"
|
|
38
|
+
},
|
|
6
39
|
"bin": {
|
|
7
40
|
"imapkit": "bin/imapkit.js"
|
|
8
41
|
},
|
|
9
42
|
"files": [
|
|
10
43
|
"bin",
|
|
11
44
|
"cert",
|
|
12
|
-
"
|
|
45
|
+
"dist"
|
|
13
46
|
],
|
|
14
47
|
"scripts": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"test
|
|
19
|
-
"
|
|
48
|
+
"build": "node scripts/build.js",
|
|
49
|
+
"typecheck": "node scripts/build.js --generate-only && tsc -p tsconfig.json",
|
|
50
|
+
"prepare": "npm run build && (git rev-parse --git-dir >/dev/null 2>&1 && git config core.hooksPath .githooks || true)",
|
|
51
|
+
"test": "npm run lint && npm run build && npm run test:unit",
|
|
52
|
+
"test:unit": "node --import tsx --test test/*.test.ts",
|
|
53
|
+
"test:coverage": "node --import tsx --test --experimental-test-coverage --test-coverage-include='src/**' --test-coverage-exclude='src/cert.ts' --test-coverage-lines=94 test/*.test.ts",
|
|
54
|
+
"test:bun": "bun test --timeout 60000 test/",
|
|
55
|
+
"test:deno": "deno test --no-check --sloppy-imports --allow-all test/",
|
|
56
|
+
"lint": "eslint && npm run typecheck",
|
|
20
57
|
"format": "prettier --write .",
|
|
21
58
|
"format:check": "prettier --check .",
|
|
22
|
-
"compare": "node compare/compare.
|
|
59
|
+
"compare": "node --import tsx compare/compare.ts",
|
|
23
60
|
"dovecot:start": "bash compare/dovecot.sh start",
|
|
24
61
|
"dovecot:stop": "bash compare/dovecot.sh stop",
|
|
25
62
|
"update": "rm -rf node_modules package-lock.json && ncu -u && npm install"
|
|
@@ -46,15 +83,21 @@
|
|
|
46
83
|
"author": "Postal Systems OÜ",
|
|
47
84
|
"license": "MIT",
|
|
48
85
|
"dependencies": {
|
|
49
|
-
"imap-handler": "1.
|
|
86
|
+
"imap-handler": "1.4.0",
|
|
50
87
|
"smtp-server": "3.19.17"
|
|
51
88
|
},
|
|
52
89
|
"devDependencies": {
|
|
53
90
|
"@eslint/js": "10.0.1",
|
|
91
|
+
"@types/node": "20.19.43",
|
|
92
|
+
"@types/smtp-server": "3.5.13",
|
|
54
93
|
"eslint": "10.12.0",
|
|
94
|
+
"eslint-config-prettier": "10.1.8",
|
|
55
95
|
"globals": "17.13.0",
|
|
56
96
|
"imapflow": "2.2.7",
|
|
57
|
-
"prettier": "3.9.9"
|
|
97
|
+
"prettier": "3.9.9",
|
|
98
|
+
"tsx": "4.23.15",
|
|
99
|
+
"typescript": "6.0.3",
|
|
100
|
+
"typescript-eslint": "8.71.1"
|
|
58
101
|
},
|
|
59
102
|
"engines": {
|
|
60
103
|
"node": ">=20.0.0"
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = function (connection, parsed, data, callback) {
|
|
4
|
-
const capabilities = ['IMAP4rev1'];
|
|
5
|
-
|
|
6
|
-
Object.keys(connection.server.capabilities).forEach(key => {
|
|
7
|
-
if (connection.server.capabilities[key](connection)) {
|
|
8
|
-
capabilities.push(key);
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
connection.send(
|
|
13
|
-
{
|
|
14
|
-
tag: '*',
|
|
15
|
-
command: 'CAPABILITY',
|
|
16
|
-
attributes: capabilities.map(capability => {
|
|
17
|
-
return {
|
|
18
|
-
type: 'TEXT',
|
|
19
|
-
value: capability
|
|
20
|
-
};
|
|
21
|
-
})
|
|
22
|
-
},
|
|
23
|
-
'CAPABILITY LIST',
|
|
24
|
-
parsed,
|
|
25
|
-
data,
|
|
26
|
-
capabilities
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
connection.send(
|
|
30
|
-
{
|
|
31
|
-
tag: parsed.tag,
|
|
32
|
-
command: 'OK',
|
|
33
|
-
attributes: [
|
|
34
|
-
{
|
|
35
|
-
type: 'TEXT',
|
|
36
|
-
value: 'Completed'
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
|
-
'CAPABILITY COMPLETED',
|
|
41
|
-
parsed,
|
|
42
|
-
data,
|
|
43
|
-
capabilities
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
callback();
|
|
47
|
-
};
|
package/lib/commands/check.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = function (connection, parsed, data, callback) {
|
|
4
|
-
connection.send(
|
|
5
|
-
{
|
|
6
|
-
tag: parsed.tag,
|
|
7
|
-
command: 'OK',
|
|
8
|
-
attributes: [
|
|
9
|
-
{
|
|
10
|
-
type: 'TEXT',
|
|
11
|
-
value: 'Completed'
|
|
12
|
-
}
|
|
13
|
-
]
|
|
14
|
-
},
|
|
15
|
-
'CHECK',
|
|
16
|
-
parsed,
|
|
17
|
-
data
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
callback();
|
|
21
|
-
};
|