The Email app

(Alastair Pharo) #1


Firstly apologies if this is duplicating a conversation already taking place in another thread.

I wonder if people have any thoughts on the Email app. Along with Music, this is probably the “built-in” app that I used the most in Firefox OS. At the moment Email uses the mozTCPSocket API, which won’t be available to web apps. It seems to me that unless the app is only going to support email services that have REST APIs (Gmail, etc), it will need a web server running on localhost that does IMAP/SMTP/POP3 translation. Either that, or it will need to become chrome … (but then everything will need to become chrome probably).

I suppose that such a web server could have uses outside of the B2G project…

(Lissyx) #2

And if only we had a webserver on device … oh wait …

(Alastair Pharo) #3

Great we have Nginx!

I’ve done a little research and found this JMAP proxy. I’ve never heard of JMAP, but it looks like an obvious choice for this - the protocol can operate over plain HTTP, is closely aligned to IMAP and even supports push notifications. I gather Perl can run on Android, so in theory we could run this proxy on a device and proxy_pass through from Nginx.

I am interested to see if this can be done - I shall have a crack. Long term I imagine running Perl on devices is probably not ideal, but it could make a good proof of concept.


This may be a stupid idea, but… What if the Thunderbird team were willing to take on its shoulder the mail app, and turn it into a Thunderbird Web? Since they are a community project born when Mozilla stopped supporting Thunderbird, just like the B2G project, it would make sense to work toghether…

(Lissyx) #5

I guess thunderbird is already not in a good shape to take over this. Meanwhile, I remember the email app team was already hacking around a pure web version of the app. Someone should lurk in the old dev-b2g or dev-fxos mailing list archives, it was discussed there :).

(Lapineige) #6

I agree, I don’t think they have time to work on that point.
And on a Thunderbird point-of-view, I don’t see the point of doing a web app, as it is a heavy email client and not a webmail.
But it might be interesting to get in touch with them, to benefits from their expertise and maybe from some feature of Thunderbird - as the code base is still close.

(Fabrice) #7

Yes, this is @asuth’s glodastrophe:

(Andrew Sutherland) #8

Indeed. And although I’m planning to have an unprivileged web build eventually for cases like discourse accounts where TCP is not needed, the current game-plan is to package it as both:

Packaging it as a browser extension/app is not just a way to get access to the TCP API. The delivery model also has improved security characteristics over running a messaging client off a server that I control and have to keep safe.

Note that glodastrophe is targeting desktop and possibly tablet form factors. I would like to resurrect the FxOS mail app UI as well for a phone-targeted UI, but until Firefox for Android (Fennec) runs WebExtensions or Chrome Apps work on Android, I’m don’t think there is direct runtime support for that since WebRT was removed from Fennec. And while using something like Apache Cordova or similar is an option to package it as an app for Android/iOS/etc, at least if it’s just me hacking on these things, I don’t think I’ll realistically be able to get to that anytime soon given how little hobby programming time I’ve had thus far.

Which is not to say that my game-plan needs to be the only way the email app lives on. I definitely welcome other contributors or other attempts to use the email backend in ways that are aligned with what I’m planning to do. (Which means using the conversations “convoy” branch of gaia-email-libs-and-more for a purely client side mail app. For example, I’m on-board for adding a JMAP account type to the backend since I believe JMAP is the future of email protocols, but I wouldn’t want to spend cycles on trying to adapt the Perl JMAP proxy to run as part of a mail app to workaround lack of access to the TCP API.)

(Alastair Pharo) #9

Glodastrophe looks great!

I have to say I am confused about where WebExtensions fit into the “Web or dead” announcement from the other day. Does anyone know if B2G OS will have the ability to install WebExtensions? If so, I suppose it would just be a matter of adding a mobile UI or media queries or whatever to glodastrophe to make it a viable client for B2G OS, once TCP sockets are exposed to WebExtensions?

(Andrew Sutherland) #10

I can’t speak to WebExtensions and B2G.

As long as we can get the TCP permission flipped for its origin, the email backend and whatever UI is using it (glodastrophe, the FxOS gaia mail UI which was largely updated for the conversations branch) should be able to run in most contexts.

(Fabrice) #11

We had basic web extension support with extensions shipped as packaged apps. Since we are getting rid of the packaged apps, we need to support installing them like the Firefoxes are doing.

We will also have to implement some b2g specific hooks for any API that needs UI features.

I don’t expect that to be very hard, but the surface is quite large.