<p>Haiku provides a system that retrieves e-mail regularly via a mail_daemon and saves each mail as a single text file. It parses the mail and fills its attributes with all necessary header information, like from, to, subject and its unread status. Now it can be queried by you or any application. This system also makes switching e-mail clients easy as all the data and your configuration stays the same.<br/>
The configuration is done in the E-Mail preference panel.</p>
You start by clicking the <spanclass="button">Add</span> button to create a new, unnamed account. Then you declare the <i>Account Type</i> which is either <spanclass="menu">Receive Mail Only</span>, <spanclass="menu">Send Mail Only</span>, or the most usual type, <spanclass="menu">Send and Receive Mail</span>.</p>
<p>From the drop-down menu you choose the protocol used by your provider. <spanclass="menu">IMAP</span> and <spanclass="menu">POP3</span> are supported.</p>
<p>Next is the <spanclass="menu">Mail Server</span> address for incoming mails. If your provider needs you to log into a specific port, you add that to the address, separated by a colon. For example, <tt>pop.your-provider.org:1400</tt>.</p>
<p>Then you enter your login information, <i>Username</i> and <i>Password</i>, and if necessary change the <i>Login Type</i> from the default <spanclass="menu">Plain Text</span> to <spanclass="menu">APOP</span> for authentication.</p>
<p>If you retrieve mails of this account from different computers, you may want to activate the option to <spanclass="menu">Leave mail on server</span> and only <spanclass="menu">Remove mail from server when deleted</span> locally.</p>
<p>The <spanclass="menu">New Mail Notification</span> offers different methods to announce the arrival of new mail. Try different settings to see what works best for you.</p>
<p>You can change the <i>Location</i> of your inbox (default: <spanclass="path">/boot/home/mail/in/</span>), which is useful if you'd like to separate the mails from different accounts into their own folders. However, queries let you sort things out just as well.</p>
<p>Last on this page, you can opt to only <spanclass="menu">Partially download messages</span> that are larger than a certain size. This will only get the header and you can decide if you want to download the rest of the message plus possible attachments after seeing the subject and who sent it. Useful if you have a slow connection.</p>
<p>Next is the <i>SMTP Server</i> address for outgoing mails. As with the incoming server before, you can use a specific port if needed, e.g. <tt>mail.your-provider.org:1200</tt>.</p>
<p>If you need to login, you change the <i>Login Type</i> to <spanclass="menu">ESMTP</span> and enter username and password above. The other type is used for providers that need you to check for mail with <spanclass="menu">POP3 before SMTP</span> for identification.</p>
<p>If you want to filter your incoming email, you click on <spanclass="menu">E-Mail Filters</span> under your account's name to set up automatic sorting. You can add any number of filters that are applied one after the other. You can rearrange them by drag&dropping them to their new position.<br/>
Besides the <spanclass="menu">R5 Daemon Filter</span> that's used for backward compatibility, there are two other <spanclass="menu">Incoming Mail Filters</span> you can add.</p>
<p>The spam filter uses statistical methods to classify a mail as unwanted spam. It assigns a value between 0 and 1 to it and you can decide what are the limits for a genuine mail and what will be considered spam.<br/>
You can have that spam rating added to the start of the subject.<br/>
Also, the spam filter can learn from all incoming e-mail. Of course, you'll have to teach it by sorting out the false positives, mails that were mistakenly marked as spam. You'll find more on that when we discuss the application <spanclass="app">Mail</span>.</p>
<p>Together with the following <spanclass="menu">Match Header</span> filter, you're able to automatically sort out detected spam mails.</p>
<td>The current status of the e-mail. Normally, this can be "Read", "Replied", "Sent", "Forwarded", "New", or anything you have designated yourself. However, unless you change it yourself in a filter, it will always be "New" when the mail_daemon fetched the mail.</td></tr>
<td>this is a numerical estimate that the spam filter assigned to the e-mail. They are shown in scientific notation, where 1.065e-12 translates to 1.065 divided by 10 to the 12th power, which in this case translates to 0.000000000001065.</td></tr>
</table>
<p>The second text field holds your search pattern. It accepts <ahref="http://en.wikipedia.org/wiki/Regular_expression"class='external free'title="http://en.wikipedia.org/wiki/Regular expression"rel="nofollow">regular expressions</a> which gives it great flexibility, while unfortunately complicating things a bit. Read up on it a bit, it's well worth it and simple search patterns aren't <i>that</i> complicated at all.</p>
<p>With the drop-down menu below it, you assign an action when the pattern matches. You can move or delete a mail, set the status to "Read" or anything else or set the e-mail account you'll reply with.</p>
<p>At this moment, there's only one filter that deals with outgoing mail: <spanclass="cli">fortune</span>.
<br/>It will attach a randomly chosen funny or wise "fortune cookie" to the end of every mail before it's sent out. You can do a dry run by issuing the command <spanclass="cli">fortune</span> in a Terminal.</p>
<p>Now that your incoming and outgoing mail servers (and maybe some filters, too), are configured, you have to tell the mail_server that does all the actual mail checking and fetching how to do its job.</p>
If you're on a dial-up connection, you may want to do that <spanclass="menu">Only When Dial-Up is Connected</span> and also <spanclass="menu">Schedule Outgoing Mail When Dial-Up is Disconnected</span> to avoid dialing automatically in regularly only to check for mail.</p>
<p>The mail_daemon has a status window which you can set to show up <spanclass="menu">Never</span>, <spanclass="menu">While Sending</span>, <spanclass="menu">While Sending and Receiving</span> or <spanclass="menu">Always</span>.</p>
<p>Make sure to <spanclass="menu">Start Mail Services on Startup</span> or there will be no mail_daemon running to do your bidding...</p>
<p><spanclass="menu">Edit Mailbox Menu...</span> will open the folder <spanclass="path">/boot/home/config/Mail/Menu Links/</span>. All folders or queries (!) or their links put into this folder will appear in the context menu of the mailbox icon of the Mail Services in the Deskbar tray.</p>
<p>From that menu, you can also <spanclass="menu">Create New Message...</span>, <spanclass="menu">Check For Mail Now</span> or <spanclass="menu">Edit Preferences...</span>.</p>