<p>This workshop takes a look on how to manage email under Haiku. It assumes that the email services are correctly configured with the <ahref="preferences/e-mail.html">E-Mail</a> preferences and you're familiar with the basic features of the <ahref="applications/mail.html">Mail</a> application.</p>
<aid="mailsystem"name="mailsystem">Haiku's mail system</a></h2>
<p>If you come to Haiku from other operating systems, you're probably used to big applications like MS Outlook or Mozilla's Thunderbird. You have to configure them by entering all the info on mail server addresses etc. and they use their own contacts database. They take care of sending and fetching email and store them in some big special file.<br/>
Changing you email client can be a hassle with quite some ex/importing and converting going on. Using more than one client in parallel to check out what else is available is also not without the occasional kerfuffle.</p>
<p>Haiku's mail system is different. It breaks down into smaller separate modules.</p>
<p>There's the <spanclass="app">mail_daemon</span> that takes care of the communication with your mail servers. The <ahref="preferences/e-mail.html">E-Mail</a> preferences is the one central point to configure your email accounts and how often they're checked, for example.</p>
<p>Every message that is fetched or sent is saved as one single email file, with its header information (like sender, subject, date) and status (like New, Replied, Sent) in BFS attributes. This enables searching/filtering them with Haiku's fast queries.</p>
<p>With every email being in a separate file, viewing them becomes just as easy as browsing through a folder (or query result) of images with <ahref="applications/showimage.html">ShowImage</a>. Leaving the Tracker window open, you'll see the moving selection of the currently viewed file while you use the previous/next button to move through them.<br/>
As they are independent files, using a viewer other than Haiku's <ahref="applications/mail.html">Mail</a> causes no problems whatsoever.</p>
<p>Similarly, creating a new message results in just another file that is handed to the mail_daemon that takes care of sending it off. Contact management is deferred to the <ahref="applications/people.html">People</a> application.</p>
<p>In a nutshell, where other mail clients do everything, from communicating with the mail servers to providing a view with all your mails and tools to search and filter them, Haiku uses a chain of smaller tools and general file management:
<ul>
<li><p>The <spanclass="app">mail_daemon</span> to fetch/send mail and save them as normal files.</p></li>
<li><p>Tracker windows and queries to find and show email files.</p></li>
<li><p>The <spanclass="app">Mail</span> application to view email files and create new messages relying on system-wide contact management by the <spanclass="app">People</span> app.</p></li>
</ul>
Especially using Tracker and queries to manage emails is a powerful idea. The experience you gain can be transferred to any other problem that is dealing with files. Be it images, music, video, contacts or any other documents, using Tracker is at the core of all file managing.<br/>
Also, improvements in any of these system areas benefit not just emailing, but all applications that make use of them.</p>
<p>When you browse through your newly arrived email, you may want to come back to some of them later to think about it in more depth. While you could use Mail's menu <spanclass="menu">Close and | Leave as New</span> to keep them in your "<i>New messages</i>" query, things tend to pile up that way...</p>
<p>One solution is of course to just start a reply and save it as draft. But if you don't expect to write a reply and just want to re-read the mail later, that isn't ideal.</p>
<p>Better use <spanclass="menu">Close and | Set to...</span> to create a new status and use that to categorize your mail. For example, you could call the status "<i>Later</i>", and then query for that when you find more time.<br/>
Or you use different statuses for specific projects. For example, I created a status "<i>HUG</i>" (for "Haiku user guide") under which I collect every mail that may influence the contents of the user guide, like commit messages about code changes that alter or introduce some feature or anything else I feel could improve the user guide.<br/>
In any case, try to keep the status name short. That way it always fits in a normally wide "Status" column in Tracker.</p>
<p>You don't have to open an email with the <spanclass="app">Mail</span> application to set its status. With the Tracker add-ons <spanclass="app">Mark as Read </span> and <spanclass="app">Mark as...</span> you can select some email files and set their status in one go.</p>
<p>Sure, you specify a folder to store all your email, you can open it et voilà, there's all you mail. But over time the folder becomes crowded and showing all will take longer and longer as thousands of files and their attributes have to be parsed and sorted. Also, most of the time you don't really care about two year old emails of Nigerian princes and their inheritory trouble ...</p>
<divclass="box-info">A lot of time when populating a folder is spent on putting files read from disk into the correct sorting order and displaying that in the window. If you do have to open a folder with a huge number of files, you can shorten the wait by making the Tracker window "invisible", i.e. either minimize it or change to another workspace. Watch <ahref="applications/processcontroller.html">ProcessController</a> to see how it affects CPU usage.</div>
<p><ahref="queries.html">Queries</a>, to the rescue!</p>
<p>By using queries, you can narrow down the view of your mails. Actually, the mailbox icon in the Deskbar uses queries.</p>
<p>The <spanclass="menu">Open Draft</span> submenu does a query for the status "<i>Draft</i>", which is set by <spanclass="app">Mail</span> when you save a message.</p>
<p><spanclass="menu">Open Inbox Folder</span> and <spanclass="menu">Open Mail Folder</span> are just links to regular folders (and not very useful in my opinion).</p>
<p>The <spanclass="menu"># new messages</span> submenu is populated by a query for email with the status "<i>New</i>" (that same query is used to change the mailbox icon to show some letters in it, by the way).</p>
<p>You can add your own queries (and links to folders) in that context menu too, by putting them into <spanclass="path">~/config/settings/Mail/Menu Links</span>.</p>
<divclass="box-info">The query <spanclass="path">~/config/settings/Mail/mailbox</span> is a special case: It is executed when left-clicking the mailbox icon in the Deskbar. If you want to change that behavior, you can replace it with any other file (or link to a file), just name it "<i>mailbox</i>". It doesn't have to be a query, a link to a folder of queries or a script or application works just as well.</div>
<li><p>If you don't save a query as "<i>Query</i>" but as "<i>Query template</i>", invoking it won't show the result window, but the Find... window instead. That way you can easily exchange the search string for the subject or sender, for example, or change a "<i>2 days</i>" time limit to "<i>3 days</i>".</p></li>
<li><p>Activating "type-ahead filtering" in <ahref="tracker.html#tracker-preferences">Tracker's preferences</a> allows you to very quickly filter a query result even further. Often it's enough to query for all mails of the last 3 days and go with type-ahead filtering from there. The big advantage is, that you don't have to exactly specify which attribute to search for, as all displayed are considered when filtering.</p></li>
<li><p><ahref="http://haikuware.com/directory/view-details/utilities/desktop-accessories/relatedmail">RelatedMail</a> is a nifty little application that will query for all mails with the same subject/sender/time-frame etc. of a dropped email. Kind of what the <spanclass="menu">Queries</span> menu in the <spanclass="app">Mail</span> app is supposed to do.</p></li>