mscdex/node-imap — Issue #48: Fetch Regex fails when email headers contain CR
Author: nazar
Created: 2012-03-01 10:52:39+00:00
State: open

Hi.

reFetch = /^\* (\d+) FETCH .+? \{(\d+)\}\r\n/;

The above regex fails under a rare situation where headers contain CR and the on('data') sends a chunk where the header is incomplete. This is more apparent when Yahoo! emails contain the X-YMailISG header, which contains CR seperated values.

reFetch = /^\* (\d+) FETCH [\s\S]+? \{(\d+)\}\r\n/;

The above regex fixes this issue.