aboutsummaryrefslogtreecommitdiffstats
path: root/src/messaging/IMAPFolder.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2004-11-14 14:31:23 +0000
committerVincent Richard <[email protected]>2004-11-14 14:31:23 +0000
commitde09abb036a54b4214f0092a57e057481adb9530 (patch)
treea055ed14d4bed03553a27fb18b7a79c4c73f55c6 /src/messaging/IMAPFolder.cpp
parentAdded support for generating documentation (Doxygen) + written AUTHORS file. (diff)
downloadvmime-de09abb036a54b4214f0092a57e057481adb9530.tar.gz
vmime-de09abb036a54b4214f0092a57e057481adb9530.zip
Prevent from renaming 'INBOX' folder in IMAP (illegal_operation exception).
Diffstat (limited to 'src/messaging/IMAPFolder.cpp')
-rw-r--r--src/messaging/IMAPFolder.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/messaging/IMAPFolder.cpp b/src/messaging/IMAPFolder.cpp
index 4aef1afe..7544dc2c 100644
--- a/src/messaging/IMAPFolder.cpp
+++ b/src/messaging/IMAPFolder.cpp
@@ -1228,6 +1228,8 @@ void IMAPFolder::rename(const folder::path& newPath)
throw exceptions::illegal_state("Store disconnected");
else if (isOpen())
throw exceptions::illegal_state("Folder open");
+ else if (m_path.getSize() == 1 && m_name.getBuffer() == "INBOX")
+ throw exceptions::illegal_operation("Cannot rename 'INBOX' folder");
// Build the request text
std::ostringstream command;