make biff not fire when junk mail arrives, r/sr=mscott 189289 part of patch from emmet@cogs.sussex.ac.uk

This commit is contained in:
bienvenu%nventure.com 2003-09-29 01:16:31 +00:00
parent 997bf5f785
commit 2b18847667
9 changed files with 440 additions and 370 deletions

View File

@ -383,7 +383,7 @@ const nsMsgBiffState nsMsgBiffState_Unknown = 2; // We dunno whether there is ne
attribute nsIMsgRetentionSettings retentionSettings;
attribute nsIMsgDownloadSettings downloadSettings;
void callFilterPlugins(in nsIMsgWindow aMsgWindow);
boolean callFilterPlugins(in nsIMsgWindow aMsgWindow);
/**
* used for order in the folder pane, folder pickers, etc.
*/

View File

@ -281,77 +281,77 @@ NS_IMETHODIMP nsMsgDBFolder::SetCharsetOverride(PRBool aCharsetOverride)
NS_IMETHODIMP nsMsgDBFolder::GetHasNewMessages(PRBool *hasNewMessages)
{
if(!hasNewMessages)
return NS_ERROR_NULL_POINTER;
nsresult rv = NS_OK;
*hasNewMessages = mNewMessages;
return rv;
if(!hasNewMessages)
return NS_ERROR_NULL_POINTER;
nsresult rv = NS_OK;
*hasNewMessages = mNewMessages;
return rv;
}
NS_IMETHODIMP nsMsgDBFolder::SetHasNewMessages(PRBool curNewMessages)
{
if (curNewMessages != mNewMessages)
{
/** @params
* nsIAtom* property, PRBool oldValue, PRBool newValue
if (curNewMessages != mNewMessages)
{
/** @params
* nsIAtom* property, PRBool oldValue, PRBool newValue
*/
PRBool oldNewMessages = mNewMessages;
mNewMessages = curNewMessages;
NotifyBoolPropertyChanged(kNewMessagesAtom, oldNewMessages, curNewMessages);
}
return NS_OK;
PRBool oldNewMessages = mNewMessages;
mNewMessages = curNewMessages;
NotifyBoolPropertyChanged(kNewMessagesAtom, oldNewMessages, curNewMessages);
}
return NS_OK;
}
NS_IMETHODIMP nsMsgDBFolder::GetGettingNewMessages(PRBool *gettingNewMessages)
{
if(!gettingNewMessages)
return NS_ERROR_NULL_POINTER;
nsresult rv = NS_OK;
*gettingNewMessages = mGettingNewMessages;
return rv;
if(!gettingNewMessages)
return NS_ERROR_NULL_POINTER;
nsresult rv = NS_OK;
*gettingNewMessages = mGettingNewMessages;
return rv;
}
NS_IMETHODIMP nsMsgDBFolder::SetGettingNewMessages(PRBool gettingNewMessages)
{
mGettingNewMessages = gettingNewMessages;
mGettingNewMessages = gettingNewMessages;
return NS_OK;
}
NS_IMETHODIMP nsMsgDBFolder::GetFirstNewMessage(nsIMsgDBHdr **firstNewMessage)
{
//If there's not a db then there can't be new messages. Return failure since you
//should use HasNewMessages first.
if(!mDatabase)
return NS_ERROR_FAILURE;
nsresult rv;
nsMsgKey key;
rv = mDatabase->GetFirstNew(&key);
if(NS_FAILED(rv))
return rv;
nsCOMPtr<nsIMsgDBHdr> hdr;
rv = mDatabase->GetMsgHdrForKey(key, getter_AddRefs(hdr));
if(NS_FAILED(rv))
return rv;
return mDatabase->GetMsgHdrForKey(key, firstNewMessage);
//If there's not a db then there can't be new messages. Return failure since you
//should use HasNewMessages first.
if(!mDatabase)
return NS_ERROR_FAILURE;
nsresult rv;
nsMsgKey key;
rv = mDatabase->GetFirstNew(&key);
if(NS_FAILED(rv))
return rv;
nsCOMPtr<nsIMsgDBHdr> hdr;
rv = mDatabase->GetMsgHdrForKey(key, getter_AddRefs(hdr));
if(NS_FAILED(rv))
return rv;
return mDatabase->GetMsgHdrForKey(key, firstNewMessage);
}
NS_IMETHODIMP nsMsgDBFolder::ClearNewMessages()
{
nsresult rv = NS_OK;
//If there's no db then there's nothing to clear.
if(mDatabase)
{
rv = mDatabase->ClearNewList(PR_TRUE);
}
return rv;
nsresult rv = NS_OK;
//If there's no db then there's nothing to clear.
if(mDatabase)
{
rv = mDatabase->ClearNewList(PR_TRUE);
}
return rv;
}
// helper function that gets the cache element that corresponds to the passed in file spec.
@ -359,141 +359,141 @@ NS_IMETHODIMP nsMsgDBFolder::ClearNewMessages()
// nsMsgDBFolder. If it lived at a higher level, we could cache the account manager and folder cache.
nsresult nsMsgDBFolder::GetFolderCacheElemFromFileSpec(nsIFileSpec *fileSpec, nsIMsgFolderCacheElement **cacheElement)
{
nsresult result;
if (!fileSpec || !cacheElement)
return NS_ERROR_NULL_POINTER;
nsCOMPtr <nsIMsgFolderCache> folderCache;
nsresult result;
if (!fileSpec || !cacheElement)
return NS_ERROR_NULL_POINTER;
nsCOMPtr <nsIMsgFolderCache> folderCache;
#ifdef DEBUG_bienvenu1
PRBool exists;
NS_ASSERTION(NS_SUCCEEDED(fileSpec->Exists(&exists)) && exists, "whoops, file doesn't exist, mac will break");
PRBool exists;
NS_ASSERTION(NS_SUCCEEDED(fileSpec->Exists(&exists)) && exists, "whoops, file doesn't exist, mac will break");
#endif
nsCOMPtr<nsIMsgAccountManager> accountMgr =
do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &result);
if(NS_SUCCEEDED(result))
{
result = accountMgr->GetFolderCache(getter_AddRefs(folderCache));
if (NS_SUCCEEDED(result) && folderCache)
{
nsXPIDLCString persistentPath;
fileSpec->GetPersistentDescriptorString(getter_Copies(persistentPath));
result = folderCache->GetCacheElement(persistentPath, PR_FALSE, cacheElement);
}
}
return result;
nsCOMPtr<nsIMsgAccountManager> accountMgr =
do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &result);
if(NS_SUCCEEDED(result))
{
result = accountMgr->GetFolderCache(getter_AddRefs(folderCache));
if (NS_SUCCEEDED(result) && folderCache)
{
nsXPIDLCString persistentPath;
fileSpec->GetPersistentDescriptorString(getter_Copies(persistentPath));
result = folderCache->GetCacheElement(persistentPath, PR_FALSE, cacheElement);
}
}
return result;
}
nsresult nsMsgDBFolder::ReadDBFolderInfo(PRBool force)
{
// Since it turns out to be pretty expensive to open and close
// the DBs all the time, if we have to open it once, get everything
// we might need while we're here
nsresult result=NS_ERROR_FAILURE;
// don't need to reload from cache if we've already read from cache,
// and, we might get stale info, so don't do it.
if (!mInitializedFromCache)
{
nsCOMPtr <nsIFileSpec> dbPath;
result = GetFolderCacheKey(getter_AddRefs(dbPath));
if (dbPath)
{
nsCOMPtr <nsIMsgFolderCacheElement> cacheElement;
result = GetFolderCacheElemFromFileSpec(dbPath, getter_AddRefs(cacheElement));
if (NS_SUCCEEDED(result) && cacheElement)
{
result = ReadFromFolderCacheElem(cacheElement);
}
}
}
// if (m_master->InitFolderFromCache (this))
// return err;
if (force || !mInitializedFromCache)
// Since it turns out to be pretty expensive to open and close
// the DBs all the time, if we have to open it once, get everything
// we might need while we're here
nsresult result=NS_ERROR_FAILURE;
// don't need to reload from cache if we've already read from cache,
// and, we might get stale info, so don't do it.
if (!mInitializedFromCache)
{
nsCOMPtr <nsIFileSpec> dbPath;
result = GetFolderCacheKey(getter_AddRefs(dbPath));
if (dbPath)
{
nsCOMPtr<nsIDBFolderInfo> folderInfo;
nsCOMPtr<nsIMsgDatabase> db;
result = GetDBFolderInfoAndDB(getter_AddRefs(folderInfo), getter_AddRefs(db));
if(NS_SUCCEEDED(result))
nsCOMPtr <nsIMsgFolderCacheElement> cacheElement;
result = GetFolderCacheElemFromFileSpec(dbPath, getter_AddRefs(cacheElement));
if (NS_SUCCEEDED(result) && cacheElement)
{
result = ReadFromFolderCacheElem(cacheElement);
}
}
}
// if (m_master->InitFolderFromCache (this))
// return err;
if (force || !mInitializedFromCache)
{
nsCOMPtr<nsIDBFolderInfo> folderInfo;
nsCOMPtr<nsIMsgDatabase> db;
result = GetDBFolderInfoAndDB(getter_AddRefs(folderInfo), getter_AddRefs(db));
if(NS_SUCCEEDED(result))
{
mIsCachable = PR_TRUE;
if (folderInfo)
{
if (!mInitializedFromCache)
{
mIsCachable = PR_TRUE;
if (folderInfo)
{
if (!mInitializedFromCache)
{
folderInfo->GetFlags((PRInt32 *)&mFlags);
folderInfo->GetFlags((PRInt32 *)&mFlags);
#ifdef DEBUG_bienvenu1
nsXPIDLString name;
GetName(getter_Copies(name));
NS_ASSERTION(Compare(name, kLocalizedTrashName) || (mFlags & MSG_FOLDER_FLAG_TRASH), "lost trash flag");
nsXPIDLString name;
GetName(getter_Copies(name));
NS_ASSERTION(Compare(name, kLocalizedTrashName) || (mFlags & MSG_FOLDER_FLAG_TRASH), "lost trash flag");
#endif
mInitializedFromCache = PR_TRUE;
}
folderInfo->GetNumMessages(&mNumTotalMessages);
folderInfo->GetNumNewMessages(&mNumUnreadMessages);
mInitializedFromCache = PR_TRUE;
}
folderInfo->GetNumMessages(&mNumTotalMessages);
folderInfo->GetNumNewMessages(&mNumUnreadMessages);
folderInfo->GetExpungedBytes((PRInt32 *)&mExpungedBytes);
nsXPIDLCString utf8Name;
folderInfo->GetFolderName(getter_Copies(utf8Name));
if (!utf8Name.IsEmpty())
mName = NS_ConvertUTF8toUCS2(utf8Name.get());
//These should be put in IMAP folder only.
//folderInfo->GetImapTotalPendingMessages(&mNumPendingTotalMessages);
//folderInfo->GetImapUnreadPendingMessages(&mNumPendingUnreadMessages);
PRBool defaultUsed;
folderInfo->GetCharacterSet(&mCharset, &defaultUsed);
if (defaultUsed)
mCharset.Assign(NS_LITERAL_STRING(""));
folderInfo->GetCharacterSetOverride(&mCharsetOverride);
if (db) {
PRBool hasnew;
nsresult rv;
rv = db->HasNew(&hasnew);
if (NS_FAILED(rv)) return rv;
if (!hasnew && mNumPendingUnreadMessages <= 0) {
ClearFlag(MSG_FOLDER_FLAG_GOT_NEW);
}
}
}
//These should be put in IMAP folder only.
//folderInfo->GetImapTotalPendingMessages(&mNumPendingTotalMessages);
//folderInfo->GetImapUnreadPendingMessages(&mNumPendingUnreadMessages);
PRBool defaultUsed;
folderInfo->GetCharacterSet(&mCharset, &defaultUsed);
if (defaultUsed)
mCharset.Assign(NS_LITERAL_STRING(""));
folderInfo->GetCharacterSetOverride(&mCharsetOverride);
if (db) {
PRBool hasnew;
nsresult rv;
rv = db->HasNew(&hasnew);
if (NS_FAILED(rv)) return rv;
if (!hasnew && mNumPendingUnreadMessages <= 0) {
ClearFlag(MSG_FOLDER_FLAG_GOT_NEW);
}
}
folderInfo = nsnull;
if (db)
db->Close(PR_FALSE);
}
}
return result;
folderInfo = nsnull;
if (db)
db->Close(PR_FALSE);
}
return result;
}
nsresult nsMsgDBFolder::SendFlagNotifications(nsISupports *item, PRUint32 oldFlags, PRUint32 newFlags)
{
nsresult rv = NS_OK;
PRUint32 changedFlags = oldFlags ^ newFlags;
if((changedFlags & MSG_FLAG_READ) && (changedFlags & MSG_FLAG_NEW))
{
//..so..if the msg is read in the folder and the folder has new msgs clear the account level and status bar biffs.
rv = NotifyPropertyFlagChanged(item, kStatusAtom, oldFlags, newFlags);
rv = SetBiffState(nsMsgBiffState_NoMail);
}
else if(changedFlags & (MSG_FLAG_READ | MSG_FLAG_REPLIED | MSG_FLAG_FORWARDED
| MSG_FLAG_IMAP_DELETED | MSG_FLAG_NEW | MSG_FLAG_OFFLINE))
{
rv = NotifyPropertyFlagChanged(item, kStatusAtom, oldFlags, newFlags);
}
else if((changedFlags & MSG_FLAG_MARKED))
{
rv = NotifyPropertyFlagChanged(item, kFlaggedAtom, oldFlags, newFlags);
}
return rv;
nsresult rv = NS_OK;
PRUint32 changedFlags = oldFlags ^ newFlags;
if((changedFlags & MSG_FLAG_READ) && (changedFlags & MSG_FLAG_NEW))
{
//..so..if the msg is read in the folder and the folder has new msgs clear the account level and status bar biffs.
rv = NotifyPropertyFlagChanged(item, kStatusAtom, oldFlags, newFlags);
rv = SetBiffState(nsMsgBiffState_NoMail);
}
else if(changedFlags & (MSG_FLAG_READ | MSG_FLAG_REPLIED | MSG_FLAG_FORWARDED
| MSG_FLAG_IMAP_DELETED | MSG_FLAG_NEW | MSG_FLAG_OFFLINE))
{
rv = NotifyPropertyFlagChanged(item, kStatusAtom, oldFlags, newFlags);
}
else if((changedFlags & MSG_FLAG_MARKED))
{
rv = NotifyPropertyFlagChanged(item, kFlaggedAtom, oldFlags, newFlags);
}
return rv;
}
NS_IMETHODIMP nsMsgDBFolder::DownloadMessagesForOffline(nsISupportsArray *messages, nsIMsgWindow *)
@ -1680,160 +1680,163 @@ nsMsgDBFolder::SpamFilterClassifyMessages(const char **aURIArray, PRUint32 aURIC
* Call the filter plugins (XXX currently just one)
*/
NS_IMETHODIMP
nsMsgDBFolder::CallFilterPlugins(nsIMsgWindow *aMsgWindow)
nsMsgDBFolder::CallFilterPlugins(nsIMsgWindow *aMsgWindow, PRBool *aFiltersRun)
{
nsCOMPtr<nsIMsgIncomingServer> server;
nsCOMPtr<nsISpamSettings> spamSettings;
nsCOMPtr<nsIAbMDBDirectory> whiteListDirectory;
nsCOMPtr<nsIMsgHeaderParser> headerParser;
PRBool useWhiteList = PR_FALSE;
PRInt32 spamLevel = 0;
nsXPIDLCString whiteListAbURI;
// if this is the junk folder, or the trash folder
// don't analyze for spam, because we don't care
//
// if it's the sent, unsent, templates, or drafts,
// don't analyze for spam, because the user
// created that message
//
// if it's a public imap folder, or another users
// imap folder, don't analyze for spam, because
// it's not ours to analyze
if (mFlags & (MSG_FOLDER_FLAG_JUNK | MSG_FOLDER_FLAG_TRASH |
MSG_FOLDER_FLAG_SENTMAIL | MSG_FOLDER_FLAG_QUEUE |
MSG_FOLDER_FLAG_DRAFTS | MSG_FOLDER_FLAG_TEMPLATES |
MSG_FOLDER_FLAG_IMAP_PUBLIC | MSG_FOLDER_FLAG_IMAP_OTHER_USER))
return NS_OK;
NS_ENSURE_ARG_POINTER(aFiltersRun);
*aFiltersRun = PR_FALSE;
nsCOMPtr<nsIMsgIncomingServer> server;
nsCOMPtr<nsISpamSettings> spamSettings;
nsCOMPtr<nsIAbMDBDirectory> whiteListDirectory;
nsCOMPtr<nsIMsgHeaderParser> headerParser;
PRBool useWhiteList = PR_FALSE;
PRInt32 spamLevel = 0;
nsXPIDLCString whiteListAbURI;
nsresult rv = GetServer(getter_AddRefs(server));
NS_ENSURE_SUCCESS(rv, rv);
rv = server->GetSpamSettings(getter_AddRefs(spamSettings));
nsCOMPtr <nsIMsgFilterPlugin> filterPlugin;
server->GetSpamFilterPlugin(getter_AddRefs(filterPlugin));
if (!filterPlugin) // it's not an error not to have the filter plugin.
return NS_OK;
// if this is the junk folder, or the trash folder
// don't analyze for spam, because we don't care
//
// if it's the sent, unsent, templates, or drafts,
// don't analyze for spam, because the user
// created that message
//
// if it's a public imap folder, or another users
// imap folder, don't analyze for spam, because
// it's not ours to analyze
if (mFlags & (MSG_FOLDER_FLAG_JUNK | MSG_FOLDER_FLAG_TRASH |
MSG_FOLDER_FLAG_SENTMAIL | MSG_FOLDER_FLAG_QUEUE |
MSG_FOLDER_FLAG_DRAFTS | MSG_FOLDER_FLAG_TEMPLATES |
MSG_FOLDER_FLAG_IMAP_PUBLIC | MSG_FOLDER_FLAG_IMAP_OTHER_USER))
return NS_OK;
NS_ENSURE_SUCCESS(rv, rv);
spamSettings->GetLevel(&spamLevel);
if (!spamLevel)
return NS_OK;
nsCOMPtr<nsIMsgMailSession> mailSession =
do_GetService(NS_MSGMAILSESSION_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDatabase)
{
rv = GetDatabase(nsnull); // XXX is nsnull a reasonable arg here?
NS_ENSURE_SUCCESS(rv, rv);
}
nsresult rv = GetServer(getter_AddRefs(server));
NS_ENSURE_SUCCESS(rv, rv);
rv = server->GetSpamSettings(getter_AddRefs(spamSettings));
nsCOMPtr <nsIMsgFilterPlugin> filterPlugin;
server->GetSpamFilterPlugin(getter_AddRefs(filterPlugin));
if (!filterPlugin) // it's not an error not to have the filter plugin.
return NS_OK;
// get the list of new messages
//
nsMsgKeyArray *newMessageKeys;
rv = mDatabase->GetNewList(&newMessageKeys);
NS_ENSURE_SUCCESS(rv, rv);
// if there weren't any, just return
//
if (!newMessageKeys || !newMessageKeys->GetSize())
return NS_OK;
spamSettings->GetUseWhiteList(&useWhiteList);
if (useWhiteList)
{
spamSettings->GetWhiteListAbURI(getter_Copies(whiteListAbURI));
NS_ENSURE_SUCCESS(rv, rv);
spamSettings->GetLevel(&spamLevel);
if (!spamLevel)
return NS_OK;
nsCOMPtr<nsIMsgMailSession> mailSession =
do_GetService(NS_MSGMAILSESSION_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
if (!mDatabase)
{
rv = GetDatabase(nsnull); // XXX is nsnull a reasonable arg here?
NS_ENSURE_SUCCESS(rv, rv);
if (!whiteListAbURI.IsEmpty())
{
nsCOMPtr <nsIRDFService> rdfService = do_GetService("@mozilla.org/rdf/rdf-service;1",&rv);
NS_ENSURE_SUCCESS(rv, rv);
}
nsCOMPtr <nsIRDFResource> resource;
rv = rdfService->GetResource(whiteListAbURI, getter_AddRefs(resource));
NS_ENSURE_SUCCESS(rv, rv);
// get the list of new messages
//
nsMsgKeyArray *newMessageKeys;
rv = mDatabase->GetNewList(&newMessageKeys);
NS_ENSURE_SUCCESS(rv, rv);
whiteListDirectory = do_QueryInterface(resource, &rv);
NS_ENSURE_SUCCESS(rv, rv);
headerParser = do_GetService(NS_MAILNEWS_MIME_HEADER_PARSER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
}
// if we can't get the db, we probably want to continue firing spam filters.
}
// if there weren't any, just return
//
if (!newMessageKeys || !newMessageKeys->GetSize())
return NS_OK;
// build up list of keys to classify
//
nsXPIDLCString uri;
nsMsgKeyArray keysToClassify;
PRUint32 numNewMessages = newMessageKeys->GetSize();
for ( PRUint32 i=0 ; i < numNewMessages ; ++i )
spamSettings->GetUseWhiteList(&useWhiteList);
if (useWhiteList)
{
spamSettings->GetWhiteListAbURI(getter_Copies(whiteListAbURI));
NS_ENSURE_SUCCESS(rv, rv);
if (!whiteListAbURI.IsEmpty())
{
nsXPIDLCString junkScore;
nsCOMPtr <nsIMsgDBHdr> msgHdr;
nsMsgKey msgKey = newMessageKeys->GetAt(i);
rv = mDatabase->GetMsgHdrForKey(msgKey, getter_AddRefs(msgHdr));
if (!NS_SUCCEEDED(rv))
continue;
nsCOMPtr <nsIRDFService> rdfService = do_GetService("@mozilla.org/rdf/rdf-service;1",&rv);
NS_ENSURE_SUCCESS(rv, rv);
msgHdr->GetStringProperty("junkscore", getter_Copies(junkScore));
if (!junkScore.IsEmpty()) // ignore already scored messages.
continue;
// check whitelist first:
if (whiteListDirectory)
nsCOMPtr <nsIRDFResource> resource;
rv = rdfService->GetResource(whiteListAbURI, getter_AddRefs(resource));
NS_ENSURE_SUCCESS(rv, rv);
whiteListDirectory = do_QueryInterface(resource, &rv);
NS_ENSURE_SUCCESS(rv, rv);
headerParser = do_GetService(NS_MAILNEWS_MIME_HEADER_PARSER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
}
// if we can't get the db, we probably want to continue firing spam filters.
}
// build up list of keys to classify
//
nsXPIDLCString uri;
nsMsgKeyArray keysToClassify;
PRUint32 numNewMessages = newMessageKeys->GetSize();
for ( PRUint32 i=0 ; i < numNewMessages ; ++i )
{
nsXPIDLCString junkScore;
nsCOMPtr <nsIMsgDBHdr> msgHdr;
nsMsgKey msgKey = newMessageKeys->GetAt(i);
rv = mDatabase->GetMsgHdrForKey(msgKey, getter_AddRefs(msgHdr));
if (!NS_SUCCEEDED(rv))
continue;
msgHdr->GetStringProperty("junkscore", getter_Copies(junkScore));
if (!junkScore.IsEmpty()) // ignore already scored messages.
continue;
// check whitelist first:
if (whiteListDirectory)
{
if (NS_SUCCEEDED(rv))
{
PRBool cardExists = PR_FALSE;
nsXPIDLCString author;
nsXPIDLCString authorEmailAddress;
msgHdr->GetAuthor(getter_Copies(author));
rv = headerParser->ExtractHeaderAddressMailboxes(nsnull, author.get(), getter_Copies(authorEmailAddress));
// don't want to abort the rest of the scoring.
if (NS_SUCCEEDED(rv))
rv = whiteListDirectory->HasCardForEmailAddress(authorEmailAddress, &cardExists);
if (NS_SUCCEEDED(rv) && cardExists)
{
PRBool cardExists = PR_FALSE;
nsXPIDLCString author;
nsXPIDLCString authorEmailAddress;
msgHdr->GetAuthor(getter_Copies(author));
rv = headerParser->ExtractHeaderAddressMailboxes(nsnull, author.get(), getter_Copies(authorEmailAddress));
// don't want to abort the rest of the scoring.
if (NS_SUCCEEDED(rv))
rv = whiteListDirectory->HasCardForEmailAddress(authorEmailAddress, &cardExists);
if (NS_SUCCEEDED(rv) && cardExists)
{
// mark this msg as non-junk, because we whitelisted it.
mDatabase->SetStringProperty(msgKey, "junkscore", "0");
mDatabase->SetStringProperty(msgKey, "junkscoreorigin", "plugin");
continue; // skip this msg since it's in the white list
}
// mark this msg as non-junk, because we whitelisted it.
mDatabase->SetStringProperty(msgKey, "junkscore", "0");
mDatabase->SetStringProperty(msgKey, "junkscoreorigin", "plugin");
continue; // skip this msg since it's in the white list
}
}
keysToClassify.Add(newMessageKeys->GetAt(i));
}
if (keysToClassify.GetSize() > 0)
{
PRUint32 numMessagesToClassify = keysToClassify.GetSize();
char ** messageURIs = (char **) PR_MALLOC(sizeof(const char *) * numMessagesToClassify);
if (!messageURIs)
return NS_ERROR_OUT_OF_MEMORY;
for ( PRUint32 msgIndex=0 ; msgIndex < numMessagesToClassify ; ++msgIndex )
{
// generate a URI for the message
//
rv = GenerateMessageURI(keysToClassify.GetAt(msgIndex), &messageURIs[msgIndex]);
if (NS_FAILED(rv))
NS_WARNING("nsMsgDBFolder::CallFilterPlugins(): could not"
" generate URI for message");
}
// filterMsgs
//
nsCOMPtr <nsIJunkMailPlugin> junkMailPlugin = do_QueryInterface(filterPlugin);
rv = SpamFilterClassifyMessages((const char **) messageURIs, numMessagesToClassify, aMsgWindow, junkMailPlugin);
for ( PRUint32 freeIndex=0 ; freeIndex < numMessagesToClassify ; ++freeIndex )
PR_Free(messageURIs[freeIndex]);
PR_Free(messageURIs);
keysToClassify.Add(newMessageKeys->GetAt(i));
}
if (keysToClassify.GetSize() > 0)
{
PRUint32 numMessagesToClassify = keysToClassify.GetSize();
char ** messageURIs = (char **) PR_MALLOC(sizeof(const char *) * numMessagesToClassify);
if (!messageURIs)
return NS_ERROR_OUT_OF_MEMORY;
for ( PRUint32 msgIndex=0 ; msgIndex < numMessagesToClassify ; ++msgIndex )
{
// generate a URI for the message
//
rv = GenerateMessageURI(keysToClassify.GetAt(msgIndex), &messageURIs[msgIndex]);
if (NS_FAILED(rv))
NS_WARNING("nsMsgDBFolder::CallFilterPlugins(): could not"
" generate URI for message");
}
NS_DELETEXPCOM(newMessageKeys);
return rv;
// filterMsgs
//
*aFiltersRun = PR_TRUE;
nsCOMPtr <nsIJunkMailPlugin> junkMailPlugin = do_QueryInterface(filterPlugin);
rv = SpamFilterClassifyMessages((const char **) messageURIs, numMessagesToClassify, aMsgWindow, junkMailPlugin);
for ( PRUint32 freeIndex=0 ; freeIndex < numMessagesToClassify ; ++freeIndex )
PR_Free(messageURIs[freeIndex]);
PR_Free(messageURIs);
}
NS_DELETEXPCOM(newMessageKeys);
return rv;
}
NS_IMETHODIMP
@ -1919,3 +1922,23 @@ nsresult nsMsgDBFolder::PromptForCachePassword(nsIMsgIncomingServer *server, nsI
while (NS_SUCCEEDED(rv) && rv != NS_MSG_PASSWORD_PROMPT_CANCELLED && userDidntCancel && !passwordCorrect);
return (!passwordCorrect) ? NS_ERROR_FAILURE : rv;
}
nsresult nsMsgDBFolder::PerformBiffNotifications(void)
{
nsCOMPtr<nsIMsgIncomingServer> server;
nsresult rv = GetServer(getter_AddRefs(server));
NS_ENSURE_SUCCESS(rv, rv);
PRInt32 numBiffMsgs = 0;
nsCOMPtr<nsIMsgFolder> root;
rv = GetRootFolder(getter_AddRefs(root));
root->GetNumNewMessages(PR_TRUE, &numBiffMsgs);
if (numBiffMsgs > 0)
{
server->SetPerformingBiff(true);
SetBiffState(nsIMsgFolder::nsMsgBiffState_NewMail);
server->SetPerformingBiff(false);
}
return NS_OK;
}

View File

@ -122,7 +122,7 @@ public:
NS_IMETHOD SetDBTransferInfo(nsIDBFolderInfo *aTransferInfo);
NS_IMETHOD GetStringProperty(const char *propertyName, char **propertyValue);
NS_IMETHOD SetStringProperty(const char *propertyName, const char *propertyValue);
NS_IMETHOD CallFilterPlugins(nsIMsgWindow *aMsgWindow);
NS_IMETHOD CallFilterPlugins(nsIMsgWindow *aMsgWindow, PRBool *aFiltersRun);
NS_IMETHOD GetLastMessageLoaded(nsMsgKey *aMsgKey);
NS_IMETHOD SetLastMessageLoaded(nsMsgKey aMsgKey);
@ -151,6 +151,8 @@ protected:
nsresult GetPromptPurgeThreshold(PRBool *aPrompt);
nsresult GetPurgeThreshold(PRInt32 *aThreshold);
nsresult PerformBiffNotifications(void); // if there are new, non spam messages, do biff
virtual nsresult SpamFilterClassifyMessage(const char *aURI, nsIMsgWindow *aMsgWindow, nsIJunkMailPlugin *aJunkMailPlugin);
virtual nsresult SpamFilterClassifyMessages(const char **aURIArray, PRUint32 aURICount, nsIMsgWindow *aMsgWindow, nsIJunkMailPlugin *aJunkMailPlugin);

View File

@ -2451,7 +2451,6 @@ NS_IMETHODIMP nsImapMailFolder::UpdateImapMailboxInfo(
server->SetPerformingBiff(PR_TRUE);
SetNumNewMessages(keysToFetch.GetSize());
SetBiffState(nsIMsgFolder::nsMsgBiffState_NewMail);
}
}
SyncFlags(flagState);
@ -4491,14 +4490,6 @@ nsImapMailFolder::OnStopRunningUrl(nsIURI *aUrl, nsresult aExitCode)
if (mailUrl)
rv = mailUrl->UnRegisterListener(this);
if (!msgWindow) // if we don't have a window then we are probably running a biff url
{
nsCOMPtr<nsIMsgIncomingServer> server;
GetServer(getter_AddRefs(server));
if (server)
server->SetPerformingBiff(PR_FALSE);
m_performingBiff = PR_FALSE;
}
}
SetGettingNewMessages(PR_FALSE); // if we're not running a url, we must not be getting new mail :-)
@ -4792,6 +4783,10 @@ nsImapMailFolder::HeaderFetchCompleted(nsIImapProtocol* aProtocol)
if (mDatabase)
mDatabase->Commit(nsMsgDBCommitType::kLargeCommit);
SetSizeOnDisk(mFolderSize);
PRInt32 numNewBiffMsgs = 0;
if (m_performingBiff)
GetNumNewMessages(PR_FALSE, &numNewBiffMsgs);
if (m_moveCoalescer)
{
m_moveCoalescer->PlaybackMoves ();
@ -4844,7 +4839,23 @@ nsImapMailFolder::HeaderFetchCompleted(nsIImapProtocol* aProtocol)
}
}
CallFilterPlugins(msgWindow);
PRBool filtersRun;
CallFilterPlugins(msgWindow, &filtersRun);
if (!filtersRun && m_performingBiff && mDatabase && numNewBiffMsgs > 0)
{
// If we are performing biff for this folder, tell the
// stand-alone biff about the new high water mark
// We must ensure that the server knows that we are performing biff.
// Otherwise the stand-alone biff won't fire.
nsCOMPtr<nsIMsgIncomingServer> server;
if (NS_SUCCEEDED(GetServer(getter_AddRefs(server))) && server)
server->SetPerformingBiff(PR_TRUE);
SetBiffState(nsIMsgFolder::nsMsgBiffState_NewMail);
if (server)
server->SetPerformingBiff(PR_FALSE);
m_performingBiff = PR_FALSE;
}
if (m_filterList)
(void)m_filterList->FlushLogIfNecessary();
@ -7265,6 +7276,7 @@ nsImapMailFolder::OnMessageClassified(const char *aMsgURI, nsMsgJunkStatus aClas
if (m_moveCoalescer)
{
nsMsgKeyArray *keysToClassify = m_moveCoalescer->GetKeyBucket((aClassification == nsIJunkMailPlugin::JUNK) ? 0 : 1);
NS_ASSERTION(keysToClassify, "error getting key bucket");
if (keysToClassify)
keysToClassify->Add(msgKey);
}
@ -7337,6 +7349,17 @@ nsImapMailFolder::OnMessageClassified(const char *aMsgURI, nsMsgJunkStatus aClas
if (nonJunkKeysToClassify && nonJunkKeysToClassify->GetSize() > 0)
StoreCustomKeywords(m_moveCoalescer->GetMsgWindow(), "NonJunk", "", nonJunkKeysToClassify->GetArray(), nonJunkKeysToClassify->GetSize(), nsnull);
m_moveCoalescer->PlaybackMoves();
// If we are performing biff for this folder, tell the server object
if (m_performingBiff)
{
// we don't need to adjust the num new messages in this folder because
// the playback moves code already did that.
(void) PerformBiffNotifications();
nsCOMPtr<nsIMsgIncomingServer> server;
if (NS_SUCCEEDED(GetServer(getter_AddRefs(server))) && server)
server->SetPerformingBiff(PR_FALSE);
m_performingBiff = PR_FALSE;
}
junkKeysToClassify->RemoveAll();
nonJunkKeysToClassify->RemoveAll();
}

View File

@ -44,6 +44,8 @@
#include "nsIMsgCopyService.h"
#include "nsMsgBaseCID.h"
#include "nsIMsgFolder.h" // TO include biffState enum. Change to bool later...
#include "nsMsgFolderFlags.h"
NS_IMPL_ISUPPORTS1(nsImapMoveCoalescer, nsISupports)
@ -132,10 +134,14 @@ nsresult nsImapMoveCoalescer::PlaybackMoves()
PRInt32 numKeysToAdd = keysToAdd->GetSize();
if (numKeysToAdd == 0)
continue;
destFolder->SetNumNewMessages(numKeysToAdd);
destFolder->SetHasNewMessages(PR_TRUE);
PRUint32 destFlags;
destFolder->GetFlags(&destFlags);
if (! (destFlags & MSG_FOLDER_FLAG_JUNK)) // don't set has new on junk folder
{
destFolder->SetNumNewMessages(numKeysToAdd);
destFolder->SetHasNewMessages(PR_TRUE);
}
// adjust the new message count on the source folder
PRInt32 oldNewMessageCount = 0;
m_sourceFolder->GetNumNewMessages(PR_FALSE, &oldNewMessageCount);
@ -174,9 +180,10 @@ nsresult nsImapMoveCoalescer::PlaybackMoves()
nsMsgKeyArray *nsImapMoveCoalescer::GetKeyBucket(PRInt32 keyArrayIndex)
{
if (m_keyBuckets.Count() < keyArrayIndex + 1)
PRInt32 bucketCount = m_keyBuckets.Count();
if (bucketCount < keyArrayIndex + 1)
{
for (PRInt32 i = 0; i < keyArrayIndex + 1 - m_keyBuckets.Count(); i++)
for (PRInt32 i = 0; i < keyArrayIndex + 1 - bucketCount; i++)
{
nsMsgKeyArray *keysToAdd = new nsMsgKeyArray;
if (!keysToAdd)

View File

@ -712,9 +712,10 @@ nsMsgLocalMailFolder::UpdateFolder(nsIMsgWindow *aWindow)
else if (mCopyState)
mCopyState->m_notifyFolderLoaded = PR_TRUE; //defer folder loaded notification
}
PRBool filtersRun;
// if we have new messages, try the filter plugins.
if (NS_SUCCEEDED(rv) && (mFlags & MSG_FOLDER_FLAG_GOT_NEW))
(void) CallFilterPlugins(aWindow);
(void) CallFilterPlugins(aWindow, &filtersRun);
return rv;
}
@ -2182,10 +2183,10 @@ nsMsgLocalMailFolder::CopyFileMessage(nsIFileSpec* fileSpec, nsIMsgDBHdr*
}
rv = fileSpec->OpenStreamForReading();
NS_ENSURE_SUCCESS(rv,rv);
if (NS_FAILED(rv)) goto done;
rv = fileSpec->GetInputStream(getter_AddRefs(inputStream));
NS_ENSURE_SUCCESS(rv,rv);
if (NS_FAILED(rv)) goto done;
rv = NS_ERROR_NULL_POINTER;
if (inputStream)
@ -2199,15 +2200,11 @@ nsMsgLocalMailFolder::CopyFileMessage(nsIFileSpec* fileSpec, nsIMsgDBHdr*
if (NS_FAILED(rv)) goto done;
if (msgToReplace && mDatabase) //mDatabase should have been initialized above - if we got msgDb
{
rv = DeleteMessage(msgToReplace, msgWindow, PR_TRUE, PR_TRUE);
}
done:
if(NS_FAILED(rv))
{
(void) OnCopyCompleted(fileSupport, PR_FALSE);
}
fileSpec->CloseStream();
return rv;
@ -2364,21 +2361,21 @@ NS_IMETHODIMP nsMsgLocalMailFolder::BeginCopy(nsIMsgDBHdr *message)
NS_IMETHODIMP nsMsgLocalMailFolder::CopyData(nsIInputStream *aIStream, PRInt32 aLength)
{
//check to make sure we have control of the write.
//check to make sure we have control of the write.
PRBool haveSemaphore;
nsresult rv = NS_OK;
nsresult rv = NS_OK;
rv = TestSemaphore(NS_STATIC_CAST(nsIMsgLocalMailFolder*, this),
&haveSemaphore);
if(NS_FAILED(rv))
return rv;
if(!haveSemaphore)
return NS_MSG_FOLDER_BUSY;
rv = TestSemaphore(NS_STATIC_CAST(nsIMsgLocalMailFolder*, this),
&haveSemaphore);
if(NS_FAILED(rv))
return rv;
if(!haveSemaphore)
return NS_MSG_FOLDER_BUSY;
if (!mCopyState)
return NS_ERROR_OUT_OF_MEMORY;
PRUint32 readCount;
PRUint32 readCount;
if ( aLength + mCopyState->m_leftOver > mCopyState->m_dataBufferSize )
{
mCopyState->m_dataBuffer = (char *) PR_REALLOC(mCopyState->m_dataBuffer, aLength + mCopyState->m_leftOver+ 1);
@ -2386,13 +2383,13 @@ NS_IMETHODIMP nsMsgLocalMailFolder::CopyData(nsIInputStream *aIStream, PRInt32 a
return NS_ERROR_OUT_OF_MEMORY;
mCopyState->m_dataBufferSize = aLength + mCopyState->m_leftOver;
}
mCopyState->m_fileStream->seek(PR_SEEK_END, 0);
mCopyState->m_fileStream->seek(PR_SEEK_END, 0);
char *start, *end;
PRUint32 linebreak_len = 0;
rv = aIStream->Read(mCopyState->m_dataBuffer + mCopyState->m_leftOver,
aLength, &readCount);
aLength, &readCount);
NS_ENSURE_SUCCESS(rv, rv);
mCopyState->m_leftOver += readCount;
mCopyState->m_dataBuffer[mCopyState->m_leftOver] ='\0';
@ -2402,14 +2399,14 @@ NS_IMETHODIMP nsMsgLocalMailFolder::CopyData(nsIInputStream *aIStream, PRInt32 a
end = (char *) memchr(start, '\n', mCopyState->m_leftOver);
else if (*(end+1) == nsCRT::LF && linebreak_len == 0)
linebreak_len = 2;
if (linebreak_len == 0) // not set yet
linebreak_len = 1;
nsCString line;
char tmpChar = 0;
PRInt32 lineLength, bytesWritten;
while (start && end)
{
if (mCopyState->m_fromLineSeen)
@ -2417,7 +2414,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::CopyData(nsIInputStream *aIStream, PRInt32 a
if (strncmp(start, "From ", 5) == 0)
{
line = ">";
tmpChar = *end;
*end = 0;
line += start;
@ -2432,10 +2429,10 @@ NS_IMETHODIMP nsMsgLocalMailFolder::CopyData(nsIInputStream *aIStream, PRInt32 a
mCopyState->m_writeFailed = PR_TRUE;
return NS_MSG_ERROR_WRITING_MAIL_FOLDER;
}
if (mCopyState->m_parseMsgState)
mCopyState->m_parseMsgState->ParseAFolderLine(line.get(),
line.Length());
line.Length());
goto keepGoing;
}
}
@ -2443,7 +2440,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::CopyData(nsIInputStream *aIStream, PRInt32 a
{
mCopyState->m_fromLineSeen = PR_TRUE;
NS_ASSERTION(strncmp(start, "From ", 5) == 0,
"Fatal ... bad message format\n");
"Fatal ... bad message format\n");
}
lineLength = end-start+linebreak_len;
@ -2454,14 +2451,14 @@ NS_IMETHODIMP nsMsgLocalMailFolder::CopyData(nsIInputStream *aIStream, PRInt32 a
mCopyState->m_writeFailed = PR_TRUE;
return NS_MSG_ERROR_WRITING_MAIL_FOLDER;
}
if (mCopyState->m_parseMsgState)
mCopyState->m_parseMsgState->ParseAFolderLine(start,
end-start+linebreak_len);
keepGoing:
start = end+linebreak_len;
end-start+linebreak_len);
keepGoing:
start = end+linebreak_len;
if (start >=
&mCopyState->m_dataBuffer[mCopyState->m_leftOver])
&mCopyState->m_dataBuffer[mCopyState->m_leftOver])
{
mCopyState->m_leftOver = 0;
break;
@ -2487,7 +2484,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::CopyData(nsIInputStream *aIStream, PRInt32 a
{
mCopyState->m_leftOver -= (start - mCopyState->m_dataBuffer);
memcpy (mCopyState->m_dataBuffer, start,
mCopyState->m_leftOver+1);
mCopyState->m_leftOver+1);
}
}
return rv;
@ -3485,10 +3482,12 @@ nsMsgLocalMailFolder::OnMessageClassified(const char *aMsgURI, nsMsgJunkStatus a
NS_ENSURE_SUCCESS(rv,rv);
}
if (--mNumFilterClassifyRequests == 0 && mSpamKeysToMove.GetSize() > 0)
if (--mNumFilterClassifyRequests == 0)
{
if (!mSpamFolderURI.IsEmpty())
if (mSpamKeysToMove.GetSize() > 0)
{
if (!mSpamFolderURI.IsEmpty())
{
nsCOMPtr<nsIMsgFolder> folder;
rv = GetExistingFolder(mSpamFolderURI.get(), getter_AddRefs(folder));
if (NS_SUCCEEDED(rv) && folder) {
@ -3504,16 +3503,24 @@ nsMsgLocalMailFolder::OnMessageClassified(const char *aMsgURI, nsMsgJunkStatus a
messages->AppendElement(iSupports);
}
}
nsCOMPtr<nsIMsgCopyService> copySvc = do_GetService(NS_MSGCOPYSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
rv = copySvc->CopyMessages(this, messages, folder, PR_TRUE,
/*nsIMsgCopyServiceListener* listener*/ nsnull, nsnull, PR_FALSE /*allowUndo*/);
NS_ASSERTION(NS_SUCCEEDED(rv), "CopyMessages failed");
}
}
}
PRInt32 numNewMessages;
GetNumNewMessages(PR_FALSE, &numNewMessages);
SetNumNewMessages(numNewMessages - mSpamKeysToMove.GetSize());
mSpamKeysToMove.RemoveAll();
// check if this is the inbox first...
if (mFlags & MSG_FOLDER_FLAG_INBOX)
PerformBiffNotifications();
}
return NS_OK;

View File

@ -2214,8 +2214,17 @@ nsPop3Protocol::GetMsg()
{
/* Oh, gee, we're all done. */
if(m_pop3ConData->msg_del_started)
{
if (!m_pop3ConData->only_uidl)
{
if (m_pop3ConData->only_check_for_new_mail)
m_nsIPop3Sink->SetBiffStateAndUpdateFE(m_pop3ConData->biffstate, m_pop3ConData->really_new_messages);
/* update old style biff */
else
m_nsIPop3Sink->SetBiffStateAndUpdateFE(nsIMsgFolder::nsMsgBiffState_NewMail, m_pop3ConData->really_new_messages);
}
m_nsIPop3Sink->EndMailDelivery();
}
m_pop3ConData->next_state = POP3_SEND_QUIT;
return 0;
@ -3328,10 +3337,8 @@ nsresult nsPop3Protocol::ProcessProtocolState(nsIURI * url, nsIInputStream * aIn
*/
if (!m_pop3ConData->only_uidl)
{
if (m_pop3ConData->only_check_for_new_mail)
m_nsIPop3Sink->SetBiffStateAndUpdateFE(m_pop3ConData->biffstate, m_pop3ConData->really_new_messages);
/* update old style biff */
else
if (!m_pop3ConData->only_check_for_new_mail)
{
/* We don't want to pop up a warning message any more (see
bug 54116), so instead we put the "no new messages" or
@ -3359,8 +3366,6 @@ nsresult nsPop3Protocol::ProcessProtocolState(nsIURI * url, nsIInputStream * aIn
nsCRT::free(statusTemplate);
}
m_nsIPop3Sink->SetBiffStateAndUpdateFE(nsIMsgFolder::nsMsgBiffState_NewMail, m_pop3ConData->really_new_messages);
}
}
}

View File

@ -60,6 +60,7 @@ nsPop3Sink::nsPop3Sink()
m_authed = PR_FALSE;
m_accountUrl = nsnull;
m_biffState = 0;
m_numNewMessages = 0;
m_senderAuthed = PR_FALSE;
m_outputBuffer = nsnull;
m_outputBufferSize = 0;
@ -248,7 +249,11 @@ nsPop3Sink::EndMailDelivery()
nsresult rv = ReleaseFolderLock();
NS_ASSERTION(NS_SUCCEEDED(rv),"folder lock not released successfully");
m_folder->CallFilterPlugins(nsnull); // ??? do we need msgWindow?
PRBool filtersRun;
m_folder->CallFilterPlugins(nsnull, &filtersRun); // ??? do we need msgWindow?
m_folder->SetNumNewMessages(m_numNewMessages); // we'll adjust this for spam later
if (!filtersRun && m_numNewMessages > 0)
m_folder->SetBiffState(m_biffState);
// note that size on disk has possibly changed.
nsCOMPtr<nsIMsgLocalMailFolder> localFolder = do_QueryInterface(m_folder);
@ -270,12 +275,13 @@ nsPop3Sink::EndMailDelivery()
m_folder->UpdateSummaryTotals(PR_TRUE);
// check if the folder open in this window is not the current folder, and if it has new
// message, in which case we need to try to run the
// filter plugin.
// message, in which case we need to try to run the filter plugin.
if (m_newMailParser)
{
nsCOMPtr <nsIMsgWindow> msgWindow;
m_newMailParser->GetMsgWindow(getter_AddRefs(msgWindow));
// this breaks down if it's biff downloading new mail because
// there's no msgWindow...
if (msgWindow)
{
nsCOMPtr <nsIMsgFolder> openFolder;
@ -290,7 +296,7 @@ nsPop3Sink::EndMailDelivery()
PRBool hasNew;
(void) openFolder->GetHasNewMessages(&hasNew);
if (hasNew)
openFolder->CallFilterPlugins(nsnull);
openFolder->CallFilterPlugins(nsnull, &filtersRun);
}
}
}
@ -576,11 +582,7 @@ nsresult
nsPop3Sink::SetBiffStateAndUpdateFE(PRUint32 aBiffState, PRInt32 numNewMessages)
{
m_biffState = aBiffState;
if(m_folder)
{
m_folder->SetNumNewMessages(numNewMessages);
m_folder->SetBiffState(aBiffState);
}
m_numNewMessages = numNewMessages;
return NS_OK;
}

View File

@ -73,13 +73,14 @@ protected:
PRInt32 m_msgOffset;
char* m_accountUrl;
PRUint32 m_biffState;
PRInt32 m_numNewMessages;
PRBool m_senderAuthed;
char* m_outputBuffer;
PRInt32 m_outputBufferSize;
nsIPop3IncomingServer *m_popServer;
//Currently the folder we want to update about biff info
nsIMsgFolder *m_folder;
nsParseNewMailState *m_newMailParser;
//Currently the folder we want to update about biff info
nsIMsgFolder *m_folder;
nsParseNewMailState *m_newMailParser;
#ifdef DEBUG
PRInt32 m_fileCounter;
#endif