jtdaugherty/HaskellNet — pull request #22 by dpwright (2014-10-07 04:05:52+00:00)
Title: Fix parser error when passing parameters to FETCH

As reported in this StackOverflow post:

http://stackoverflow.com/questions/26183675/error-when-fetching-subject-from-email-using-haskellnets-imap

Passing parameters to the query string you use in `fetchByString` would
break the parser which was splitting input on spaces regardless of
whether it was inside square brackets so a response like

"* 2 FETCH (UID 2 BODY[HEADER.FIELDS (SUBJECT)] {43}\r"

would be split into:

UID 2
BODY[HEADER.FIELDS (SUBJECT)]
{43} #ERROR (No value)

This commit simply includes anything in square brackets as part of the
key, so that the above string would be split as follows:

UID 2
BODY[HEADER.FIELDS (SUBJECT)] {43}