From 6f7a6a1dbe2f302bc045f2b28934e9f8bd52bf24 Mon Sep 17 00:00:00 2001 From: pocky6 Date: Fri, 18 Sep 2015 03:42:08 +0200 Subject: [PATCH] Update ImapClient.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I'm French (so, sorry for my english). I have mailboxes using accents (eg: "Santé"). MailHeaders can be retrieved from this MailBox but moving emails to it fail. I suggest to encode the name the same way it's done in fetching headers. It's my first proposal in GitHub so I don't know if you see it, I suggest to modify in: public void CopyMessages(IEnumerable uids, string destination, string mailbox = null) { The retrieval: string response = SendCommandGetResponse(tag + "UID COPY " + set + " " + Util.UTF7Encode(destination).QuoteString()); Looks like it works for me. --- ImapClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ImapClient.cs b/ImapClient.cs index f92baf4..d8f63ac 100644 --- a/ImapClient.cs +++ b/ImapClient.cs @@ -1628,7 +1628,7 @@ public void CopyMessages(IEnumerable uids, string destination, string mail SelectMailbox(mailbox); string tag = GetTag(); string response = SendCommandGetResponse(tag + "UID COPY " + set + " " + - destination.QuoteString()); + Util.UTF7Encode(destination).QuoteString()); while (response.StartsWith("*")) response = GetResponse(); ResumeIdling(); @@ -2290,4 +2290,4 @@ void AssertValid(bool requireAuth = true) { /// true to include the body part in the returned MailMessage object, or false to skip /// it. public delegate bool ExaminePartDelegate(Bodypart part); -} \ No newline at end of file +}