Streamed data content, that was created as replacement for {sz}\r\n macro containing all content.
Streamed data content, that was created as replacement for {sz}\r\n macro containing all content.
Note that this may emit more bytes as they come in, where the data
size will never exceed size of sz
in macro nor the max size of chunk as defined by underlying TCP socket.
Helps to abstract over the results received from IMAP protocol.
Helps to abstract over the results received from IMAP protocol.
Essentially solves the situation of resolving {sz}\r\n pattern, where this pattern has to be replaced
by sz
of bytes in various formats and encodings (i.e. MIME)
text, that is known to be represented by characters.
text, that is known to be represented by characters. It may be whole line terminated by crlf ( in that case s
is w/o crlf) *
For incoming computed data, this will convert to stream of bytes as received.
For incoming computed data, this will convert to stream of bytes as received. This will strip out any parts where idx and key is different from ones supplied. Also this will strip out any non-binary content
Index of result to look for
Key of the binary segment to receive
from the stream of lines build string of string where {sz} expanded segments are returned as ASCII string (not individual lines)*
Causes to transform data from the fetch command to Binary content (Bytes) given the specific contained in pa
Causes to transform data from the fetch command to Binary content (Bytes) given the specific contained in pa
This will perfom decoding (i.e. base64 -> bytes) based on the supplied content data, resulting in stream of bytes that contains binary representation of the content .
Index of content to take, all other content indexes will be ignored
Key of the content to retrieve, all other will be ignored
Encoding of the binary format
From any stream of imap data this will strictly collect data for every response in form of Map.
From any stream of imap data this will strictly collect data for every response in form of Map.
Note that this strictly collects all data for every result denoted by idx.
Causes to perform fetch command for the text of the email body.
Causes to perform fetch command for the text of the email body. Resulting data are available in text form (strings). The strings may not be whole lines or may contain multiple lines in each string.
Index of content to take, all other content indexes will be ignored
Key of the content to retrieve, all other will be ignored
Encoding of the data
Name of the charset of the text. If empty, UTF-8 will be used instead
Separates incoming stream based on CRLF (\r\n) separator.
Separates incoming stream based on CRLF (\r\n) separator. When line contains as last characters
chunk macro ({sz}\r\n) then, such macro is expanded to IMAPBytes(bytes) that
allows to handle these contents differently (i.e. body in fetch response). There may by multiple IMAPBytes received,
up to the size sz
specified in macro.
Please note this will decode incoming bytes (for lines) with ASCII character set hence the content of the IMAP responses is based on 7 bit ASCII subset. The bytes in DataChunk are leaved as received, allowing to apply various encodings.
Creates email header from supplied of Map of Content.
Creates email header from supplied of Map of Content.
This requires UID content and BODY[HEADER] content to be present in map otherwise this will fail.
parses reult of FETCH xyz (BODYSTRUCTURE) request *
parse capability results *
parses login response, returning any supported capabiliites *
parses result of LIST command *
parses result of the search operation encoded as space delimeited ids of messages *
parses result of SELECT or EXAMINE commands *
From the supplied stream this will extract stream of raw content.
From the supplied stream this will extract stream of raw content.
This will fail, if result was not 'OK', with failure describing that exception.
If the fetch will not receive any items, stream will be empty.
As a result this will start to emit id of the result line (any line prefixed by *) then FETCH result prefix (i.e. UID, BODY, ...) and content for that prefix. When multiple same prefixes (Int, String) are emitted, they has tobe concatenated to form the result desired.
requestStream that produces result.
Executes supplied command against the request, expecting the result of the command collected in resulting stream.
Executes supplied command against the request, expecting the result of the command collected in resulting stream.
Result is the stream, that either emits once on left with error description, if instead of any content the failure of the commmand was recived. Otherwise, the client emits on right, Strema of the data that were retruned by server. Note that the data retruned on right must be consumed, before command lock is released.
Ref containing IDX that will be used to generate unique idx, that will be used to pair the response with command. Also note that client will only arrow one command at a time to be run against the server. Command will not complete before the resposne from the server is received.
Semaphore, that guards only one request to be peformed at any given time. Even though IMAPv4 spec allows for multiple concurrent commands in certain scenarios, this client strictly enforces sequential command execution.
A stream of responses (lines) fromserver immedaitelly following the command executed.
Will send one line to server
Runs supplied stream, and then will collect any output before OK
is received.
Runs supplied stream, and then will collect any output before OK
is received.
Stream that perform the request
A function to be evaluated on successfull response, and is fed with response from server, concatenated w/o any tags from server