Note that there are some explanatory texts on larger screens.

plurals
  1. POThunderbird Addon - Filter by Sender
    primarykey
    data
    text
    <p>I have a list of email ids.i want to filter inbox messages and display only emails from those users in thunderbird. Please help me doing this.</p> <p>This is what i tried so far and it's not working.But im getting completely irrelevant error message "We are unable to print or preview this page".</p> <pre><code>var gLocalIncomingServer = MailServices.accounts.localFoldersServer; var gLocalMsgAccount = MailServices.accounts.FindAccountForServer( gLocalIncomingServer); var gLocalRootFolder = gLocalIncomingServer.rootMsgFolder .QueryInterface(Ci.nsIMsgLocalMailFolder); const kInboxFlag = Components.interfaces.nsMsgFolderFlags.Inbox; var gLocalInboxFolder = gLocalRootFolder.getFolderWithFlags(kInboxFlag); gLocalRootFolder.findSubFolder(gLocalInboxFolder.URI); gLocalInboxFolder.setFlag(Ci.nsMsgFolderFlags.Mail); // Force an initialization of the Inbox folder database. var folderName = gLocalInboxFolder.prettiestName; var aValue = "example@domain.com"; var aAttrib = Ci.nsMsgSearchAttrib.Sender; var aop = nsMsgSearchOp.Contains;; var hitCount = 1; var searchListener = { onSearchHit: function(dbHdr, folder) { hitCount++; }, onSearchDone: function(status) { print("Finished search does " + aHitCount + " equal " + hitCount + "?"); searchSession = null; do_check_eq(aHitCount, hitCount); if (onDone) onDone(); }, onNewSearch: function() {hitCount = 0;} }; // define and initiate the search session var hitCount; var searchSession = Cc["@mozilla.org/messenger/searchSession;1"] .createInstance(Ci.nsIMsgSearchSession); searchSession.addScopeTerm(Ci.nsMsgSearchScope.offlineMail, gLocalInboxFolder); var searchTerm = searchSession.createTerm(); searchTerm.attrib = aAttrib; var value = searchTerm.value; // This is tricky - value.attrib must be set before actual values value.attrib = aAttrib; value.str = aValue; searchTerm.value = value; if (aAttrib &gt; nsMsgSearchAttrib.OtherHeader) searchTerm.arbitraryHeader = gArrayHdrs[aAttrib - 1 - nsMsgSearchAttrib.OtherHeader]; searchTerm.op = aOp; searchTerm.booleanAnd = false; searchSession.appendTerm(searchTerm); searchSession.registerListener(searchListener); searchSession.search(null); alert("search is done:"); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload