Open source Haiku *native* mail, calendar, contacts, document viewer application

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

5 Likes

Excellent! Just what I have been looking for, a small, lightweight email and calendar solution for Haiku :slight_smile: The fact that I can switch to this email client on Linux and Mac makes it even better :slight_smile:

Thank you!

Great to hear that at least the idea fits!
Please still consider, that Haiku version is different from PureMail on other OS and for now does not do synchronization (contacts/rules/templates/accounts…) via IMAP folder with MacOS/Linux/Windows (Maybe one day) like the older brother does.

Also if you use Gmail or similar - this will never be too much fun - downloads from “free” pubic providers are heavily throttled.
If you have you own servers - you can get 150,000 email in about an hour down (with 16-20 connections in the Email → Incoming server setup).
There are still unpolished things, like jumpy Folder tree when you hide unused folders and so on.

Let me know here if it runs at all for you - feedback is greatly appreciated.

Sounds nice, but I haven’t looked at it yet.

In general, in open source operating systems, the idea is not to work around bugs or deficiencies in the system, but to fix them, or at least try to work towards fixing them (bug reports, …).

That’s the only way the whole system evolves for everyone.

1 Like

Absolutely correct Axel!

But I’m mostly not a systems programmer, neither do I have the knowledge of the OS.
Fixing for example app_server text width queries could do more damage to it than good, without me having any real knowledge of internals and the full OS context - that is why workarounds - at least I know they work and can take personal responsibility and fix, if they don’t.

I’m simply not qualified and I know it very welI. But enough to understand consequences of my wrong assumptions and the burden of quick fixes which can cause regression bugs or affect OS stability…

1 Like

I’ve installed PureMail on my machine, and it’s been very smooth with no real issues. I’ve had one email where after loading the image, the image and texted moved to the right of the page. Other than that it’s been real good.

Thank you for the feedback dasouth

I’m very glad if you did not get any errors or crashes and that it did work fine on the first “not on my computer” test.

Drawing issue: It depends on the email source and may or may not be a bug.
If this email is not private or confidential, File- “Save Eml” and send it to info at pureemail,net (double “e”) so I can see the HTML source.
Another way is to save this as Eml file and drag and drop it to the open PureReader (it opens on attachments - small emoji left from the attachment name on documents and images) and in the Reader Screen - View HTML source. Either will do. I will add view html to the mai nscreen at some point as well.

Possible causes:

  1. Most probable: If this is a mass-mailing, newsletter or similar - some web sites just send just a web page, not caring how it will display instead of a HTML email, which may contain browser specific tags like “media” with minimal widths predefined, good for a big browser window, which PureMail will struggle to render in confined space during progressive loading of the image.
  2. Its a bug! congratulations, I will try to fix it in the next build.
  3. It has something to do with your display - let me know if you use a virtual machine or real hardware and if in Haiku “Screen” it shows “VESA” or a driver like Intel.
  4. PureMail is around 6MB in size and renders HTML and other formats by its own - it may well have something missing for pixel - perfect reproduction.
  5. Something else entirely. If I can reproduce it (with this or another email / html) I can give you a proper response.

Thanks again for trying it out and have a Good Night (at least in my place it is night)
Pawel

I just set up my gmx account, and There is one issue which I’m scratching my head over. Anytime I attempt to send an email it won’t send. Copying and pasting from the error log to my browser provides this message.

Hmm. It is RFC compliant very much but

I will have to make a gmx account tomorrow to check. I tested so far around 20 services / servers.

Will let you know tomorrow.

I created another email account (northmail), and sending mail worked fine to every address I tested with except, you guessed it… GMX. My test email to GMX came back with the same 554 error.

I have a hint, Unicode in headers (like MailTo: Jürgen Bäumann) and GMX not accepting unicode smtp route, so the headers become “Non RFC compliant”.
Let me build something which is stricter. As I cannot create a test account (German phone required, Virtual German number is only possible with a Handelsregister Auszug / proof of company registration ) this is a blind fix. Maybe it will work.

Please download an updated version 1.2.3-282, update by double click, - let me know if you can now send normally.
https://pureemail.net/haiku.html

I just installed it and it is a great experience. Thank you very much for making the app, it’s amazing ! The app is super recent so it’s only normal, but the only thing missing for my usage is an icon with a more Haiku-esque design, but I’m pretty sure it’ll happen at some point haha

Also, I’ll try to help with a French translation, time permitting !

One tiny thing which is not software related: I think the PureReader and PureMail download links are mixed up on the website (at least they are on WebPositive haha)

Thank you, I’m happy to hear that!
And thanks for noticing: WebPositive cannot make mistakes like this - it is a Browser- my bad, I did not automate the binary upload, so human error. Fixed now.

As for the Icon - it is atrocious actually and My Xara Designer, which is the only Vector tool I know how to use produces incompatible SVG. I do care about the colors, but the rest is hand made and just a poor test.

If someone give me a nicer SVG - I would highly appreciate it, just like a translation (obviously quality not pure AI translations, meaning use AI like DeepL or so, but review, and Icons and and anything like it will go into attributions / about box).

Pamen

The new build fixed the issue with sending from gmx. I tested by sending to my AOL account and Northmail and had no issues.

Was part of the issue showing PureMail in the deskbar? The new build will not allow selecting that option.

Lovely!
Thank you for reporting, I would not have found it without your help easily.
Let me know in a week if it is still useful.

One warning - Do not edit and save lire office or word in the Reader overwriting old file!

It does warn you for a good reason - you may loose formatting or some advanced feaures.
It is though perfectly safe to save any NEW document as odf or docx - what you see will be saved fine.
Saving a complex PDF as html or so may produce huge files as well - it works but tries to do pixel perfect layout, which resuts in thousand of frames - not a good idea, as editing or evenopening inLibre Office will be a pain. Export PDF text.

Thanks again for the test
P.

For Haiku icons, see: Icon-O-Matic

Mainly, can use any decent SVG image editor to polish and go from there…

Thank you cocobean , being so used to other OSs I forgot about it, indeed, the best choice.

P.

Haiku style SVGs instead of ugly emojis are now in, you can update the package, also some minor Unicode related fixes for SMTP on GMX and text on buttons not cutting off on languages with longer words are in.

Thanks to dasouth and qntnlq for digging into the details / testing as well.