Commit 6db1508b authored by Christoph Goehre's avatar Christoph Goehre
Browse files

Imported Upstream version 3.1.2

parent ddb3c32c
......@@ -216,6 +216,22 @@ function test_folder_flag_changes() {
// changed it.
archiveScope = "|" + smartArchiveFolder.msgDatabase.dBFolderInfo
.getCharProperty("searchFolderUri") + "|";
// figure out what we expect the archiveScope to now be.
let allDescendents = Cc["@mozilla.org/supports-array;1"]
.createInstance(Ci.nsISupportsArray);
rootFolder = inboxFolder.server.rootFolder;
let localArchiveFolder = rootFolder.getChildNamed("Archives");
localArchiveFolder.ListDescendents(allDescendents);
let numFolders = allDescendents.Count();
desiredScope = "|" + localArchiveFolder.URI + "|";
for each (let f in fixIterator(allDescendents, Ci.nsIMsgFolder))
desiredScope += f.URI + "|";
dump("archive Scope = " + archiveScope + "\n");
dump("desired Scope = " + desiredScope + "\n");
if (archiveScope != desiredScope)
throw "archive scope wrong after removing folder";
assert_folder_and_children_not_in_scope(archiveFolder, archiveScope);
}
......
......@@ -90,7 +90,7 @@ function initServerType()
var verboseName = messengerBundle.getString(propertyName);
setDivText("servertype.verbose", verboseName);
secureSelect();
secureSelect(true);
setLabelFromStringBundle("authMethod-no", "authNo");
setLabelFromStringBundle("authMethod-old", "authOld");
......@@ -183,7 +183,7 @@ function onAdvanced()
}
}
function secureSelect()
function secureSelect(aLoading)
{
var socketType = document.getElementById("server.socketType").value;
var serverType = document.getElementById("server.type").value;
......@@ -198,11 +198,11 @@ function secureSelect()
if (socketType == Ci.nsMsgSocketType.SSL) {
portDefault.value = defaultPortSecure;
if (port.value == "" || (port.value == defaultPort && prevDefaultPort != portDefault.value))
if (port.value == "" || (!aLoading && port.value == defaultPort && prevDefaultPort != portDefault.value))
port.value = defaultPortSecure;
} else {
portDefault.value = defaultPort;
if (port.value == "" || (port.value == defaultPortSecure && prevDefaultPort != portDefault.value))
if (port.value == "" || (!aLoading && port.value == defaultPortSecure && prevDefaultPort != portDefault.value))
port.value = defaultPort;
}
......
......@@ -3083,6 +3083,7 @@ NS_IMETHODIMP nsMsgAccountManager::LoadVirtualFolders()
// and we have to add a pending listener for each of them.
if (!buffer.IsEmpty())
{
ParseAndVerifyVirtualFolderScope(buffer, rdf);
dbFolderInfo->SetCharProperty(kSearchFolderUriProp, buffer);
AddVFListenersForVF(virtualFolder, buffer, rdf, msgDBService);
}
......@@ -3206,6 +3207,43 @@ nsresult nsMsgAccountManager::WriteLineToOutputStream(const char *prefix, const
return NS_OK;
}
/**
* Parse the '|' separated folder uri string into individual folders, verify
* that the folders are real. If we were to add things like wildcards, we
* could implement the expansion into real folders here.
*
* @param buffer On input, list of folder uri's, on output, verified list.
* @param rdf rdf service
*/
void nsMsgAccountManager::ParseAndVerifyVirtualFolderScope(nsCString &buffer,
nsIRDFService *rdf)
{
nsCString verifiedFolders;
nsTArray<nsCString> folderUris;
ParseString(buffer, '|', folderUris);
nsCOMPtr <nsIRDFResource> resource;
nsCOMPtr<nsIMsgIncomingServer> server;
nsCOMPtr<nsIMsgFolder> parent;
for (PRUint32 i = 0; i < folderUris.Length(); i++)
{
rdf->GetResource(folderUris[i], getter_AddRefs(resource));
nsCOMPtr <nsIMsgFolder> realFolder = do_QueryInterface(resource);
if (!realFolder)
continue;
realFolder->GetParent(getter_AddRefs(parent));
if (!parent)
continue;
realFolder->GetServer(getter_AddRefs(server));
if (!server)
continue;
if (!verifiedFolders.IsEmpty())
verifiedFolders.Append('|');
verifiedFolders.Append(folderUris[i]);
}
buffer.Assign(verifiedFolders);
}
// This conveniently works to add a single folder as well.
nsresult nsMsgAccountManager::AddVFListenersForVF(nsIMsgFolder *virtualFolder,
const nsCString& srchFolderUris,
......@@ -3582,6 +3620,8 @@ nsMsgAccountManager::RemoveFolderFromSmartFolder(nsIMsgFolder *aFolder,
{
nsCString removedFolderURI;
aFolder->GetURI(removedFolderURI);
removedFolderURI.Insert('|', 0);
removedFolderURI.Append('|');
PRUint32 flags;
aFolder->GetFlags(&flags);
NS_ASSERTION(!(flags & flagsChanged), "smart folder flag should not be set");
......
......@@ -227,6 +227,8 @@ private:
// handle virtual folders
static nsresult GetVirtualFoldersFile(nsCOMPtr<nsILocalFile>& file);
static nsresult WriteLineToOutputStream(const char *prefix, const char * line, nsIOutputStream *outputStream);
void ParseAndVerifyVirtualFolderScope(nsCString &buffer,
nsIRDFService *rdf);
nsresult AddVFListenersForVF(nsIMsgFolder *virtualFolder,
const nsCString& srchFolderUris,
nsIRDFService *rdf,
......
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* the Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Mark Banner <bugzilla@standard8.plus.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/**
* This tests that we don't try to reset the mail.server.server<n>.authMethod
* preference every time we run the migration code.
*/
Components.utils.import("resource:///modules/mailnewsMigrator.js");
function run_test() {
let prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefBranch);
// Set up some basic accounts with limited prefs - enough to satisfy the
// migrator.
prefs.setCharPref("mail.account.account1.server", "server1");
prefs.setCharPref("mail.account.account2.server", "server2");
// Server1 has nothing set.
// Server2 has useSecAuth set to true, auth_login unset
prefs.setBoolPref("mail.server.server2.useSecAuth", true);
prefs.setCharPref("mail.accountmanager.accounts",
"account1,account2");
// Now migrate the prefs.
migrateMailnews();
// Check what has been set.
do_check_false(prefs.prefHasUserValue("mail.server.server1.authMethod"));
do_check_true(prefs.prefHasUserValue("mail.server.server2.authMethod"));
do_check_eq(prefs.getIntPref("mail.server.server2.authMethod"), Ci.nsMsgAuthMethod.secure);
// Now clear the authMethod for set for server2. This simulates the user
// setting the value back to "3", i.e. Ci.nsMsgAuthMethod.passwordCleartext.
prefs.clearUserPref("mail.server.server2.authMethod");
// Now attempt migration again, e.g. a second load of TB
migrateMailnews();
// This time around, both of these should not be set.
do_check_false(prefs.prefHasUserValue("mail.server.server1.authMethod"));
do_check_false(prefs.prefHasUserValue("mail.server.server2.authMethod"));
//
// Now check SMTP
//
prefs.setCharPref("mail.smtpservers", "smtp1,smtp2");
// smtp1 has nothing set.
// smtp2 has useSecAuth set to true, auth_method unset
prefs.setBoolPref("mail.smtpserver.smtp2.useSecAuth", true);
// Now migrate the prefs
migrateMailnews();
do_check_false(prefs.prefHasUserValue("mail.smtpserver.smtp1.authMethod"));
do_check_true(prefs.prefHasUserValue("mail.smtpserver.smtp2.authMethod"));
do_check_eq(prefs.getIntPref("mail.smtpserver.smtp2.authMethod"), Ci.nsMsgAuthMethod.secure);
// Now clear the authMethod for set for smtp2. This simulates the user
// setting the value back to "3", i.e. Ci.nsMsgAuthMethod.passwordCleartext.
prefs.clearUserPref("mail.smtpserver.smtp2.authMethod");
// Now attempt migration again, e.g. a second load of TB
migrateMailnews();
// This time around, both of these should not be set.
do_check_false(prefs.prefHasUserValue("mail.smtpserver.smtp1.authMethod"));
do_check_false(prefs.prefHasUserValue("mail.smtpserver.smtp2.authMethod"));
}
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* the Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* David Bienvenu <bienvenu@mozillamessaging.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// Test loading of virtualFolders.dat, including verification of the search
// scopes, i.e., folder uri's.
const am = Components.classes["@mozilla.org/messenger/account-manager;1"]
.getService(Components.interfaces.nsIMsgAccountManager);
// main test
function run_test()
{
let vfdat = do_get_file("../../mailnews/data/test_virtualFolders.dat");
vfdat.copyTo(gProfileDir, "virtualFolders.dat");
loadLocalMailAccount();
let localMailDir = gProfileDir.clone();
localMailDir.append("Mail");
localMailDir.append("Local Folders");
localMailDir.append("unread-local");
localMailDir.create(Ci.nsIFile.NORMAL_FILE_TYPE, parseInt("0644", 8));
localMailDir.leafName = "invalidserver-local";
localMailDir.create(Ci.nsIFile.NORMAL_FILE_TYPE, parseInt("0644", 8));
am.loadVirtualFolders();
let unreadLocal = gLocalIncomingServer.rootMsgFolder.getChildNamed("unread-local");
let searchScope = unreadLocal.msgDatabase.dBFolderInfo.getCharProperty("searchFolderUri");
do_check_eq(searchScope, "mailbox://nobody@Local%20Folders/Inbox|mailbox://nobody@Local%20Folders/Trash");
let invalidServer = gLocalIncomingServer.rootMsgFolder.getChildNamed("invalidserver-local");
let searchScope = invalidServer.msgDatabase.dBFolderInfo.getCharProperty("searchFolderUri");
do_check_eq(searchScope, "mailbox://nobody@Local%20Folders/Inbox");
}
......@@ -47,6 +47,8 @@ var EXPORTED_SYMBOLS = [ "migrateMailnews" ];
Components.utils.import("resource:///modules/errUtils.js");
//Components.utils.import("resource:///modules/Services.js");
const Ci = Components.interfaces;
const kServerPrefVersion = 1;
const kSmtpPrefVersion = 1;
var gPrefs;
function migrateMailnews()
......@@ -82,6 +84,8 @@ function MigrateServerAuthPref()
if (!gPrefs.prefHasUserValue(server + "useSecAuth") &&
!gPrefs.prefHasUserValue(server + "auth_login"))
continue;
if (gPrefs.prefHasUserValue(server + "migrated"))
continue;
// auth_login = false => old-style auth
// else: useSecAuth = true => "secure auth"
// else: cleartext pw
......@@ -99,6 +103,7 @@ function MigrateServerAuthPref()
Ci.nsMsgAuthMethod.secure :
Ci.nsMsgAuthMethod.passwordCleartext) :
Ci.nsMsgAuthMethod.old);
gPrefs.setIntPref(server + "migrated", kServerPrefVersion);
}
// same again for SMTP servers
......@@ -113,6 +118,8 @@ function MigrateServerAuthPref()
if (!gPrefs.prefHasUserValue(server + "useSecAuth") &&
!gPrefs.prefHasUserValue(server + "auth_method"))
continue;
if (gPrefs.prefHasUserValue(server + "migrated"))
continue;
// auth_method = 0 => no auth
// else: useSecAuth = true => "secure auth"
// else: cleartext pw
......@@ -130,6 +137,7 @@ function MigrateServerAuthPref()
Ci.nsMsgAuthMethod.secure :
Ci.nsMsgAuthMethod.passwordCleartext) :
Ci.nsMsgAuthMethod.none);
gPrefs.setIntPref(server + "migrated", kSmtpPrefVersion);
}
} catch(e) { logException(e); }
}
......@@ -1691,6 +1691,19 @@ var GlodaMsgIndexer = {
!(aMsgFolder instanceof nsIMsgImapMailFolder))
return false;
// Some folders do not really exist; we can detect this by getStringProperty
// exploding when we call it. This is primarily a concern because
// _mapFolder calls said exploding method, but we also don't want to
// even think about indexing folders that don't exist. (Such folders are
// likely the result of a messed up profile.)
try {
// flags is used because it should always be in the cache avoiding a miss
// which would compel an msf open.
aMsgFolder.getStringProperty("flags");
} catch (ex) {
return false;
}
// Now see what our gloda folder information has to say about the folder.
let glodaFolder = GlodaDatastore._mapFolder(aMsgFolder);
return glodaFolder.indexingPriority != glodaFolder.kIndexingNeverPriority;
......
......@@ -257,7 +257,7 @@ print '''
unsigned int normalize_character(const unsigned int c)
{
if (c > ''' + ('0x%x' % (maxmapping,)) + ''' || !gNormalizeTable[c >> 6])
if (c >= ''' + ('0x%x' % (maxmapping,)) + ''' || !gNormalizeTable[c >> 6])
return c;
return gNormalizeTable[c >> 6][c & 0x3f];
}
......
......@@ -1955,7 +1955,7 @@ static const unsigned short* gNormalizeTable[] = {
unsigned int normalize_character(const unsigned int c)
{
if (c > 0x10000 || !gNormalizeTable[c >> 6])
if (c >= 0x10000 || !gNormalizeTable[c >> 6])
return c;
return gNormalizeTable[c >> 6][c & 0x3f];
}
......
......@@ -2357,7 +2357,7 @@ nsImapIncomingServer::OnStopRunningUrl(nsIURI *url, nsresult exitCode)
}
// if we get an error running the url, it's better
// not to chain the next url.
if (NS_FAILED(exitCode))
if (NS_FAILED(exitCode) && exitCode != NS_MSG_ERROR_IMAP_COMMAND_FAILED)
m_foldersToStat.Clear();
if (m_foldersToStat.Count() > 0)
m_foldersToStat[0]->UpdateStatus(this, nsnull);
......@@ -2983,19 +2983,20 @@ nsImapIncomingServer::GetNewMessagesForNonInboxFolders(nsIMsgFolder *aFolder,
// or if we are forced to check all folders
PRUint32 flags = 0;
aFolder->GetFlags(&flags);
if ((forceAllFolders &&
!(flags & (nsMsgFolderFlags::Inbox | nsMsgFolderFlags::Trash | nsMsgFolderFlags::Junk |
nsMsgFolderFlags::ImapNoselect | nsMsgFolderFlags::Virtual))) ||
(flags & nsMsgFolderFlags::CheckNew))
nsresult rv;
nsCOMPtr<nsIMsgImapMailFolder> imapFolder = do_QueryInterface(aFolder, &rv);
NS_ENSURE_SUCCESS(rv, rv);
PRBool canOpen;
imapFolder->GetCanOpenFolder(&canOpen);
if (canOpen && ((forceAllFolders &&
!(flags & (nsMsgFolderFlags::Inbox | nsMsgFolderFlags::Trash |
nsMsgFolderFlags::Junk | nsMsgFolderFlags::Virtual))) ||
flags & nsMsgFolderFlags::CheckNew))
{
// Get new messages for this folder.
aFolder->SetGettingNewMessages(PR_TRUE);
if (performingBiff)
{
nsCOMPtr<nsIMsgImapMailFolder> imapFolder(do_QueryInterface(aFolder));
if (imapFolder)
imapFolder->SetPerformingBiff(PR_TRUE);
}
imapFolder->SetPerformingBiff(PR_TRUE);
PRBool isOpen = PR_FALSE;
nsCOMPtr <nsIMsgMailSession> mailSession = do_GetService(NS_MSGMAILSESSION_CONTRACTID);
if (mailSession && aFolder)
......@@ -3011,9 +3012,7 @@ nsImapIncomingServer::GetNewMessagesForNonInboxFolders(nsIMsgFolder *aFolder,
}
if (gUseStatus && !isOpen)
{
nsCOMPtr <nsIMsgImapMailFolder> imapFolder = do_QueryInterface(aFolder);
if (imapFolder && !isServer &&
m_foldersToStat.IndexOf(imapFolder) == -1)
if (!isServer && m_foldersToStat.IndexOf(imapFolder) == -1)
m_foldersToStat.AppendObject(imapFolder);
}
else
......@@ -3022,7 +3021,7 @@ nsImapIncomingServer::GetNewMessagesForNonInboxFolders(nsIMsgFolder *aFolder,
// Loop through all subfolders to get new messages for them.
nsCOMPtr<nsISimpleEnumerator> enumerator;
nsresult rv = aFolder->GetSubFolders(getter_AddRefs(enumerator));
rv = aFolder->GetSubFolders(getter_AddRefs(enumerator));
if (NS_FAILED(rv))
return rv;
......
// This file tests that checking folders for new mail with STATUS
// doesn't try to STAT noselect folders.
var gServer, gImapServer;
var gIMAPInbox, gIMAPFolder1, gIMAPFolder2;
var gFolder2Mailbox;
load("../../mailnews/resources/messageGenerator.js");
const nsIIOService = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService);
function run_test() {
var daemon = new imapDaemon();
daemon.createMailbox("folder 1", {subscribed : true});
let folder1Mailbox = daemon.getMailbox("folder 1");
folder1Mailbox.flags.push("\\Noselect");
daemon.createMailbox("folder 2", {subscribed : true});
gFolder2Mailbox = daemon.getMailbox("folder 2");
addMessageToFolder(gFolder2Mailbox);
gServer = makeServer(daemon, "");
gImapServer = createLocalIMAPServer();
gImapServer.maximumConnectionsNumber = 1;
loadLocalMailAccount();
// We need an identity so that updateFolder doesn't fail
let acctMgr = Cc["@mozilla.org/messenger/account-manager;1"]
.getService(Ci.nsIMsgAccountManager);
let localAccount = acctMgr.createAccount();
let identity = acctMgr.createIdentity();
localAccount.addIdentity(identity);
localAccount.defaultIdentity = identity;
localAccount.incomingServer = gLocalIncomingServer;
acctMgr.defaultAccount = localAccount;
// Let's also have another account, using the same identity
let imapAccount = acctMgr.createAccount();
imapAccount.addIdentity(identity);
imapAccount.defaultIdentity = identity;
imapAccount.incomingServer = gImapServer;
// Get the folder list...
gImapServer.performExpand(null);
gServer.performTest("SUBSCRIBE");
// pref tuning: one connection only, turn off notifications
let prefBranch = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefBranch);
// Make sure no biff notifications happen
prefBranch.setBoolPref("mail.biff.play_sound", false);
prefBranch.setBoolPref("mail.biff.show_alert", false);
prefBranch.setBoolPref("mail.biff.show_tray_icon", false);
prefBranch.setBoolPref("mail.biff.animate_dock_icon", false);
let rootFolder = gImapServer.rootFolder;
gIMAPInbox = rootFolder.getFolderWithFlags(Ci.nsMsgFolderFlags.Inbox);
gFolder1 = rootFolder.getChildNamed("folder 1");
gFolder2 = rootFolder.getChildNamed("folder 2");
gFolder1.setFlag(Ci.nsMsgFolderFlags.CheckNew);
gFolder2.setFlag(Ci.nsMsgFolderFlags.CheckNew);
do_test_pending();
// imap fake server's resetTest resets the authentication state - charming.
// So poke the _test member directly.
gServer._test = true;
gIMAPInbox.getNewMessages(null, null);
gServer.performTest("STATUS");
// We want to wait for the STATUS to be really done before we issue
// more STATUS commands, so we do a NOOP on the
// INBOX, and since we only have one connection with the fake server,
// that will essentially serialize things.
gServer._test = true;
gIMAPInbox.updateFolder(null);
gServer.performTest("NOOP");
do_timeout_function(0, testCheckStatError);
}
function testCheckStatError() {
// folder 2 should have been stat'd, but not folder 1. All we can really check
// is that folder 2 was stat'd and that its unread msg count is 1
do_check_eq(gFolder2.getNumUnread(false), 1);
addMessageToFolder(gFolder2Mailbox);
gFolder1.clearFlag(Ci.nsMsgFolderFlags.ImapNoselect);
gServer._test = true;
// we've cleared the ImapNoselect flag, so we will attempt to STAT folder 1,
// which will fail. So we verify that we go on and STAT folder 2, and that
// it picks up the message we added to it above.
gIMAPInbox.getNewMessages(null, null);
gServer.performTest("STATUS");
gServer._test = true;
gServer.performTest("STATUS");
do_timeout_function(0, endTest);
}
function addMessageToFolder(mbox) {
// make a couple messges
let messages = [];
let gMessageGenerator = new MessageGenerator();
messages = messages.concat(gMessageGenerator.makeMessage());
let msgURI =
nsIIOService.newURI("data:text/plain;base64," +
btoa(messages[0].toMessageString()),
null, null);
let message = new imapMessage(msgURI.spec, mbox.uidnext++);
mbox.addMessage(message);
}
function endTest()
{
do_check_eq(gFolder2.getNumUnread(false), 2);
// Clean up the server in preparation
gServer.resetTest();
gImapServer.closeCachedConnections();
gServer.performTest();
gServer.stop();
do_test_finished();
}
version=1
uri=mailbox://nobody@Local%20Folders/unread-local
scope=mailbox://nobody@Local%20Folders/Inbox|mailbox://nobody@Local%20Folders/Trash|mailbox://nobody@Local%20Folders/non-existent
terms=ALL
searchOnline=false
uri=mailbox://nobody@Local%20Folders/invalidserver-local
scope=mailbox://nobody@Local%20Folders/Inbox|user@foo/INBOX
terms=ALL
searchOnline=false
......@@ -750,7 +750,7 @@ IMAP_RFC3501_handler.prototype = {
this._lastCommand = command;
// Are we allowed to execute this command?
if (this._enabledCommands[this._state].indexOf(command) == -1)
return this._tag + " BAD illegal command for current state";
return this._tag + " BAD illegal command for current state " + this._state;
try {
// Format the arguments nicely
......@@ -1001,8 +1001,11 @@ IMAP_RFC3501_handler.prototype = {
var mbox = this._daemon.getMailbox(args[0]);
if (!mbox || mbox.name == "")
return "NO no such mailbox";