Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MS Exchange Server may returns UID in new line. Eg: " UID 12)" - with WA #9

Closed
nagyzo opened this issue Oct 2, 2012 · 3 comments
Closed
Labels

Comments

@nagyzo
Copy link

nagyzo commented Oct 2, 2012

Issue: MS Exchange Server may returns UID in new line. Eg: " UID 12)"

Workaround is replacing condition in GetMailHeader(), GetBodypart(), GetMessageData():

- if ((response = GetResponse()) != ")")

To:

+ response = GetResponse();
+ if (response != ")" && response != string.Format(" UID {0})",uid))
@smiley22
Copy link
Owner

smiley22 commented Oct 2, 2012

ah I see, maybe we should just come up with a regex for the response that matches ")" as well as any data other data servers might sent before the closing bracket..

@smiley22
Copy link
Owner

smiley22 commented Oct 3, 2012

this should do I think:

if(!Regex.IsMatch(GetResponse(), @")\s*$"))
throw new BadServerResponseException(response);

smiley22 added a commit that referenced this issue Oct 3, 2012
@nagyzo
Copy link
Author

nagyzo commented Oct 5, 2012

Regex is OK! Test passed :)
But in case of error, you throw the previous response in exception, so let set its value in (or before) the condition, eg:

if (!Regex.IsMatch(response=GetResponse(), @")\s*$"))
throw new BadServerResponseException(response);

smiley22 added a commit that referenced this issue Oct 6, 2012
see issue #9
@nagyzo nagyzo closed this as completed Oct 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants