Bug 748090 - pop3 filters that move new message to imap folders mostly won't work. r+a=Standard8 for CLOSED TREE
authorDavid Bienvenu <dbienvenu@mozilla.com>
Sat, 28 Apr 2012 14:49:03 +0100
changeset 30781 53fd7df65dba2ba87e82a9821da23500a98edfb8
parent 30780 401204ffd88603efa3c1504e69fa2ff8a737cbb8
child 30782 b5ed052dcc54cd5e1a3830c2e0e9ff2fbcc9d59e
push id1
push userclokep@gmail.com
push dateMon, 07 May 2018 22:45:56 +0000
treeherdercomm-esr60@57eacde5ef40 [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 for CLOSED TREE
mailnews/local/src/nsParseMailbox.cpp
mailnews/local/src/nsPop3Sink.cpp
--- a/mailnews/local/src/nsParseMailbox.cpp
+++ b/mailnews/local/src/nsParseMailbox.cpp
@@ -1724,16 +1724,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
@@ -559,17 +559,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;