After frustratingly trying to actually move some of my daily work from Haiku, I decided to recreate from scratch my email / calendar / contacts / document viewer / whatever client for Haiku, in Haiku, Haiku Style and Haiku snappy (and hopefully worthy). Took a while, especially getting rid of licensed dependencies and writing in C++, not my favorite pascal, but here it is.
Once someone here tells me how to set up this for Haiku Depot/Package manager without using GitHub or any other public spaces, while keeping it open source for all Haiku devs, then I hope this can be included in the Depot.
Changes to PureMail will be controlled for some time, so I need to approve any merge requests.
For now just source and packages download is here for curious and adventurous (if you are not too afraid that this may be some virus or spyware)
Be so kind and do not post the code on GitHub or anywhere else for now, you can download packages, source code, compile, have a look, check for malware, be amazed how poorly written it is, but do not publish yet on public repositories. Devs: Read the license and a dev section below.
*** Where to get it *** (as this is a pure HTML/CSS web site, no server, no JS apart from single cookie the “html” is important):
Haiku - PureMail (direct downloads are prohibited with a JS cookie because of bots and scraping sites, so you do need to open the page to download anything)
License: Haiku License - PureMail
Note that the rest of the Website is for PureMail Linux / MacOS / Windows, which is a completely different animal - only concepts were taken from those, nothing else, so Haiku Web page is the only one referring to Haiku PureMail. FAQ/Screenshots and all other stuff - that is not Haiku.
Requirements:
Haiku x64 (Beta 6 is the only tested!) and Retro-Modern CPU (SSE4.2, any CPU since about 2009, Best bet: anything starting From Intel Skylake 2014-2015 like Thinkpad X270), VMs not recommended.
Protocols: IMAP(S), SMTP(S), CardDav, CalDav. TLS 1.3 (if server supports) by default.
Networking: bare BSD sockets.
Guarantees - none, I have 3 Haiku installs (1 bare metal, 2 VMs), it works here and is stable, but it does not mean it works for you - send an email to info at pureemail.net with an attached Haiku debug report, so I can check it.
For End Users (minimal summary, really):
Fully fledged (and I mean it) IMAP/SMTP/CalDav/CardDav client with an integrated engine to read/preview (and in few case write / convert) HTML, docx, odf, xlsx, epub, pdf and some 20 other formats for easy handling of email attachments.
No Webkit, Qt, GTK, no browser needed.
Special feature for @humdinger : “Haiku Nerd Export” in File Menu. Saving eml files Haiku way is not an option for performance reasons. But “Haiku Nerd Export” allows to export all emails from all accounts into “Mail” (or whatever is defined) Haiku style, with file attributes. Then you can delete PureMail, attachments (usually home/PureAttachments and ~settings/PureMail) so you can have all emails there and use another Client like built-in Mail. files may be overwritten or duplicated if some already exist. Therefore only for Nerds.
Templates / Signatures for use in New, Reply, manual insert etc.
Simple sorting rules.
People - lazy synchronized with Haiku two-way.
Automatically recognized Conference/meeting links to fire up browser (Google Meet, Teams and quite a few others)
Spelling uses hunspell - so just install your extra dictionaries in Haiku Depot.
Animated GIFs in email preview (you can switch it on or off - it can be annoying)
Address Book - multiple emails per person, automatic Gravatars, target emails linked to accounts, primary emails…, gathering and import / export to online contacts, manual merge, duplicate discovery and mass merge…
Display of certificate on SMIME signed emails (encryption and signing not implemented yet)
Calendar - something between Outlook, Thunderbird and a 1997 calendar, but with all modern features (accept, propose new time, decline, recurrent events, attachments, if your server supports it and more).
Fast, especially if used with real IMAP, not Gmail, Outlook and other throttling providers (public providers like those stall, limit connections, enforce download caps, have long delays on connections, even can lock you out for 72 hours…)
Proper queue for all user operations, persistent over sessions.
Easy to set up - guesses IMAP servers from DNS/Mx records, Finds calendar and contact URLS for 20+ popular servers…
Multi-threaded, adjustable sync - on proper IMAP you can download / sync from 10-30 folders at the same time (or less or more - a Test for you server is in the Incoming Server Tab in preferences - click, it will check and advise)
Integrated with Haiku, including add-ons and small footprint Replicant for display of incoming/pending/queued items.
Follows Haiku Colors / Appearance (including email preview and document attachments, apart from PDF).
Delayed send for careless people; open with applications installed on Haiku, open attachments or links with any app installed on Haiku…
Unlimited accounts, calendars (any caldav; and yes Gmail calendar will also work, just not as fast).
Code coloring for popular languages (not a code editor - this is for attachments) - automatic or user-defined.
And a lot of other small details probably not listed here, like editing, display and replying to comments in HTML/Word/LibreOffice docs, instant search in an email or any document with hit list and some context of found text (like MS Word), I don’t now now more - it just contains what I like to use daily for the last 20 years, nothing more.
Ah, wait. There is also PureReader - small, independent side app that opens from Tracker all formats that Puremail engine supports internally (see at the end), allows to edit documents in HTML (warning - as the engine is not an office package there may be loss of fidelity or formatting in produced docx/odf files and big xlsx files are trimmed to 4000 rows, creating HTML from a 1 MB PDF will look good but may be 80MB - depending on the PDF structure).
After PureReader installation you can use Tracker “open with” or drag and drop for quick view of files (or code) (well, also SVG or GIF or PNG or Fax…). I was tired of firing up LibreOffice or another 5 apps and waiting just to peek on an attachment.
UI Languages - Now only English, Polish, German (the 3 I actually speak and write) and Russian (probably not so good, as my Russian is beyond poor). Corrections are welcome. AI translations are not really welcome, can do myself but chose not to.
You can also translate yourself → Language - Export - Import.
For Developers
PureMail and its render engine is free to use, change, fix, fork, whatever - as long as it is on Haiku only (no Lin/Win/MacOS/Other ports) and with attribution(see license first).
For now please do not upload to any public repository in any form, until the original code is in a repository where you can issue merge requests.
Code cleanup, formatting and volume testing / pixel-wise document conversion comparison tests were done with Claude and Haiku “hey” where needed. I am very lousy at making pretty code and I’m also not able to mass test and compare 240K documents by hand or run 100 times the app to see if it will crash on the run 97.5.
Code comments: only on the top of each file. Comments are assumptions what should be, not what the code actually does. So the sources are not for suitable for learning to code in C++ / Haiku.
Continuing: the source to PureMail includes PureMail document engine (compiles also as a LIB - see Api.h; it can also be included directly - as it is really small) and a PureReader app (very usable and also a good example what can be done with the Engine).
Dependencies: as I did not want to use GPL to be able to license the code under Haiku-MIT license (see “Haiku License” in the menu or on the web site) - all HTML and document processing apart from PDF writing is done with the PureMail engine. That allows for good speed, document fidelity to a degree (for example TOC, footnotes, headers, tables, images, SVG, FAX images in pdfs, comments in docx/odf and plenty more) and most importantly - no heavy weight dependencies which could break PureMail on an update and pkgman proposing to get rid of it.
That also means - you can use it for commercial apps built for Haiku.
All PureMail Builds target generic major versions of few libs only (not so many - 5, most already in every Haiku as standard) to prevent minor version conflicts.
Drawing / rendering is avoiding app_server, as already documented bugs exists and the performance on some request is not always the best) app_server may crash the OS (even on bigger batched requests to measure text, which are also serialized by the app_server, I saw in the source “TODO”).
HTML implementation should cover HTML4 and CSS plus some goodies from HTML5. That also means - dark mode is implemented in the engine.
HTML Editing, needed for PureMail is also fully done in in the engine - includes hunspell integration, very detailed controls over tables, images etc.
PDF rendering is tiny bit slower than, let’s say BePDF on some documents, but it can handle 400 page complex pdf with 100000 outlines just fine.
XLSX engine is the only one limited to preview: first 4000 rows and max 4 sheets per workbook. There are reasons for this a real world xlsx with 80,000 formatted rows per sheet and 20 sheets will at this time break the engine HTML rendering. As the engine does not write spreadsheets - this is not a big deal I hope.
Volume test were done on corpus of around 40,000 documents (real business docs, nothing synthetic) and 200,000 real HTML emails I happen to have in my mailboxes.
Stability should be fine for a first release - 7 days with no restarts or any detected memory leaks.
***Development Pitfalls ***
app_server (marked already as TODO in Haiku code) - too many requests for font widths will break app_server and crash the OS. Although very fast, but serialized, harder to do parallel queries, impossibly to batch bigger requests.
network kit: seems not work for STARTTLS, so 8 out of 12 of my servers will not connect or send emails on 587, only conservative servers with standard port 25 or IMAPS will. Well, BSD sockets are used and work great, witch quite a bit more coding.
mail_kit - limited MIME, obviously very good for plain text. To process correctly all multipart MIME messages, SMIME signatures, thread-index chains, delivery and other notifications, Calendar invites in MIME parts, distinguish CID: images from attachments and so on… Again - a bit more code.
Supported formats for email, attachment and PureReader display
OLE2 documents: doc and xls may not display some images, no guarantee for perfect formatting for anything, HTML, docx and odf are as good as it gets for the purpose it is build for.
Documents:
doc,docx,rtf,txt,md,csv,xls,xlsx,odt,ods,ppt,pptx,epub,fb2,pdf,html,eml,ics (+ source code syntax highlighting for quite a few languages)
Images:
png, jpg, jpeg, jfif, gif, bmp, dib, webp (depends on Haiku webp lib installed), tif, tiff (including fax g4 b/w multipage tiff), svg - most depend on Haiku translators, apart from SVG and obscure formats.
Have fun!
-pamen
