Delete messages not found on server.
Depends on D145825.
Differential Revision: https://phabricator.services.mozilla.com/D145826
--HG--
extra : rebase_source : 26a62fafae96bf70188f1a0c15576b6e80c80eb6
Because a single response can span multiple chunks, and can contain multiple types of data.
Differential Revision: https://phabricator.services.mozilla.com/D145825
--HG--
extra : rebase_source : 9a4b200fdd51c35687e384ac4f1916fa8e04189a
NOOP can return more than flags changes, will handle them in later patches.
Depends on D145412.
Differential Revision: https://phabricator.services.mozilla.com/D145413
--HG--
extra : moz-landing-system : lando
Rename _idleConnections to _freeConnections to avoid confusion with the IDLE command.
This patch only adds code to send IDLE/NOOP, follow-up patches will actually handle IDLE/NOOP responses.
Differential Revision: https://phabricator.services.mozilla.com/D145412
--HG--
extra : moz-landing-system : lando
Load msg in messagepane works as well.
Depends on D144253.
Differential Revision: https://phabricator.services.mozilla.com/D144254
--HG--
extra : amend_source : 4618d96542b6f4ba7e523d3efabe2be76549e2aa
New messages should show up in the threadPane. Select a message to show in messagePane doesn't work yet.
Depends on D143965.
Differential Revision: https://phabricator.services.mozilla.com/D143967
--HG--
extra : amend_source : 74c83c8ce0d39db0223a815159d8a89f7c4cf912
Functions are added in ImapClient to send UID FETCH request, only to test ImapResponse.
Differential Revision: https://phabricator.services.mozilla.com/D143565
--HG--
extra : amend_source : 0c2a0ed588f24f628a8a81c487eb263ed944d5a1
In nsIMsgFolder.compactAll(), the aCompactOfflineAlso param was always true
for IMAP folders, and always false for local folders. The calling code
shouldn't have to deal with that check.
Differential Revision: https://phabricator.services.mozilla.com/D139352
Depends on D139327
As well as splitting up the manifests I've made "run-sequentially" apply to all of the tests, and added tags to each of the manifests so you can choose to run one version of the tests with the --tag argument.
Differential Revision: https://phabricator.services.mozilla.com/D137006
--HG--
extra : moz-landing-system : lando
- Add central definition for max size (kMaxEntries).
- Ensure a free slot before adding new entry (rather than going oversize then trimming back).
- Embed nsTArray<> rather than separate heap alloc.
- Reduce work done during dtor and clear.
- Ditch static Create() function and make ctor public.
- Remove returncodes for fns which don't really need them.
Differential Revision: https://phabricator.services.mozilla.com/D135298
--HG--
extra : moz-landing-system : lando
Additionally, this changes nsImapBodyShell to no longer retain nsImapProtocol
as a member variable. nsImapBodyShells are cached, so it seems irresponsible
for them to hold a raw pointer to the connection. Instead, the connection is
passed in as an extra parameter to nsImapBodyShell::Generate().
There's also a little light tidying and cruft removal.
Differential Revision: https://phabricator.services.mozilla.com/D135191
--HG--
extra : amend_source : 0e95356cc328b2073e3e2a61d7e373084bf6138f
CID 1260186 Unused value
An assigned value that is never used may represent unnecessary computation, an incorrect algorithm, or possibly the need for cleanup or refactoring.
In RecursiveCopy(nsIFile *, nsIFile *): A value assigned to a variable is never used.
Differential Revision: https://phabricator.services.mozilla.com/D133413
--HG--
extra : rebase_source : 7cb148e645af9a85b37a75f12eeb6d24d1e12224
CID 1260155 Unused value
An assigned value that is never used may represent unnecessary computation, an incorrect algorithm, or possibly the need for cleanup or refactoring.
In nsImapMailFolder::SyncFlags(nsIImapFlagAndUidState *): A value assigned to a variable is never used
Differential Revision: https://phabricator.services.mozilla.com/D133412
--HG--
extra : rebase_source : 40cc185a522eed25273e87a9390adffa5b954bb3
extra : amend_source : 7ba386d21e31290a989360c601b88ef51f5921a9
`nsImapProtocol::Run` has a race condition between main thread and IMAP thread.
IMAP thread is running `Runnable` by nsImapProtocol. But it is possible to run
`releaseOnMain` for `nsIImapProtocol` before decrementing reference count of
`Runnable` by `nsImapProtocol` on IMAP thread. So then, the destructor of
`nsImapProtocol` may run on IMAP thread that is shutting down.
In other words, this sequence is the following.
1. `nsImapProtocol::Run()` calls `NS_ReleaseOnMainThread` to dereference
`nsImapProtocol` on Imap thread.
2. `nsImapProtocol` is released in main thread since we used
`NS_ReleaseOnMainThread`.
3. `nsThread::ProcessNextEvent` releases `nsImapProtocol` on Imap thread since
`nsIRunnble` is done and `nsImapProtocol` inherits `nsIRunnable`.
4. `nsImapProtocol`'s reference is nothing, then it is deleted on Imap thread.
So `nsImapProtocol` shouldn't inherit `nsIRunnable`.
Differential Revision: https://phabricator.services.mozilla.com/D132920
--HG--
extra : moz-landing-system : lando
- in ~nsMsgCompose, remove tmp attachments only if mMsgSend is not inited
- remove tmp attachments after mMsgSend->CreateAndSendMessage returns
- add tests for forwarding messages in filters
Differential Revision: https://phabricator.services.mozilla.com/D132668
I modified the nsIDBChangeListener interface to pass the name of the changed property when a property changes. This wasn't strictly necessary but it is a useful optimisation.
Change listeners aren't even notified if a change happens to a nsMsgHdr object directly (it writes straight to the database and doesn't tell anybody) but that doesn't seem to be a major problem as the changes I'm interested in go through nsMsgDatabase.
Differential Revision: https://phabricator.services.mozilla.com/D131319
--HG--
extra : rebase_source : dfbf9a5a89582782fdacb92558c209233ef2ce43
extra : histedit_source : 4b58f65c41cc8d770661f3c767b38935f78a13f4
CID 137604 Uninitialized pointer field
The pointer field will point to an arbitrary memory location, any attempt to write may cause corruption.
In nsImapMailboxSpec::nsImapMailboxSpec(): A pointer field is not initialized in the constructor
Differential Revision: https://phabricator.services.mozilla.com/D130032
--HG--
extra : rebase_source : 6b45a707e4cf15976a0e4537ac4960f107e0ab4c
CID 1137611 Uninitialized scalar field
The field will contain an arbitrary value left over from earlier computations.
In nsImapProtocol::nsImapProtocol(): A scalar field is not initialized by the constructor
Differential Revision: https://phabricator.services.mozilla.com/D130031
--HG--
extra : rebase_source : b0399ef34290aacf4cdbcaa89f053f09d6d058fa
CID 1137379 Logically dead code
notnull: At condition currentPath, the value of currentPath cannot be nullptr.
Differential Revision: https://phabricator.services.mozilla.com/D128573
--HG--
extra : rebase_source : b0e27f072d019c50f3cf3c263c35c41293721d8c
extra : amend_source : 2eef04ba1c6d88d6ec06da21f7cd67fe0cfbbae0
This is an intermediate step. We want to get all the message-reading code
working with streams that contain just a single message, rather than with an
unwieldly mbox stream + offset/size combo.
Then we'll remove getOfflineFileStream() entirely and rename
getSlicedOfflineFileStream() to replace it.
Differential Revision: https://phabricator.services.mozilla.com/D127372
Breaks up OnItemAdded() and OnItemRemoved() into folder and message-specific
versions. Also tidies up naming of the callback functions in the .idl while
we're here e.g. OnItemEvent() becomes onFolderEvent().
Differential Revision: https://phabricator.services.mozilla.com/D126593
--HG--
extra : rebase_source : 09c95d139bc512626e7974b95b94fa91cead0ef6
Breaks up OnItemAdded() and OnItemRemoved() into folder and message-specific
versions. Also tidies up naming of the callback functions in the .idl while
we're here e.g. OnItemEvent() becomes onFolderEvent().
Differential Revision: https://phabricator.services.mozilla.com/D126593
--HG--
extra : amend_source : 7e86abd0191c081cbce48965b6d064f146fc7f88
Removes .NotifyItemAdded() and .NotifyItemRemoved() which both used nsISupports
and replaces them with specific folder and nsIMsgDBHdr versions.
Still calls the nsISupports-based nsIFolderListener OnItemAdded/OnItemRemoved()
callbacks but lays the groundwork for doing the same thing there.
Differential Revision: https://phabricator.services.mozilla.com/D126579
--HG--
extra : amend_source : f390dc67387ec358cf77b9b0825f42a706610f7f
Also:
- Moves the two Allocate*() member fns from public to private.
- Removes the unused GetFolderNameWithoutNamespace().
- Converts GenerateFullFolderNameWithDefaultNamespace() to return nsCString rather than char*, to fix a memory leak in nsImapService.
CID 1473469 Overlapping buffer in memory copy
Results in an undefined behavior
In nsImapNamespaceList::AllocateCanonicalFolderName(char const *, char): Buffers may be overlapping in a string copy function
Differential Revision: https://phabricator.services.mozilla.com/D125908
--HG--
extra : amend_source : 0e02849e42154d8d3e3ac9bcc61a902d2c6b8d81
Also removes getOfflineMsgFolder() from nsIMsgFolder as the only
implementation is internal to nsImapMailFolder.
Differential Revision: https://phabricator.services.mozilla.com/D124286
--HG--
extra : amend_source : 2568f722bbb0164c12aa45e06a79d3c9e8d896d0
This patch just remove the offending line. It turns out the onlineName is
already set correctly by this time in AddSubfolder(). So it was redundant, as
well as wrong.
It appears the onlineName calculation is performed on-demand, in
GetDBFolderInfoAndDB().
Differential Revision: https://phabricator.services.mozilla.com/D123845
--HG--
extra : histedit_source : 032f6a77bcbae76fdbb20cc85e906a02ef8e5b49
CID 1473470 Uninitialized pointer field
The pointer field will point to an arbitrary memory location, any attempt to write may cause corruption.
In nsImapBodyShell::nsImapBodyShell(nsImapProtocol *, nsIMAPBodypartMessage *, unsigned int, unsigned int, char const *): A pointer field is not initialized in the constructor
Differential Revision: https://phabricator.services.mozilla.com/D123580
CID 450527 Resource leak
The system resource will not be reclaimed and reused, reducing the future availability of the resource.
In nsImapServerResponseParser::namespace_data(): Leak of memory or pointers to system resources
Differential Revision: https://phabricator.services.mozilla.com/D123574
CID 1478010 Dereference after null check
Either the check against null is unnecessary, or there may be a null pointer dereference.
In nsImapMockChannel::OnCacheEntryAvailable(nsICacheEntry *, bool, nsresult): Pointer is checked against null but then dereferenced anyway
Differential Revision: https://phabricator.services.mozilla.com/D123566
At least
comm/mail/components/extensions/test/xpcshell/test_ext_accounts.js
comm/mail/components/extensions/test/xpcshell/test_ext_folders.js
comm/mailnews/imap/test/unit/test_imapHighWater.js
Coverify: CID 1468064 (#2 of 2): Unused value (UNUSED_VALUE)returned_value: Assigning value from this->SendData(")\r\n", false) to rv here, but that stored value is overwritten before it can be used
Differential Revision: https://phabricator.services.mozilla.com/D122699
--HG--
extra : rebase_source : dfa114bf776defd07d7ba7945d3e526ecdfe0c91
CID 1473461 (#1 of 1): Unused value (UNUSED_VALUE)returned_value: Assigning value from this->GetClearedOriginalOp(sourceOp.operator nsIMsgOfflineImapOperation *(), nsGetterAddRefs<nsIMsgOfflineImapOperation>(getter_AddRefs(originalOp)).operator nsIMsgOfflineImapOperation **(), nsGetterAddRefs<nsIMsgDatabase>(getter_AddRefs(originalDB)).operator nsIMsgDatabase **()) to rv here, but that stored value is overwritten before it can be used.
Differential Revision: https://phabricator.services.mozilla.com/D122700
--HG--
extra : rebase_source : f30f245755ee29e2403d83a8b7cd35ae630b6edb
CID 1417617 (#1 of 1): Unused value (UNUSED_VALUE)returned_value: Assigning value from this->CreateDirectoryForFolder(nsGetterAddRefs<nsIFile>(getter_AddRefs(dirFile)).operator nsIFile **()) to rv here, but that stored value is overwritten before it can be used.
In nsImapMailFolder::RenameLocal(nsTSubstring<char> const &, nsIMsgFolder *): A value assigned to a variable is never used.
Differential Revision: https://phabricator.services.mozilla.com/D122706
--HG--
extra : rebase_source : 38ceb5643bbf410f0c41cf272c6373daec820870
CID 1364639 (#1 of 1): Unused value (UNUSED_VALUE)returned_value: Assigning value from bundle->FormatStringFromName("imapOtherUsersFolderTypeDescription", params, folderTypeDesc) to rv here, but that stored value is overwritten before it can be used.
Differential Revision: https://phabricator.services.mozilla.com/D122707
--HG--
extra : rebase_source : 719cc8af472f1ecadc6a83a4ae75c53b96a9a8fe
This removes an nsIMsgHdr.setMessageOffset() call. That call was redundant - it's handled
already inside the mbox mailstore.
Differential Revision: https://phabricator.services.mozilla.com/D119940
--HG--
extra : histedit_source : 8d917c9bd73f2d26e1dc90d6d2cc14e098204e3a
CID 1473460 (#1 of 1): Dereference before null check (REVERSE_INULL)check_after_deref: Null-checking this->m_parentPart suggests that it may be null, but it has already been dereferenced on all paths leading to the check
Differential Revision: https://phabricator.services.mozilla.com/D111618
--HG--
extra : rebase_source : 07c9056f9ce8c08784e0596d5b912a824583fa9f
uninit_member: Non-static class member m_folderName is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member m_showAttachmentsInline is not initialized in this constructor nor in any functions that it calls.
CID 1473470 (#3 of 3): Uninitialized scalar field (UNINIT_CTOR)9. uninit_member: Non-static class member m_contentModified is not initialized in this constructor nor in any functions that it calls.
Differential Revision: https://phabricator.services.mozilla.com/D111614
--HG--
extra : rebase_source : d4dab1f651879fb486573ee5b1348b82c884702c
Except for chat's logger.jsm (and test), ext-compose.js (no IOUtils in extension API implementations)
and converterWorker (uses OS.File.open to read and write big files).
Differential Revision: https://phabricator.services.mozilla.com/D111298
--HG--
extra : moz-landing-system : lando
Biggest churn is in nsImapMockChannel::ReadFromLocalCache() - this patch
switches it to use NS_ENSURE_SUCCESS() early-outs rather than big nested
if (NS_SUCCEEDED(rv))... clauses.
Added an equivalent class - nsIMsgEnumerator - which still has the same
getNext()/hasMoreElements() methods as nsISimpleEnumerator. However, this new
getNext() returns nsIMsgHdr objects directly, rather than nsISupports, so
callers don't have to jump through extra QI hoops.
A return value is more convenient for calling in javascript.
Also renamed interface definition from GetUrlForUri to getUrlForUri to conform to javascript naming conventions.
Differential Revision: https://phabricator.services.mozilla.com/D106271
--HG--
extra : amend_source : 7ff0c6889942d16dff1e87c25c1d04b195373f64
Fix code issues from bug 1571672 (rev. 0054ea73e658).
Fixed trash folder selection of folder with non-ASCII name on server without UTF8=ACCEPT capability.
Introduce nsIMsgImapMailFolder.shouldUseUtf8FolderName and use where needed.
Replace heuristic in am-server.js.
Remove or correct comments related to MUTF-7/UTF-8.
The presence of this flag forces a docShell to pass loading onto the external helper app service. In some special cases we don't want this, so I've white-listed certain content types.
Differential Revision: https://phabricator.services.mozilla.com/D102892
--HG--
extra : moz-landing-system : lando