Bug 748090 - pop3 filters that move new message to imap folders mostly won't work. r+a=Standard8
authorDavid Bienvenu <dbienvenu@mozilla.com>
Sat, 28 Apr 2012 14:49:03 +0100
changeset 10793 2eef53f31fcf3993f38e1d4b2ced5d2e7d07bee4
parent 10792 16ef547e3701fe1c7d5f799e92ed7b7947f88f6c
child 10794 6f3529e09c79729d36a79fa9b5441f9a7ef8f4ff
push id514
push userbugzilla@standard8.plus.com
push dateSat, 28 Apr 2012 14:00:31 +0000
treeherdercomm-aurora@2eef53f31fcf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs748090
Bug 748090 - pop3 filters that move new message to imap folders mostly won't work. r+a=Standard8
mailnews/local/src/nsParseMailbox.cpp
mailnews/local/src/nsPop3Sink.cpp
--- a/mailnews/local/src/nsParseMailbox.cpp
+++ b/mailnews/local/src/nsParseMailbox.cpp
@@ -1728,16 +1728,17 @@ nsParseNewMailState::nsParseNewMailState
 NS_IMPL_ISUPPORTS_INHERITED1(nsParseNewMailState, nsMsgMailboxParser, nsIMsgFilterHitNotify)
 
 nsresult
 nsParseNewMailState::Init(nsIMsgFolder *serverFolder, nsIMsgFolder *downloadFolder,
                           nsIMsgWindow *aMsgWindow, nsIMsgDBHdr *aHdr,
                           nsIOutputStream *aOutputStream)
 {
   nsresult rv;
+  Clear();
   m_rootFolder = serverFolder;
   m_msgWindow = aMsgWindow;
   m_downloadFolder = downloadFolder;
 
   m_newMsgHdr = aHdr;
   m_outputStream = aOutputStream;
   // the new mail parser isn't going to get the stream input, it seems, so we can't use
   // the OnStartRequest mechanism the mailbox parser uses. So, let's open the db right now.
--- a/mailnews/local/src/nsPop3Sink.cpp
+++ b/mailnews/local/src/nsPop3Sink.cpp
@@ -560,17 +560,18 @@ nsPop3Sink::IncorporateBegin(const char*
   // write somewhere where for some reason or another we can't write to and
   // lose the messages. See bug 62480
   if (!m_outFileStream)
       return NS_ERROR_OUT_OF_MEMORY;
 
   nsCOMPtr<nsISeekableStream> seekableOutStream = do_QueryInterface(m_outFileStream);
 
   // create a new mail parser
-  m_newMailParser = new nsParseNewMailState;
+  if (!m_newMailParser)
+    m_newMailParser = new nsParseNewMailState;
   NS_ENSURE_TRUE(m_newMailParser, NS_ERROR_OUT_OF_MEMORY);
   if (m_uidlDownload)
     m_newMailParser->DisableFilters();
 
   nsCOMPtr <nsIMsgFolder> serverFolder;
   rv = GetServerFolder(getter_AddRefs(serverFolder));
   if (NS_FAILED(rv)) return rv;