Comment 21 for bug 327773

Revision history for this message
In , Follower (follower) wrote :

This would indeed be a useful feature.

Here are some thoughts on possible implementation details:

There are admittedly questions about whether or not this is an "legitimate"
thing to do, but there are already "commercial" (e.g. shareware etc) products
that do this and to my knowledge nobody's been sued yet...

As a starting point it would be good to at least have a new mail notification
feature even if it didn't actually retrieve the mails.

One common way to allow mail clients (e.g. Eudora etc) to read webmail is to set
up a proxy server on the user's machine. The proxy appears to the client as as
an IMAP/POP server and to the website as a browser. It then "screen-scrapes" the
HTML of the web site to extract the messages and passes them on to the mail client.

One major advantage of developing something that implements a known protocol
like IMAP/POP is it avoids reinventing the wheel and can hide the implementation
details from the client, leaving the back end to use whatever methods necessary,
e.g. httpmail, screen-scraping etc.

Something like this could be incorporated into Mozilla and it would "only"
require the Mozilla mail client to be configured to use the localhost as its
server. The downside to this approach is essentially the user is running a
server on their machine which adds security issues (even if it is restricted to
accepting localhost connections only).

An alternative would be to somehow enable the Mozilla IMAP/POP client to make an
internal connection to something pretending to be a IMAP/POP server within
Mozilla itself.

As far as implementing the back-end goes (i.e. the stuff that actually retrieves
the mails from the web sites) a good approach would be to employ a plugin
architecture with a different plugin for each site (at least one product I know
of works this way). The Mozilla side could provide an API for the plugins to
interact with (e.g. to retrieve the pages, handle cookies etc) and the plugins
would essentially render down the html to folder & message listings and the
actual message bodies themselves, which would in turn be passed back to the
IMAP/POP client within Mozilla.

There would need to be some mechanism for updating the plugins when a site's
layout changed, or at least a way of notifying the user that they need to update.

In the past I have developed one fully working Perl script and a couple of
(very) partially working Python/C programs which were designed to archive
messages, so I know it is possible. The hardest parts (of the back end at least)
are handling the cookies and distilling the pages, but as long as you've got a
good regular expression implementation the distilling's tedious as much as anything.

Anyway, that's my $0.02 for the moment...