Add support for data items (not just body part specifiers) in ->get #6

Merged
merged 3 commits into from Aug 21, 2016

Projects

None yet

2 participants

@aitap
Contributor
aitap commented Jun 26, 2015

See https://tools.ietf.org/html/rfc3501#section-6.4.5 for examples.

Note: some data items may be recognised as body part specifiers. We may end up creating another method to FETCH messages' data items because distinguishing data items/body part specifiers may require parsing IMAP requests. For example,
this is a data item: (FLAGS BODY[HEADER.FIELDS (DATE FROM)])
this is a data item: (FLAGS INTERNALDATE RFC822.SIZE)
this is a data item: BODYSTRUCTURE
this is a body part specifier: HEADER.FIELDS (DATE FROM)
this is a body part specifier: 4.2.TEXT

aitap added some commits Jun 26, 2015
@aitap aitap add support for more complex data items in ->get
see https://tools.ietf.org/html/rfc3501#section-6.4.5 for examples
Note: some data items may be recognised as body part specifiers;
to work around that, wrap them in parentheses
7bd48d6
@aitap aitap wrapping data items in parentheses won't help 39f261b
@aitap aitap Revert "add support for more complex data items in ->get"
This reverts commit 7bd48d6.

In order not to break the API and preseve the wrapping in "BODY[...]"
behaviour, leave ->get alone, but introduce another method ->fetch,
which only sets $part to RFC822 if the $part is missing, but doesn't
wrap anything.

Conflicts:
	Simple.pm
cfbf5a4
@aitap
Contributor
aitap commented Sep 19, 2015

It looks like changing the "BODY[...]" wrapping behavior of ->get is going to break some apps no matter what. Could adding another method which doesn't wrap be a solution?

@jettero jettero merged commit b48b61f into jettero:master Aug 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment