Quantcast
Channel: ImapX 2
Viewing all articles
Browse latest Browse all 1952

Edited Unassigned: Opening closing bracket () logic to NormalizeAndProcessFetchResultseems incorrect [1907]

$
0
0
Pavel,

In Message.NormalizeAndProcessFetchResult function the parameter list has headers, in my case the subject header is divided into two items e.g.

1. This is my subject with opening bracket ( in it
2. Closing bracket ) is here

While parsing the item 1, the if validation
if ((str.Split('(').Length - (i == 0 ? 1 : 0)) >= (str.Split(')').Length))

return true, hence ProcessCommandResult(str); is executed.

But when parsing item 2, the if statement returns false and the remaining part of the subject is added to buffer which later is append to other header, hence no headers after subject are actually parsed.

You may want to change it to
if ((str.Split(')').Length + (i == 0 ? 1 : 0)) >= (str.Split('(').Length))

but this will have same issue in case subject only has a opening ( bracket


Hence I have changed it to
if ((str.Split(')').Length + (i == 0 ? 1 : 0)) >= (str.Split('(').Length) || (i + 1 < data.Count && Regex.IsMatch(data[i+1], @"^[A-Za-z-]+:")))

If this look right to you, you may want to correct the same in the code

Viewing all articles
Browse latest Browse all 1952

Trending Articles