Skip to content

Commit

Permalink
Fix for #26 and #1
Browse files Browse the repository at this point in the history
  • Loading branch information
andyedinborough committed Feb 5, 2012
1 parent f714a61 commit 9932872
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ImapClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using AE.Net.Mail.Imap;
using System.Text;

namespace AE.Net.Mail {

Expand Down Expand Up @@ -366,7 +366,10 @@ public MailMessage[] GetMessages(string start, string end, bool uid, bool header
if (m2.Groups[1] != null) mail.Size = Convert.ToInt32(m2.Groups[1].ToString());
mail.Load(body.ToString(), headersonly);
x.Add(mail);
response = GetResponse(); // read last line terminated by )

response = response.Split('\n').LastOrDefault() ?? string.Empty;
while (!response.Contains(tag + "OK"))
response = GetResponse();
m = Regex.Match(response, reg);
}

Expand Down Expand Up @@ -459,7 +462,7 @@ internal override void OnLogin(string login, string password) {
break;

case AuthMethods.Login:
command = tag + "LOGIN " + login + " " + password;
command = tag + "LOGIN " + login.QuoteString() + " " + password.QuoteString();
result = SendCommandGetResponse(command);
break;

Expand Down

0 comments on commit 9932872

Please sign in to comment.