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 11465 9d82860ddf8daf23e6ca96b0c876a7a21e6a238a
parent 11464 ca811689a4acf9c56269fe6a7749de95b85eaee8
child 11466 3745a9f5d2287b14c9d3f2e5e49cf5ff62984a76
push id79
push userbugzilla@standard8.plus.com
push dateThu, 31 May 2012 21:19:05 +0000
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;