<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MesQuilla &#187; Planet Mozilla</title>
	<atom:link href="http://mesquilla.com/category/mozilla/feed/" rel="self" type="application/rss+xml" />
	<link>http://mesquilla.com</link>
	<description>Messaging with Mozilla by rkent</description>
	<lastBuildDate>Wed, 21 Jul 2010 16:14:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Thunderbird&#8217;s Strategic Dilemma</title>
		<link>http://mesquilla.com/2010/07/15/thunderbirds-strategic-dilemma/</link>
		<comments>http://mesquilla.com/2010/07/15/thunderbirds-strategic-dilemma/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 00:58:07 +0000</pubDate>
		<dc:creator>rkent</dc:creator>
				<category><![CDATA[Planet Mozilla]]></category>
		<category><![CDATA[Planet MozillaMessaging]]></category>
		<category><![CDATA[Thunderbird's future]]></category>

		<guid isPermaLink="false">http://mesquilla.com/?p=920</guid>
		<description><![CDATA[In a recent tb-planning post, neandr wrote: With all respect for the people working at Mozilla/Thunderbird and fully understand the limitation they are faced with, I would like to see a more detailed mission statement for the products (TB/LG) and the future of it. Only expressing TB is for individual users, SOHO and not for [...]]]></description>
			<content:encoded><![CDATA[<p>In a recent <a href="http://groups.google.com/group/tb-planning/msg/0c1b9ba8567fab88">tb-planning post</a>, neandr wrote:</p>
<blockquote cite="mid:4C3F520E.7080704@gmx.de"><p>With all  respect for the people working at Mozilla/Thunderbird and     fully understand the limitation they are faced with, I would like to     see a more detailed mission statement for the products (TB/LG) and     the future of it. Only expressing TB is for individual users, SOHO     and not for the Enterprise is a very vague  statement</p></blockquote>
<p>I was going to respond to that in the thread, but I got wordy so I posted this blog entry instead.</p>
<p>At the recently completed <a href="http://www.google.com/url?sa=t&amp;source=web&amp;cd=1&amp;ved=0CBUQFjAA&amp;url=https%3A%2F%2Fwiki.mozilla.org%2FSummit2010&amp;ei=xJ0_TIzWIIHUtQONs6D0Bg&amp;usg=AFQjCNH_U_QseT5RdA2A5Ycy8dzG_kSCWg&amp;sig2=QMjtzdsYwpXCbN6YitCRLw">Mozilla Summit</a>, variations of this request  were made by many people that are close to the Thunderbird project  (including myself). But after listening to several days of Firefox  people extolling the virtues of moving everything to the browser, and  being &#8220;more like the web&#8221;, I have a new appreciation of how difficult  the development of a vision statement is for the Thunderbird team.</p>
<p>The standard game plan that Mozilla projects are expected to follow is  to develop an application with a significantly high market share so that  they can use their market influence to fight for the rights of  individual users. Mozilla is a fascinating organization as a hybrid  commercial/public interest organization, and they take their values  quite seriously.</p>
<p>Unfortunately Thunderbird, which is the only real product that <a href="http://www.mozillamessaging.com/">MoMo</a> currently has, hovers around 6 million users, which is much lower than  the number they believe are necessary to have the influence they would  like (I have heard 100 million users as a goal). Nobody currently has a  concrete plan to develop a product with 100 million users. So the  current strategy (as I see it) is to try a series of experiments to try  to develop some concepts that might be used to specify the 100 million  user product. I can&#8217;t resist naming things (<a href="http://speechtree.com/">my wife</a> calls me &#8220;an Adam&#8221;),  so let&#8217;s call this future product by the code name &#8220;Gigabird&#8221;.</p>
<p>One such experiment is <a href="https://mozillalabs.com/raindrop">Raindrop</a>. Other experiments are <a href="https://mozillalabs.com/messaging/mailing-list-manager/">going on in  extensions</a> to Thunderbird, which seem to be focusing on changes to the  user interface. Right now, that is where the vast majority of the  developer resources are focused at MoMo.</p>
<p>So if your real strategic mission is to develop Gigabird, what do you do  with your legacy product Thunderbird? The big problem is that the  &#8220;ordinary users&#8221; that are the primary focus of Firefox (and by  implication also MoMo) are migrating away from email for many forms of  messaging to other media &#8211; Twitter, Facebook, text messages, web forums,  blog comments, etc. The hardcore users of email (who are likely to  continue to use a desktop client) are sitting in office cubicles, yet  going after these &#8220;enterprise&#8221; users is counter-cultural for Mozilla.</p>
<p>So what are the strategic choices available to MoMo?</p>
<h3>the HailMary</h3>
<p>The goal here is to try to come up with one or more really clever  innovations that will form the basis of Gigabird. This is, after all,  the way that some of the new messaging formats have occurred, with  Twitter as the poster child. Using these innovations as a base, the  basic plan for Gigabird will be formulated at some point in the future.  This is the current MoMo strategy, at least as I see it. Given the  existing Mozilla culture, I would probably do this as well. (Warning:  should this strategy every become publicly revealed, <a href="http://ascher.ca/blog/">the director</a> will <a href="http://en.wikipedia.org/wiki/Mission_Impossible"> disavow any knowledge</a> of these actions.)</p>
<h3>the AboutFace</h3>
<p>Here you notice that the values-driven direction that you felt so  passionate about is actually not going to get you anywhere, so you make a  major readjustment in values to allow you to pragmatically accept a new  direction. Such moves have been done by Mozilla in the past, and are  part of the standard <a href="http://www.imakenews.com/worldwit/e_article000392891.cfm?x=b11,0,w">corporate Myth</a> propagated by Mitchell Baker (the  story about how in the early days they were adamant about never shipping  a binary). The application to MoMo could be to accept that what they  have is an email product, and their future users are going to be sitting  in cubicles. Users in cubicles should have rights too, so there could  be a valid Mozilla Foundation purpose in fighting for the rights of  these &#8220;enterprise users&#8221; and let Thunderbird develop into an enterprise  product.</p>
<h3>the SlowPlod</h3>
<p>This is the direction that existing Thunderbird users are hoping for.  The ultimate goal is to slowly improve Thunderbird until it is  undeniably the best email client around. You fix any important bugs.  You  support all of the hot new messaging concepts. You spiff up the user  interface, incrementally adding new features that provide small  improvements to usability. You keep your power uses happy with lots of  extensions for specialized purposes. It&#8217;s pretty clear that <a href="http://groups.google.com/group/tb-planning/msg/fb959ff59bde6207">dmose does  not believe</a> that he has sufficient resources to pursue this strategy,  nor is he likely to have them in the foreseeable future. The Thunderbird  code base is also really hard to adapt to these  new media (witness the struggles that <a href="http://mesquilla.com/category/exchange-web-services-ews/">I have had</a> or <a href="http://quetzalcoatal.blogspot.com">jcranmer&#8217;s blog</a> ). I think that the MoMo team wishes  us well, but believes that the future lies elsewhere.</p>
<h3>the VacuumTube</h3>
<p>Just because you can&#8217;t change the direction of humanity does not mean  that you have nothing. Vacuum tubes are long gone &#8211; yet the guitar  player at <a href="http://www.ecreekside.com/">my church</a> proudly uses his fancy amp with glowing tubes  showing through plexiglass.<a href="http://www.istimaging.com/"> The company</a> that bought one of <a href="http://www.quadtek.com/">my previous  businesses</a> had also previously purchased a manufacturer of vacuum tubes,  which had morphed into specialized purposes like lamps for  spectroscopy, and nuclear-warfare-resistant cathode ray tubes. Email  clients will be with us forever, and in the hands of people who love  them could have a useful future in various niches.</p>
<h2>My Prediction</h2>
<p>MoMo will pursue the HailMary until they have enough ideas to formulate a  real plan. At that point, they will want to devote all of their  resources to Gigabird, and be looking for an honorable way to retreat  from Thunderbird &#8211; which will be a variation of the VacuumTube. The likely retreat will probably be some sort of  future custodianship by a conglomeration of companies that provide a  freemium strategy. So if there was a basic, free Thunderbird product  that could be enhanced with addons with commercial value (like my  <a href="http://mesquilla.com/category/exchange-web-services-ews/">Exchange Web Services</a> product, or<a href="http://www.postbox-inc.com/"> Postbox</a> as a Thunderbird addon), then  MoMo could pursue their vision without abandoning their Thunderbird  users, and let companies like <a href="http://mesquilla.com">MesQuilla </a>and <a href="http://www.postbox-inc.com/">Postbox</a> support Thunderbird.</p>
]]></content:encoded>
			<wfw:commentRss>http://mesquilla.com/2010/07/15/thunderbirds-strategic-dilemma/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Data Persistence (Mailnews Exchange Support)</title>
		<link>http://mesquilla.com/2010/06/25/data-persistence-mailnews-exchange-support/</link>
		<comments>http://mesquilla.com/2010/06/25/data-persistence-mailnews-exchange-support/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 22:55:33 +0000</pubDate>
		<dc:creator>rkent</dc:creator>
				<category><![CDATA[Exchange Web Services (EWS)]]></category>
		<category><![CDATA[Mailnews development]]></category>
		<category><![CDATA[Planet Mozilla]]></category>
		<category><![CDATA[Planet MozillaMessaging]]></category>

		<guid isPermaLink="false">http://mesquilla.com/?p=884</guid>
		<description><![CDATA[My project to provide Exchange Web Services (EWS) support to applications based on the Mozilla mailnews codebase entered a new phase this week, where I am starting to consider the issue of local persistence of data downloaded from the server. (In the previous week, I got two other things working: display of HTML emails, and [...]]]></description>
			<content:encoded><![CDATA[<p>My project to provide Exchange Web Services (EWS) support to applications based on the Mozilla mailnews codebase entered a new phase this week, where I am starting to consider the issue of local persistence of data downloaded from the server. (In the previous week, I got two other things working: display of HTML emails, and updating of UNREAD status from the local app to the server).</p>
<p>EWS messages do not come from the server in RFC-822 format, so it seems like a pity to store them that way, though that is the common method used in the rest of the mailnews codebase. Instead, I decided to implement a local storage scheme based on <a href="http://www.sqlite.org/">SQLite</a> and <a href="https://developer.mozilla.org/en/Storage">Mozilla&#8217;s Storage interface.</a> <a href="http://www.visophyte.org/blog/">Andrew Sutherland</a> has done a lot of great work setting up an environment similar to this for the gloda database, so there are lots of good examples to pull from. Also, because the datamodel for EWS includes not only messages but also Calendar and Contact items, I can have a common database infrastucture that I can leverage over those other pieces once I get it working for the messaging part.</p>
<p>I&#8217;ve now replaced my previous in-memory datastore for message metadata with an SQLite version. This is equivalent to the <a href="http://mxr.mozilla.org/comm-central/source/mailnews/db/gloda/modules/datastore.js">datastore module in gloda</a>, and the data it is storing is like the RFC-822 headers. I still have to do the storage for the body, and also hook this up with folder change state so that the code knows that it has data it can trust.</p>
<p>As I have done this, I&#8217;ve had a new set of insights into the relationship of the various objects in the Mozilla mailnews world (which I sometimes call Skink). Previously, I had sort of expected that the natural progression of gloda would be to slowly displace the role of the message summary database, <a href="http://mxr.mozilla.org/comm-central/source/mailnews/base/public/nsIMsgHdr.idl">nsIMsgDBHdr</a>.  But now I see that a more natural progression would be for SQLite to be used as a replacement for the local mailstore (currently mbox, with maildir support <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=402392">moving forward</a> as well.) Really the main issue is the async nature of the SQLite calls, which sort of precludes its easy use as a replacement for nsIMsgDBHdr. But the datastores are typically accessed async anyway. If the message metadata in the message stores was stored primarily in SQLite format, as I will be doing, then it would be much easier to hookup an SQLite-based global search facility to all of these databases. Yes that is what gloda does now, but it has to go through all of the work to maintain a separate version of everything. Why have three copies of everything (Mork, MBox, and Gloda) when you could only have two (Mork and Gloda)?</p>
<p>As another insight, while looking through the gloda code I noticed that a JSON object was being saved to store some of the items. I though that was a good idea at first &#8211; but then I tried to write a simple serializer to convert from my internal native format to JSON objects, and saw that it was not going to be an easy project. But then I remembered that SOAP is really just a mechanism to serialize typed objects, and I already have a SOAP encoder and decoder! So instead of using JSON, I use objects serialized with my SOAP XML encoder to store unindexed items in my SQLite store. So a message (sans body) ends up looking like this as a TEXT item in SQLite:</p>
<pre>&lt;Message xmlns="http://schemas.microsoft.com/exchange/services/2006/types"&gt;
 &lt;Subject&gt;Postini First Junk Email Safely Quarantined&lt;/Subject&gt;
 &lt;DateTimeReceived&gt;2010-06-04T22:19:30Z&lt;/DateTimeReceived&gt;
 &lt;Size&gt;2612&lt;/Size&gt;
 &lt;Importance&gt;Normal&lt;/Importance&gt;
 &lt;DisplayTo&gt;Kent James&lt;/DisplayTo&gt;
 &lt;Culture&gt;en-US&lt;/Culture&gt;
 &lt;Sender&gt;
  &lt;Mailbox&gt;
   &lt;Name&gt;Postini Support&lt;/Name&gt;
   &lt;EmailAddress&gt;noreply@hostedmsexchange.com&lt;/EmailAddress&gt;
   &lt;RoutingType&gt;SMTP&lt;/RoutingType&gt;
  &lt;/Mailbox&gt;
 &lt;/Sender&gt;
 &lt;ToRecipients&gt;
  &lt;Mailbox&gt;
   &lt;Name&gt;Kent James&lt;/Name&gt;
   &lt;EmailAddress&gt;rkentjames@caspia.org&lt;/EmailAddress&gt;
   &lt;RoutingType&gt;SMTP&lt;/RoutingType&gt;
  &lt;/Mailbox&gt;
 &lt;/ToRecipients&gt;
 &lt;From&gt;
  &lt;Mailbox&gt;
   &lt;Name&gt;Postini Support&lt;/Name&gt;
   &lt;EmailAddress&gt;noreply@hostedmsexchange.com&lt;/EmailAddress&gt;
   &lt;RoutingType&gt;SMTP&lt;/RoutingType&gt;
  &lt;/Mailbox&gt;
 &lt;/From&gt;
 &lt;InternetMessageId&gt;&amp;lt;0c34b5a4-5f3c-4654-bf9d-99c9a8cb439b@HUB02.4emm.local&amp;gt;
 &lt;/InternetMessageId&gt;
 &lt;IsRead&gt;1&lt;/IsRead&gt;
&lt;/Message&gt;
</pre>
<p>At first it bothered me to save what is essentially a duplicate of what is coming over the wire, but why not? It&#8217;s not conceptually any different than RFC-822, or JSON, in function.</p>
]]></content:encoded>
			<wfw:commentRss>http://mesquilla.com/2010/06/25/data-persistence-mailnews-exchange-support/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Javascript filter action in Thunderbird with FiltaQuilla</title>
		<link>http://mesquilla.com/2010/06/16/javascript-filter-action-in-thunderbird-with-filtaquilla/</link>
		<comments>http://mesquilla.com/2010/06/16/javascript-filter-action-in-thunderbird-with-filtaquilla/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 23:54:04 +0000</pubDate>
		<dc:creator>rkent</dc:creator>
				<category><![CDATA[FiltaQuilla]]></category>
		<category><![CDATA[Planet Mozilla]]></category>
		<category><![CDATA[Planet MozillaMessaging]]></category>

		<guid isPermaLink="false">http://mesquilla.com/?p=875</guid>
		<description><![CDATA[I received an email today asking that I add a feature to FiltaQuilla. Slightly edited, the author said: Something I&#8217;ve found myself doing at work is creating a new filter for every folder I create. I work on technical cases and for each new case number I create a new folder and have all emails [...]]]></description>
			<content:encoded><![CDATA[<p>I received an email today asking that I add a feature to FiltaQuilla. Slightly edited, the author said:</p>
<p style="padding-left: 30px;"><em>Something I&#8217;ve found myself doing at work is creating a new filter for  every folder I create. I work on technical cases and for each new case  number I create a new folder and have all emails with that case number  go into that folder.  The crappy part about it is that I literally have  hundreds of cases I deal with, and hence hundreds of filters.  You&#8217;ve  already got the regex match criteria in filtaqulla, I&#8217;d love to be able  to take that match criteria and use whatever string it matches as the  destination folder action criteria. Sample subject line contains the following: 2010-0609-518<br />
</em></p>
<p>One of the features added to my extension FiltaQuilla recently is the ability to add custom javascript actions. I thought that I would give a shot at doing this request as a custom javascript action. The author of the email was expecting this to get linked to the regex search term, but that is not the easiest way to do it. It is easier to just let the filter action also do the regex search.</p>
<p>After installing FiltaQuilla, you need to enable the custom javascript action, which is done on the Addon options page. After that, you can add a javascript custom action in the filter editor.</p>
<p>Then you need to write the javascript code for the action. I&#8217;ve done similar work in the past, so that took me about an hour to get correct. Then insert the code into the action field for the javascript action, and it&#8217;s ready to go! You have to have some sort of search in the filter as well. You could just search for everything if you wanted, or you could add a regex search for the precise term if you want. It doesn&#8217;t matter much, as all of the work is really being done in the action. You just need to make sure that the action gets called for each message that might need to be moved. There&#8217;s more documentation of this feature available at the <a href="http://mesquilla.com/extensions/filtaquilla/">FiltaQuilla page</a> on this site.</p>
<p>The code I came up with is:</p>
<pre>let digitsRegex = /20\d\d\-[0-1]\d[0-3]\d\-\d\d\d/;
let acctmgr = Cc["@mozilla.org/messenger/account-manager;1"]
                .getService(Ci.nsIMsgAccountManager);
let copyService = Cc["@mozilla.org/messenger/messagecopyservice;1"]
                    .getService(Ci.nsIMsgCopyService);
for (let index = 0; index &lt; msgHdrs.length; index++)
{
  let hdr = msgHdrs.queryElementAt(index, Ci.nsIMsgDBHdr);
  let theDigits = digitsRegex.exec(hdr.subject);
  let folders = acctmgr.allFolders;
  let length = folders.length;
  for (let i = 0; i &lt; length; i++) {
    let folder = folders.queryElementAt(i, Ci.nsIMsgFolder);
    if (folder.name == theDigits) {
      let messages = Cc["@mozilla.org/array;1"]
                       .createInstance(Ci.nsIMutableArray);
      messages.appendElement(hdr, false);
      copyService.CopyMessages(hdr.folder, messages, folder, true,
                               null, msgWindow, false);
    }
  }
}
</pre>
<p>With this filter, if you create a folder with a name like &#8220;2010-0616-001&#8243;, and your message has that in the subject, the message will get moved to that folder.</p>
<p>If you are having trouble getting it to work, an easy way to debug is just to insert statements like this into the javascript:</p>
<pre>Cu.reportError("I am here");
</pre>
<p>Those printouts will show up on the error console, so you should be able to see if your filter action code is working or not.</p>
]]></content:encoded>
			<wfw:commentRss>http://mesquilla.com/2010/06/16/javascript-filter-action-in-thunderbird-with-filtaquilla/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reading the Body (Mailnews Exchange Support)</title>
		<link>http://mesquilla.com/2010/06/04/reading-the-body-mailnews-exchange-support/</link>
		<comments>http://mesquilla.com/2010/06/04/reading-the-body-mailnews-exchange-support/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 22:58:26 +0000</pubDate>
		<dc:creator>rkent</dc:creator>
				<category><![CDATA[Exchange Web Services (EWS)]]></category>
		<category><![CDATA[Mailnews development]]></category>
		<category><![CDATA[Planet Mozilla]]></category>
		<category><![CDATA[Planet MozillaMessaging]]></category>

		<guid isPermaLink="false">http://mesquilla.com/?p=850</guid>
		<description><![CDATA[Just as a status update, my Exchange Server extension can now read message bodies. But note that there is no header information displayed with the message: Why no header information? Because the header summary, for reasons that I cannot explain, reads the message file directly &#8211; and assumes that the message is in RFC 2822 [...]]]></description>
			<content:encoded><![CDATA[<p>Just as a status update, my Exchange Server extension can now read message bodies. But note that there is no header information displayed with the message:</p>
<p style="text-align: center;"><a href="http://mesquilla.com/wp-content/uploads/2010/06/ExQuillaBody21.jpg"><img class="aligncenter size-full wp-image-855" style="border: 0pt none;" title="Message with Body" src="http://mesquilla.com/wp-content/uploads/2010/06/ExQuillaBody21.jpg" alt="" width="623" height="384" /></a></p>
<p style="text-align: left;">Why no header information? Because the header summary, for reasons that I cannot explain, reads the message file directly &#8211; and assumes that the message is in <a href="http://www.ietf.org/rfc/rfc2822.txt">RFC 2822</a> format. But Exchange Server has already done all of that parsing, and separated the message into its components, including metadata (like subject), body, and attachments.</p>
<p style="text-align: left;">An important issue going forward for the Mozilla Mailnews (Skink) codebase is, what exactly is the thingy that Thunderbird purports to be? Is it a processor of RFC 2822 messages? Or is it something more, that easily incorporates other forms of communications? I hope to write a longer post on that issue soon.</p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://mesquilla.com/2010/06/04/reading-the-body-mailnews-exchange-support/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Lessons from Google: Thunderbird as a Firefox extension!</title>
		<link>http://mesquilla.com/2010/06/01/lessons-from-google-thunderbird-as-a-firefox-extension/</link>
		<comments>http://mesquilla.com/2010/06/01/lessons-from-google-thunderbird-as-a-firefox-extension/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 19:39:16 +0000</pubDate>
		<dc:creator>rkent</dc:creator>
				<category><![CDATA[Planet Mozilla]]></category>
		<category><![CDATA[Planet MozillaMessaging]]></category>
		<category><![CDATA[Thunderbird's future]]></category>

		<guid isPermaLink="false">http://mesquilla.com/?p=829</guid>
		<description><![CDATA[During my current trek to the Bay Area, I seem to be bombarded with news about Google. I was particularly interested in the different way that Google views its business model, and that got me thinking about how Thunderbird fits into Mozilla&#8217;s business model. In an extensive article in Atlantic magazine (I always read the [...]]]></description>
			<content:encoded><![CDATA[<p>During my current trek to the Bay Area, I seem to be bombarded with news about Google. I was particularly interested in the different way that Google views its business model, and that got me thinking about how Thunderbird fits into Mozilla&#8217;s business model.</p>
<p><a href="http://mesquilla.com/wp-content/uploads/2010/06/google.png"><img class="size-full wp-image-833 alignright" style="border: 0pt none;" title="google" src="http://mesquilla.com/wp-content/uploads/2010/06/google.png" alt="Google logo" width="275" height="95" /></a></p>
<p>In an extensive <a href="http://www.theatlantic.com/magazine/archive/2010/06/how-to-save-the-news/8095">article in Atlantic magazine</a> (I always read the Atlantic while travelling), <a href="http://www.theatlantic.com/james-fallows">James Fallow</a> describes efforts that Google is undertaking to try to revive the viability of news reporting as a professional activity. A lot of this revolves around different methods of bundling content with monetization schemes. In the traditional newspaper model, news is one of many parts of the bundle, with monetization provided by various advertising streams. The internet has provided many ways to unbundle the various pieces of the newspaper, with the result that the hard news content no longer has a sufficient bundling with the monetization schemes.</p>
<p>Google may be viewed as a new kind of bundle, with its many services (search, maps, email, news, etc.) all part of the bundle of services that are attached to the monetization scheme of search advertising. The Atlantic article notes that:</p>
<p style="padding-left: 30px;"><em>Virtually all of Google’s (enormous) revenue comes from a tiny handful of its activities: mainly the searches people conduct when they’re looking for something to buy. That money subsidizes all the other services the company offers &#8230;</em></p>
<p>That requires a new way of thinking about understanding the relationship of traditional &#8220;cost centers&#8221; to &#8220;revenue&#8221;. When Google&#8217;s Andy Rubin was asked to justify the expense of Android development in this <a href="http://www.mercurynews.com/business/ci_15184465">interview in the San Jose Mercury News</a>, he responded:</p>
<p style="padding-left: 30px;"><em>So all we have to focus on are  those types of innovations that scale for large audiences, and &#8230; the revenue crank just  turns.</em></p>
<p>So what is Mozilla&#8217;s bundle and monetization scheme, and how does Thunderbird contribute to that bundle?</p>
<p><a href="http://mesquilla.com/wp-content/uploads/2010/06/firefox.png"><img class="size-full wp-image-835 alignright" style="border: 0pt none;" title="firefox" src="http://mesquilla.com/wp-content/uploads/2010/06/firefox.png" alt="Firefox logo" width="400" height="105" /></a>Mozilla&#8217;s main bundle that is attached to a monetization scheme is the FireFox browser, which is monetized through people&#8217;s use of a particular search provider when connected through the bundle. Thunderbird (and its related <a href="http://www.mozillamessaging.com/">Mozilla Messaging</a> cost center) do not currently contribute anything directly to that bundle and its monetization scheme.</p>
<p>I don&#8217;t believe that Mozilla&#8217;s subsidization of Thunderbird can continue indefinitely. Perhaps that was possible for awhile, but Mozilla&#8217;s bundle can be expected to come under continual competitive attack, which will eventually force them to marshall the resources needed to defend the bundle. Mozilla Messaging and Thunderbird need to be part of the solution, and not just a cost drag, when the tough decisions are being made to defend the bundle.</p>
<p><a href="http://mesquilla.com/wp-content/uploads/2010/06/thunderbird.png"><img class="size-full wp-image-834 alignright" style="border: 0pt none;" title="thunderbird" src="http://mesquilla.com/wp-content/uploads/2010/06/thunderbird.png" alt="" width="458" height="104" /></a>If we think like Google, it&#8217;s pretty obvious what the step is that is needed for Thunderbird to become a major contributor to Mozilla&#8217;s main business of &#8220;Firefox the bundle&#8221;.  We need to figure out ways to attract people to the bundle, and get them to linger as long as possible on the bundle while the &#8220;revenue crank just  turns.&#8221; The obvious solution is that the underlying communications code that drives Thunderbird needs to be repackaged as a FireFox extension. (Since I call that codebase Skink, let&#8217;s temporarily use the code name SkinkFox to describe the Thunderbird-as-Firefox-extension product.)  SkinkFox could have the same relationship to Thunderbird that  Lightning has to Sunbird: the same product packaged both standalone, and  as an extension.</p>
<p>&#8220;That&#8217;s just SeaMonkey!&#8221; you say. Well no it is not. If you think like an engineer and focus on features, then I guess SkinkFox is similar to SeaMonkey. But thinking like a marketer, the goal of this is to build the FireFox brandname and revenue stream, and SeaMonkey does not contribute to that while SkinkFox does.</p>
<p>Technically, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=377319">great efforts</a> are already being made to reduce the barriers that keep the mailnews (Skink) codebase separate from FireFox. I don&#8217;t think it would be a huge leap to figure out how to merge Thunderbird&#8217;s user interface and tab system into FireFox&#8217;s.</p>
<p>As Thunderbird enters a critical rethinking in the next few months in the aftermath of Thunderbird 3.0/3.1, SkinkFox is one of a variety of thoughts I will be giving on possible futures for messaging at Mozilla.</p>
]]></content:encoded>
			<wfw:commentRss>http://mesquilla.com/2010/06/01/lessons-from-google-thunderbird-as-a-firefox-extension/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Thread pane and nsIMsgDBHdr/nsIMsgDatabase (Mailnews Exchange Support)</title>
		<link>http://mesquilla.com/2010/05/21/thread-pane-and-nsimsgdbhdrnsimsgdatabase-mailnews-exchange-support/</link>
		<comments>http://mesquilla.com/2010/05/21/thread-pane-and-nsimsgdbhdrnsimsgdatabase-mailnews-exchange-support/#comments</comments>
		<pubDate>Fri, 21 May 2010 22:23:28 +0000</pubDate>
		<dc:creator>rkent</dc:creator>
				<category><![CDATA[Exchange Web Services (EWS)]]></category>
		<category><![CDATA[Mailnews development]]></category>
		<category><![CDATA[Planet Mozilla]]></category>
		<category><![CDATA[Planet MozillaMessaging]]></category>

		<guid isPermaLink="false">http://mesquilla.com/?p=800</guid>
		<description><![CDATA[Now that I have a state machine to handle situations that need multiple SOAP calls, it was not a big leap forward to hookup the SOAP requests to the mailnews summary database. That&#8217;s what gets the messages displayed in Thunderbird&#8217;s thread pane. So here&#8217;s a picture to show where I am at. The two messages [...]]]></description>
			<content:encoded><![CDATA[<p>Now that<a href="http://mesquilla.com/2010/05/10/mailbox-state-machine-exchange-support/"> I have a state machine</a> to handle situations that need multiple SOAP calls, it was not a big leap forward to hookup the SOAP requests to the mailnews summary database. That&#8217;s what gets the messages displayed in Thunderbird&#8217;s thread pane.</p>
<p>So here&#8217;s a picture to show where I am at. The two messages are real messages that exist on the Exchange server, and have been read by my extension. The message body is not real:</p>
<p style="text-align: center;"><a href="http://mesquilla.com/wp-content/uploads/2010/05/ThreadPane.jpg"><img class="aligncenter size-full wp-image-801" style="border: 0pt none;" title="Thread Pane" src="http://mesquilla.com/wp-content/uploads/2010/05/ThreadPane.jpg" alt="" width="646" height="443" /></a></p>
<p style="text-align: left;">One problem that I had to solve is to make the nsMsgDatabase object extendable. The standard code for that does lots of static casts to the pointer for the XPCOM object, which either caused crashes, or duplicate database caches, depending on the approach that I took to get around that.  I ended up writing a patch for the base code to solve this, which presumably I will land for TB 3.2. I still think there must be some way to cleverly avoid this problem without patching the base code, but I could not figure it out.</p>
<p style="text-align: left;">I&#8217;m not real happy about requiring a base patch for this work, because I had hoped to be able to release a prototype for this on Thunderbird 3.1 / comm-central 1.9.2, even though the main release should be in Thunderbird 3.2/ comm-central 1.9.3. Maybe I can still figure out a solution that does not require a base patch.</p>
<h3 style="text-align: left;">Fun with Branding</h3>
<p>I&#8217;ve talked about the <a href="http://mesquilla.com/2010/05/10/mailbox-state-machine-exchange-support/">Colonial</a> layer and the <a href="http://mesquilla.com/2010/03/16/mailnews-exchange-support-the-ews-native-layer/">Native</a> layer in my application. What&#8217;s above the Colonial layer? I want to be able to distinguish between the code shared with Firefox, and the specific code that is used by messaging applications (Thunderbird and SeaMonkey), because I want portions of my work to be loadable into a FireFox extension (just in case). It could be called by the name of the main directory (mailnews) or that directory&#8217;s parent (comm-central). Personally I find mailnews very unattractive as a brand. (A <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=513527">bug asks</a> &#8220;What&#8217;s the name of MailNews?&#8221;)</p>
<p>Although I got no traction when <a href="http://groups.google.com/group/mozilla.dev.apps.thunderbird/browse_thread/thread/da8e9ab0cba06ed8">I suggested it</a> on m.d.a.thunderbird, I&#8217;m going to experiment personally with calling the Mozilla code that implements messaging functionality, and is not included in Firefox, as the Skink layer instead of &#8220;mailnews&#8221; (following Mozilla&#8217;s lizard analogy and Gecko). Yes I am being bullheaded, but this is my personal blog, so I can do what I want, right?</p>
<p>I also managed to register the domain exquilla.com, as ExQuilla is the logical brand for my Exchange Server integration functionality.</p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://mesquilla.com/2010/05/21/thread-pane-and-nsimsgdbhdrnsimsgdatabase-mailnews-exchange-support/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Javascript custom filter action in new FiltaQuilla</title>
		<link>http://mesquilla.com/2010/05/20/javascript-custom-filter-action-in-new-filtaquilla/</link>
		<comments>http://mesquilla.com/2010/05/20/javascript-custom-filter-action-in-new-filtaquilla/#comments</comments>
		<pubDate>Thu, 20 May 2010 17:00:05 +0000</pubDate>
		<dc:creator>rkent</dc:creator>
				<category><![CDATA[Extensions]]></category>
		<category><![CDATA[FiltaQuilla]]></category>
		<category><![CDATA[Planet Mozilla]]></category>
		<category><![CDATA[Planet MozillaMessaging]]></category>

		<guid isPermaLink="false">http://mesquilla.com/?p=788</guid>
		<description><![CDATA[I recently released a new version of FiltaQuilla for Thunderbird and SeaMonkey, and one of its cool new features is a custom filter action that runs arbitrary JavaScript. This relies on new backend features, so you&#8217;ll need TB 3.1 beta2 or later for this to work. Mitra recently pinged bug 249191 asking for a filter [...]]]></description>
			<content:encoded><![CDATA[<p>I recently released a new version of <a href="http://mesquilla.com/extensions/filtaquilla/">FiltaQuilla</a> for Thunderbird and SeaMonkey, and one of its cool new features is a custom filter action that runs arbitrary JavaScript. This relies on new backend features, so you&#8217;ll need <a href="ftp://ftp.mozilla.org/pub/thunderbird/releases/3.1b2">TB 3.1 beta2</a> or later for this to work.</p>
<p>Mitra recently pinged <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=249191">bug 249191</a> asking for a filter action that affects remote content. That looked like a good application of a javascript filter action, so I tried it out.</p>
<p>Looking at the underlying code in <a href="http://mxr.mozilla.org/comm-central/source/mailnews/base/src/nsMsgContentPolicy.cpp">nsMsgContentPolicy.cpp</a>, there is a message header property &#8220;remoteContentPolicy&#8221; that can be used to enable showing of remote content for a message. Unfortunately disallowing content appears more complex, as the address book whitelisting appears to override the message header value. But really I think that allowing remote content on a per message basis is probably the more common action need, so let me demo that.</p>
<p>In my <a href="http://mesquilla.com/extensions/filtaquilla/">documentation for FiltaQuilla</a>, I show a simple basic javascript example of a custom action that affects a message header subject property:</p>
<pre>for (let index = 0; index &lt; msgHdrs.length; index++)
{
  let hdr = msgHdrs.queryElementAt(index, Ci.nsIMsgDBHdr);
  hdr.subject = "[Hello, world] " + hdr.subject;
}
</pre>
<p>It&#8217;s fairly easy to modify this to set the remoteContentPolicy instead. The result is:</p>
<pre>for (let index = 0; index &lt; msgHdrs.length; index++)
{
 let hdr = msgHdrs.queryElementAt(index, Ci.nsIMsgDBHdr);
 hdr.setUint32Property("remoteContentPolicy", 2);
}
</pre>
<p>So if you enter this as a JavaScript custom filter in JunQuilla, you can enable remote content on messages controlled by a filter.</p>
<p>I tested it on a spam message that had &#8220;Exxon&#8221; in the subject. The resulting filter, including the javascript, looks like this:</p>
<p style="text-align: center;"><a href="http://mesquilla.com/wp-content/uploads/2010/05/RemoteContentPolicy2.jpg"><img class="aligncenter size-full wp-image-793" title="Remote Content Policy Action" src="http://mesquilla.com/wp-content/uploads/2010/05/RemoteContentPolicy2.jpg" alt="" width="660" height="790" /></a></p>
<p>I&#8217;m sure that defining these filters is beyond the skill of all but a few advanced users, but once the code is written it&#8217;s pretty much just cut and paste to get this to work. If I collect a few more examples, I suppose I should create a webpage to show them.</p>
<p>Thanks to jcranmer, Standard8, and bienvenu on IRC channel #maildev for helping to point me to the base code that manages remote content policy.</p>
]]></content:encoded>
			<wfw:commentRss>http://mesquilla.com/2010/05/20/javascript-custom-filter-action-in-new-filtaquilla/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mailnews Exchange Support: Account Manager</title>
		<link>http://mesquilla.com/2010/04/21/mailnews-exchange-support-account-manager/</link>
		<comments>http://mesquilla.com/2010/04/21/mailnews-exchange-support-account-manager/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 22:19:01 +0000</pubDate>
		<dc:creator>rkent</dc:creator>
				<category><![CDATA[Exchange Web Services (EWS)]]></category>
		<category><![CDATA[Mailnews development]]></category>
		<category><![CDATA[Planet Mozilla]]></category>
		<category><![CDATA[Planet MozillaMessaging]]></category>

		<guid isPermaLink="false">http://mesquilla.com/?p=731</guid>
		<description><![CDATA[To ease my transition back into ews after getting my brain all wrapped around filters for awhile, I thought I would tackle something that is mostly internal to the mailnews code. So I took on the task of getting a basic custom Account Manager interface up for the exchange web services account type. The account [...]]]></description>
			<content:encoded><![CDATA[<p>To ease my transition back into ews after getting my brain all <a href="http://mesquilla.com/2010/04/12/what-filters-need/">wrapped around filters</a> for awhile, I thought I would tackle something that is mostly internal to the mailnews code. So I took on the task of getting a basic custom Account Manager interface up for the exchange web services account type.</p>
<p>The account manager interface was apparently written by an <a href="http://en.wikipedia.org/wiki/Ancient_%28Stargate%29">ancient advanced intelligence</a> (oops I mean <a href="http://en.wikipedia.org/wiki/Netscape">here</a>), that used <a href="http://www.w3.org/RDF/">mysterious technologies</a> that are <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=420506">no longer understood</a> by humankind. Renowned cybernetic archaeologist <a href="http://quetzalcoatal.blogspot.com/2010/04/developing-new-account-types-part-2.html">Joshua Cranmer</a> has tried to unravel some of its mysteries, but that provided me more of a hint of where to look for issues than a roadmap of what I needed to really do. So I was forced into my last resort &#8211; reading the code and trying to figure it out. There were some surprises.</p>
<p>First, a brief description of terms. When you first create a new account type (unless you are using the new email interface for Thunderbird 3.0), you enter into the account wizard. That sets up up all of the initial values. After that, if you try to edit those you end up in the account manager. They are closely-related, but distinct, interfaces.</p>
<p>First, how do you add a new account type at all to these interfaces? It turns out that kill-rdf missed a spot, and it is still possible to use rdf to add a new hook into the account wizard. Extensions can have a subdirectory &#8220;isp&#8221;, and into that subdirectory you can inject an rdf file that contains some information about your account manager hook. The rss implementation gives some <a href="http://mxr.mozilla.org/comm-central/source/mailnews/extensions/newsblog/rss.rdf">hints</a> of how that is done.</p>
<p>Once you add the rdf file, your new account type shows up in the account setup under &#8220;add other account &#8230;&#8221;:</p>
<p style="text-align: center;"><a href="http://mesquilla.com/wp-content/uploads/2010/04/EwsAccountWizard.jpg"><img class="aligncenter size-full wp-image-734" style="border: 0pt none;" title="Ews Account Wizard Entry" src="http://mesquilla.com/wp-content/uploads/2010/04/EwsAccountWizard.jpg" alt="" width="565" height="317" /></a></p>
<p>The rdf file that you add contains all sorts of information about the account that you are trying to setup. Through some magic, the rdf items get linked directly (at least in theory) to default values for the main account objects.</p>
<p>But unfortunately, extensibility of the account manager has never really been carefully supported, so things just don&#8217;t work out quite the way you would like. Some examples:</p>
<ul>
<li>My account type represents a new protocol type, &#8220;ews&#8221; instead of &#8220;imap&#8221; or &#8220;pop3&#8243;. But at one point the server page looks into the standard file &#8220;messenger.properties&#8221; for strings like &#8220;serverType-imap=IMAP Mail Server&#8221; which of course do not exist for &#8220;serverType-ews&#8221;.</li>
<li>The pages that show in the account wizard are partly hard wired for the existing account types.</li>
<li>Although the account manager has some attempts at extensibility, most of its options are setup as a list of account types to exclude when showing certain screens. This is maddening if you are adding a new account type, because since your account type previously did not exist, of course it does not show up in all of the exclusion lists.</li>
</ul>
<p>So this intricately designed infrastructure that the ancients designed is basically unusable at present to add new account types, as far as I can tell. For each little option that you want to add, you need to trace for hours through very abstract code to figure out whether it will work, or if there is some hidden gotcha. Ultimately, it really is easier just to throw it out and start over again.</p>
<p>Fortunately, through the wonders of javascript function replacements, I was able to create enough hooks to get my new account added, without requiring a patch to the core code. Here is a rough outline of the steps that I took:</p>
<ol>
<li>First, the account wizard seems to use the existence of identities to decide if your have a mail account type, and if you do it forces you to use the standard mail account wizard types. I managed to override this in javascript.</li>
<li>After you do that, through some bizarre quirk the rdf property &#8220;NC:wizardShortName&#8221; is actually a list of the wizard pages that you want to appear for custom account types. So I can add a line to the rdf file:
<pre>&lt;NC:wizardShortName&gt;identitypage,ewsServerPage&lt;/NC:wizardShortName&gt;</pre>
<p>and that will allow me to specify precisely which pages are shown in the wizard. &#8220;ewsServerPage&#8221; is a custom page that I add though an overlay.</li>
<li>In the account manager, there is no easy way to control which subpages appear in the account tree for a custom account type. Once again I can use a javascript function hook to manually adjust the available pages. I wanted to remove the default server page (which asks if I want pop3 or imap), and add my own page in its place. I also wanted to be able to remove pages I did not want. That lets me control the list precisely, so that I now get this account tree:</li>
</ol>
<p style="text-align: center;"><a href="http://mesquilla.com/wp-content/uploads/2010/04/EwsAccountTree.jpg"><img class="aligncenter size-full wp-image-737" style="border: 0pt none;" title="Account Manager tree with Exchange support" src="http://mesquilla.com/wp-content/uploads/2010/04/EwsAccountTree.jpg" alt="" width="263" height="247" /></a></p>
<p style="text-align: left;">I suppose dmose would like me to organize all of this into a sample extension that others could use. One of the reasons that it is hard to get motivated to do this is that there is no real plan for the future of any of this, yet I hear rumors that a lot of this is scheduled for demolition (rdf, account wizard, even binary extensions that my entire application relies on.) Plus I&#8217;m not sure any sane person would want to do the kludges that I am doing to get this to work. Is there even any real demand for custom account types in the mailnews code, beyond what I am doing?</p>
<p style="text-align: left;">Anyway, the good news for the Exchange Web Services integration project is that I now have basic hooks into the account manager interface, so that I can easily add custom changes to the account manager setup to support Exchange Server. The most basic information (user name and server address) can be entered through the account manager interface, and used to access the correct Exchange server.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 637px; width: 1px; height: 1px;">
<pre lang="en">serverType-imap=IMAP Mail Server
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://mesquilla.com/2010/04/21/mailnews-exchange-support-account-manager/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>What Filters Need</title>
		<link>http://mesquilla.com/2010/04/12/what-filters-need/</link>
		<comments>http://mesquilla.com/2010/04/12/what-filters-need/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 21:22:34 +0000</pubDate>
		<dc:creator>rkent</dc:creator>
				<category><![CDATA[Mailnews development]]></category>
		<category><![CDATA[Planet Mozilla]]></category>
		<category><![CDATA[Planet MozillaMessaging]]></category>

		<guid isPermaLink="false">http://mesquilla.com/?p=714</guid>
		<description><![CDATA[I&#8217;ve just completed a two-week hiatus from my work on Exchange Web Services (EWS) integration project to focus on fixing a few filter issues in mailnews core (Thunderbird and SeaMonkey) prior to TB&#8217;s 3.1 feature freeze. I will now return to EWS as my primary focus. But before I do, I think it would be [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just completed a two-week hiatus from my work on Exchange Web Services (EWS) integration project to focus on fixing a few filter issues in mailnews core (Thunderbird and SeaMonkey) prior to TB&#8217;s 3.1 feature freeze. I will now return to EWS as my primary focus. But before I do, I think it would be useful to give an overview of some big-picture issues in filter and traditional search (which are closely related), providing something resembling a roadmap but without any real commitment by anyone to move forward.</p>
<h3>Mailnews Traditional Filter and Search &#8211; Big Issues for Enhancements</h3>
<h4>1. Integrate full boolean search into Search Term editor</h4>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=297852"><strong>Bug 297852</strong></a> &#8211;        Search/Filter and Boolean expressions</li>
</ul>
<p>The mailnews backend traditional search logic supports full boolean expressions, but the user interface has never been updated to allow this. With asuth&#8217;s pending update to the quick search UI, making extensive use of boolean expressions internally, we are getting to the point where quick search can express certain searches that so-called &#8220;advanced search&#8221; cannot (and vice versa.)</p>
<h4>2. Store filters globally, and apply them to selected account/folder trees/contexts</h4>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=11039"><strong>Bug 11039</strong></a> &#8211;        Filter outgoing messages (perhaps to use a different Sent/FCC folder)</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=166842"><strong>Bug 166842</strong></a> &#8211;        [RFE] Ability to import and export message filters</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=129883"><strong>Bug 129883</strong></a> &#8211;        Filters Should be Shareable Across Multiple E-mail Accounts</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=59365"><strong>Bug 59365</strong></a> &#8211;        Filters should have triggers</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=34973"><strong>Bug 34973</strong></a> &#8211;            (GlobalFilters)        global message filter option</li>
</ul>
<p>Filters are currently stored per account (except in news, where they can also be per-folder). But when people define a particular filter, they frequently want it to apply to more than one account. There is no easy way currently to do this, short of recreating all filters on each account. Moving filters is also a pain when accounts are reorganized.</p>
<p>I would store filters in a single location, and provide some sort of UI to define where and when each filter is applied. That would not only be the account or folder, but also the context (such as incoming, manual, sending, or triggered.)</p>
<h4>3. Eliminate context and account dependencies of search and filter options</h4>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=67421"><strong>Bug 67421</strong></a> &#8211;        Missing possibility to filter on text in body for IMAP</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=223591"><strong>Bug 223591</strong></a> &#8211;        Junk classification should execute on each message as it&#8217;s received, not after all have been fetched</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=196036"><strong>Bug 196036</strong></a> &#8211;        Add junk mail status to search/filter criteria</li>
</ul>
<p>A necessary prerequisite of &#8220;Store filters globally&#8221; is to eliminate the current complex dependencies that search terms and filter actions have on the precise capabilities of a particular account, folder, or context. Some examples:</p>
<ol>
<li>Body search is not available for IMAP unless &#8220;download for offline use&#8221; is selected for the account</li>
<li>Junk search terms are not available unless the filter context is &#8220;after classification&#8221;.</li>
<li>News has a much more restricted group of available search terms and filter actions than mail.</li>
</ol>
<p>A major reason that we currently store and define filters the way that we do is to support these restrictions. Yet somehow we manage to silently ignore them without grave consequences in saved searches &#8211; you can define a particular saved search, and then expand its application to include folders and account where the underlying search terms perhaps make no sense.</p>
<p>Unfortunately this creates major problems for the user, who has no way of discovering that in order to activate a junk-based filter, he has to define it as &#8220;after classification&#8221;. Or before she can do a body search on IMAP, &#8220;download for offline use&#8221; must be enabled. It also means that the whole concept of a global filter, which is much desired, goes against the current philosophy of precise enabling of available features.</p>
<p>I will confess that I have been a major contributor to these issues in the last couple of years, in my zeal to maximimize the availability of features while minimizing the impact on existing behavior. But I don&#8217;t really like the result. I think, instead, we should just let the user define what they want, and have the software silently change the behavior to match (download the IMAP body if they want to search on it, delay filters until after bayes classification if they want to search on junk terms.) For cases where something makes no sense at all (like asking to search a news folder for cc) we should define reasonable defaults, and just ignore that the search does not make sense. Perhaps if the filter is being defined only on a news folder, then we could partially hide terms that don&#8217;t make sense (or gray them out). But a global filter should have all terms available, even if they don&#8217;t make sense in all circumstances.</p>
<h4>4. Centralize storage of message metadata related to MIME processing</h4>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=105169"><strong>Bug 105169</strong></a> &#8211;        Filter for Attachments</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=224392"><strong>Bug 224392</strong></a> &#8211;        Feature request: Add ability to filter by attachment name (extension)</li>
</ul>
<p>Currently, MIME processing is done on demand when a message is displayed, or as part of gloda indexing. But MIME processing is relatively expensive as well as async, which means that its results are not available in traditional search and filtering. We really need to perform MIME processing on all messages, and store basic MIME-related metadata so that it only needs to be done once, and that information would then be available to all consumers, including traditional filter and search.</p>
<h4>5. Provide discoverable path to optional search and filter features</h4>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=19442"><strong>Bug 19442</strong></a> &#8211;        Regular expressions in mail and news filters</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=9309"><strong>Bug 9309</strong></a> &#8211;        option to have attachments auto saved to chosen location</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=438441"><strong>Bug 438441</strong></a> &#8211;            (bifftones)        Custom bifftones for mail filters (like custom ringtones)</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=200252"><strong>Bug 200252</strong></a> &#8211;        filter action &#8220;print message&#8221;</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=397009"><strong>Bug 397009</strong></a> &#8211;        A filter will let me tag, but not untag</li>
</ul>
<p>These are a sample of requests that have been implemented in my extensions. There will always be lots more possibilities for search terms and filter actions than make sense to implement in core. I am not convinced that the current method of expecting users to search for extensions to do things is optimal. In the case of custom filter actions and search terms, it might make sense to have a whole category of normally disabled custom actions and terms that can be discovered by all users, added to by extensions, that enable turning on rarely needed actions and terms.</p>
<h3>Bug-related issues</h3>
<p>There are another class of important filter and search bugs that are problems rather than enhancements, and whose fix rely on solving difficult core issues. Some of these are:</p>
<h4>6. Resolve architectural issues of new message notification</h4>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=11040"><strong>Bug 11040</strong></a> &#8211;        Allow filters to control biff UI (i.e. only notify me of &#8220;important&#8221; msg)</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=222068"><strong>Bug 222068</strong></a> &#8211;        Reading filtered mails does not clear &#8220;New Mail&#8221; icon</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=228168"><strong>Bug 228168</strong></a> &#8211;        Getting new mail notification with 0 mails when mail is filtered to local folder from IMAP (&#8220;&lt;account&gt; has 0 new messages&#8221;)</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=233929"><strong>Bug 233929</strong></a> &#8211;        Still get notification on junk if messages left in Inbox</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=378582"><strong>Bug 378582</strong></a> &#8211;        Filter which moves messages from IMAP account to Local Folder prevents new mail alert</li>
</ul>
<p>As I have said before, new message notification is hopelessly confused in mailnews, and needs refactoring.  There are lots of notification-related bugs that I an afraid to touch until that is done.</p>
<h4>7. Queue operations for busy folders</h4>
<ul>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=196732"><strong>Bug 196732</strong></a> &#8211;        Some messages correctly identified as junk are not moved to the Junk Mail folder</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=168648"><strong>Bug 168648</strong></a> &#8211;        Cannot filter (move) messages to Inbox that is busy (fetching its own mail)</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=139215"><strong>Bug 139215</strong></a> &#8211;        mail not filtered while compacting folders</li>
</ul>
<p>Currently if a folder is unavailable for some reason, then filtering just fails. This creates a constant source of unreliable filtering. We really need some explicit method to handle this, perhaps a queue of operations to apply to a folder when it is available again.</p>
<h3>Next steps</h3>
<p>I don&#8217;t really have the time to implement any of these issues for the foreseeable future. I don&#8217;t know for sure what MoMo&#8217;s priorities are, but I would guess that filtering is generally not high on the list. So I guess I&#8217;ll need to put out a help wanted sign (but don&#8217;t believe the &#8220;reward&#8221; part!).</p>
<p style="text-align: center;"><a href="http://mesquilla.com/wp-content/uploads/2010/04/Wantedw400.jpg"><img class="aligncenter size-full wp-image-723" style="border: 0pt none;" title="Wanted - Filter Developer" src="http://mesquilla.com/wp-content/uploads/2010/04/Wantedw400.jpg" alt="" width="400" height="548" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://mesquilla.com/2010/04/12/what-filters-need/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Mailnews Exchange Support: First Folder Discovery</title>
		<link>http://mesquilla.com/2010/03/25/mailnews-exchange-support-first-folder-discovery/</link>
		<comments>http://mesquilla.com/2010/03/25/mailnews-exchange-support-first-folder-discovery/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 19:16:08 +0000</pubDate>
		<dc:creator>rkent</dc:creator>
				<category><![CDATA[Exchange Web Services (EWS)]]></category>
		<category><![CDATA[Mailnews development]]></category>
		<category><![CDATA[Planet Mozilla]]></category>
		<category><![CDATA[Planet MozillaMessaging]]></category>

		<guid isPermaLink="false">http://mesquilla.com/?p=681</guid>
		<description><![CDATA[I set a goal for myself a few weeks ago to perform a single vertical slice through my Mailnews Exchange Support project, focusing on displaying Microsoft Exchange folders in the Thunderbird folderpane. I have now filled in the missing glue from the architecture in my last post, and have my first display of Exchange Web [...]]]></description>
			<content:encoded><![CDATA[<p>I set a goal for myself a few weeks ago to perform a single vertical slice through my Mailnews Exchange Support project, focusing on displaying Microsoft Exchange folders in the Thunderbird folderpane. I have now filled in the missing glue from the architecture in my <a href="http://mesquilla.com/2010/03/16/mailnews-exchange-support-the-ews-native-layer/">last post</a>, and have my first display of Exchange Web Services (EWS) objects in the Thunderbird user interface.</p>
<p><a href="http://mesquilla.com/wp-content/uploads/2010/03/FirstFolderDiscovery.jpg"><img class="size-full wp-image-682 alignleft" style="border: 0pt none; margin: 5px 10px;" title="First Folder Discovery" src="http://mesquilla.com/wp-content/uploads/2010/03/FirstFolderDiscovery.jpg" alt="" width="306" height="378" /></a>The account &#8220;rkent@caspia.org&#8221; is an Exchange account, and is finding the standard first-level Exchange folders &#8211; including some like &#8220;Calendar&#8221; and &#8220;Contacts&#8221; that I suppose should be suppressed here, and shown instead in their correct location in Thunderbird&#8217;s Calendar and Address Book.</p>
<p>The main issue in getting this phase to work was trying to understand how mailnews startup really works, which was complicated because my usual fountain of all knowledge (David Bienvenu) was on vacation when I needed to make progress. I think that I have figured out that nsIMsgFolder-&gt;GetAllSubfoders has been overloaded with the side-effect of initialization, and that happens only at startup, but there are still lots of holes in my understanding of Thunderbird&#8217;s IMAP initialization, which is the closest parallel to Exchange within the Mozilla Mailnews Environment (MME). It did become really clear to me though that the IMAP implementation is very much a problem of synchronization betweem two data stores, though that synchronization is fairly invisible in normal modes of using IMAP. All I am doing now is, on expanding the account&#8217;s root folder, looking for MME objects representing each of the folders that exist in EWS, creating them if needed. (I am also supposed to be deleting any MME folders that are not in EWS, but you can see from the &#8220;rerer&#8221; folder that that is not working for some reason.)</p>
<p>This is currently a barely working implementation (like it asserts with a corrupt database the second time I call it). but the point of this was really to better understand the scope of the entire project, and to provide a basis for an initial development of the architecture, followed by a serious evaluation prior to continuing with the bulk of the project.</p>
<p>Having now completed this initial goal, I need to turn for the next few weeks to landing some bugs that sorely need fixing in Thunderbird&#8217;s filter code prior to 3.1, as I have been ignoring that for way too long. But before I do, let me record some thoughts on critical issues that I need to face when I return to this.</p>
<p><strong>1. Code division between C++ and JavaScript, internal and external linkage, and comm-central dependencies</strong>.</p>
<p>My current implementation is written entirely in C++ as XPCOM objects, but tested using xpcshell unit tests written in JavaScript. The code is split into two extensions.  &#8220;webservices&#8221; implements the <a href="http://mesquilla.com/2010/02/01/toward-mailnews-exchange-web-services-support-soap-calls/">SOAP layer</a>, resides in /mozilla/extensions, and uses external linkage. &#8220;exchangews&#8221; resides in /mailnews/extensions, consists of both the <a href="http://mesquilla.com/2010/03/03/mailnews-exchange-support-basic-mail-infrastructure/">exchange-specific mailnews objects</a>, as well as the <a href="http://mesquilla.com/2010/03/16/mailnews-exchange-support-the-ews-native-layer/">Exchange Native</a> layer, and uses internal linkage. The dependencies are setup so that the SOAP layer is independent, the Exchange Native layer needs the SOAP layer, and the mailnews layer needs the Native layer, and (very weakly) the SOAP layer.</p>
<p>I would like to consider implementing both the SOAP layer and Native layers using external linkage with frozen Mozilla interfaces, so that they could be provided without version dependencies. Then perhaps I could add some generic factories for starter MME objects to the core Thunderbird code in version 3.2, which I could extend using JavaScript to provide the Exchange-specific mailnews objects. That way I could greatly reduce my dependencies on versions in the shipped code.</p>
<p><strong>2. Error logging</strong></p>
<p>The Mozilla framework does not really have a robust centralized error logging and reporting facility, instead there seems to be a multitude of different approaches that don&#8217;t cooperate. My current sprinkling of &#8220;NS_WARNING&#8221; printouts won&#8217;t really help in an imagined future where customers encounter failures. I need to reach some decision on how to do this, so that I don&#8217;t have to redo the error management when I want to release something.</p>
<p><strong>3. Synchronization</strong></p>
<p>This is very much a synchronization application. I need to consider the overall synchronization strategy, and how much to follow the lead of MME&#8217;s existing IMAP implementation.</p>
<p><strong>4. SOAP layer</strong></p>
<p>Partly as a personal education in SOAP, and against the recommendation of several people more experienced than myself, I updated and used the old abandoned <a href="http://mxr.mozilla.org/mozilla1.8/source/extensions/webservices/">Mozilla webservices code</a> as the SOAP layer. Although that is now generally working OK for me, others have suggested that I could accomplish the same thing in an easier, more robust manner using standard XML manipulation routines. I want to attempt to replace one of my SOAP calls using standard XML routines, to see which I prefer, before I implement the 50 or so calls that I will need to glue my Exchange Native layer to the SOAP layer.</p>
<p><strong>5. People</strong></p>
<p>So far, this project has been entirely my own personal effort. But in the future, I envision a small company of 3 &#8211; 5 people who provide and support this code, and are able to make a living doing so. The hope is that I could be independent of, but cooperative with, the main <a href="http://www.mozillamessaging.com/">Mozilla Messaging</a> team that supports Thunderbird. (That is, I hope to answer &#8220;no&#8221; to my question &#8220;<a href="http://mesquilla.com/2009/03/23/do-meals-need-a-fork/">Do MEALS need a fork?</a>&#8220;) At what point should I be adding people to this team? A one-person development team can be quite efficient if it can get the job done, as you eliminate all of the effort associated with maintaining relationships and communication. I think there is a reasonable (50/50) chance that I can get this project done on my own by the end of 2010 and/or in sync with Thunderbird 3.2, as is my current goal. I&#8217;ll need to firm this up by the end of June. But I would be open now to beginning to partner with one of the experienced volunteer mailnews developers (you know who you are) who has similar interests.</p>
]]></content:encoded>
			<wfw:commentRss>http://mesquilla.com/2010/03/25/mailnews-exchange-support-first-folder-discovery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
