messenger.messages.onNewMailReceived event doesn't return messages from folders other than Inbox
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(thunderbird_esr115 wontfix)
| Tracking | Status | |
|---|---|---|
| thunderbird_esr115 | --- | wontfix |
People
(Reporter: 52qtuqm9, Assigned: john)
References
Details
Attachments
(1 file)
I have something running on the mail server that deposits messages into my Sent folder (I don't have Thunderbird doing it). I have Thunderbird configured to check my Sent folder for new messages whenever getting new messages. I have an add-on (Remote Content By Folder) which installs a messenger.messages.onNewMailReceived listener. Thunderbird is indeed noticing when new messages are added to my Sent folder, and they show up in the UI, but the add-on is not receiving events about them.
| Reporter | ||
Comment 1•2 years ago
|
||
Update: I think this issue doesn't affect all folders. I have another folder that is getting messages put into it outside of Thunderbird whose messages are generating onNewMailReceived events. Is it possible that the folder configured as the user's sent items folder is specifically excluded from onNewMailReceived events? If so, that's a problem.
Comment 2•2 years ago
|
||
This seems to be by design, see https://searchfox.org/comm-central/source/mail/components/extensions/parent/ext-mail.js#2550-2556. To mitigate you could try to set the Ci.nsMsgFolderFlags.Inbox flag for these folders.
| Reporter | ||
Comment 3•2 years ago
|
||
This seems to be by design
:shrug: All I can tell you is that before I changed Remote Content By Folder to use the MailExtension APIs, it received notifications for messages in all folders, and now using the API it's not, and that's a regression as far as I'm concerned. "Tell me about new messages in all folders," is a reasonable request for add-ons to expect to be able to make.
If you want to add an option to allow the caller to decline to receive notifications in some folders, that would be fine, but it should be an option, not the only available mode.
| Assignee | ||
Comment 4•2 years ago
|
||
With the proposed patch, a sensitivity can be specified when registering the event:
browser.messages.onNewMailReceived.addListener(listener, ["inbox", "drafts"])
The default sensitivity is "inbox".
| Assignee | ||
Comment 5•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/d9d52f582bf5
Allow to specify a sensitivity of the messages.onNewMailReceived event. r=mkmelin
Comment 7•2 years ago
|
||
search bugmail for "addons1234" to delete these messages
Description
•