From 4893537192844fc8fd347fc5fa517686b2a3cb85 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Tue, 14 Apr 2009 02:31:29 +0000 Subject: [PATCH] Fix IMAP folders with spaces in their names --- mailboxes/folders-lib.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mailboxes/folders-lib.pl b/mailboxes/folders-lib.pl index dd1e0e4dd..502ece542 100644 --- a/mailboxes/folders-lib.pl +++ b/mailboxes/folders-lib.pl @@ -1565,7 +1565,7 @@ elsif ($_[1]->{'type'} == 4) { local $text = &read_file_contents($temp); unlink($temp); $text =~ s/^From.*\r?\n//; # Not part of IMAP format - @rv = &imap_command($h, sprintf "APPEND %s {%d}\r\n%s", + @rv = &imap_command($h, sprintf "APPEND \"%s\" {%d}\r\n%s", $_[1]->{'mailbox'} || "INBOX", length($text), $text); &error(&text('save_eappend', $rv[3])) if (!$rv[0]); $needid = 1; @@ -1944,7 +1944,7 @@ if (!$h) { } # Select the right folder (if one was given) -@rv = &imap_command($h, "select ".($_[0]->{'mailbox'} || "INBOX")); +@rv = &imap_command($h, "select \"".($_[0]->{'mailbox'} || "INBOX")."\""); return (3, $rv[3]) if (!$rv[0]); local $count = $rv[2] =~ /\*\s+(\d+)\s+EXISTS/i ? $1 : undef; local $uidnext = $rv[2] =~ /UIDNEXT\s+(\d+)/ ? $1 : undef;