Skip to content

Conversation

@dpwright
Copy link
Contributor

@dpwright dpwright commented Oct 7, 2014

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}

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}
jtdaugherty added a commit that referenced this pull request Oct 7, 2014
Fix parser error when passing parameters to FETCH
@jtdaugherty jtdaugherty merged commit 86e5b29 into qnikst:master Oct 7, 2014
@jtdaugherty
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants