MozillaZine

How to for building a Yahoo Mail Extension...

Discussion of features in Mozilla Thunderbird
AceMarkE
 
Posts: 21
Joined: November 12th, 2002, 6:08 pm
June 14th, 2003, 7:33 am

Post Posted June 14th, 2003, 7:33 am

I've been kicking around thoughts regarding a Yahoo/Hotmail extension, and I've got a couple of questions:

1) I've been looking at two programs which do something similar, MrPostman and YahooPOPS. Both act as a browser to retrieve the mail, then act as a POP3 server for the e-mail client. Since TB obviously has browser functionality already, where could I find information on using that to grab the messages?

2) I'm trying to get an idea of how this would interface with TB in regards to the e-mails, ie, either keep the POP3 functionality or directly pass the messages to TB. Anyone have thoughts/comments on this, or pointers to where in the code TB handles information about new messages?

Thanks for any help.

Mark Erikson

mscott

User avatar
 
Posts: 2516
Joined: April 2nd, 2003, 4:10 pm
Location: Thunderbird Research Center, CA
June 14th, 2003, 1:42 pm

Post Posted June 14th, 2003, 1:42 pm

Mark,
Thanks for volunteering to work on this extension. I think it would be a great addition to what we are trying to build here. I have some comments about how I think you can best build this extension given the Mozilla Thunderbird / Mozilla Mail architecture.

Thunderbird is already an excellent POP3 client. Your extension should aim to leverage that fact already. I would not go down the path of writing an extension that trys to bypass mail accounts (that is don't try to parse the HTML, convert to an email and pass it directly to thunderbird). You will be in a world of hurt. Besides, users are going to expect a POP3 like experience anyway.

Can your extension leverage the work done by these other yahoo clients which act as local host pop servers? That would simplfy the extension even more.

Your extension needs to do two things:

1) Get notified when thunderbird has been started. Then make an external call to make sure the local host server is up and running (i.e. call out directly to YahooPops) or maybe this local server is code you rewrite yourself. In any case, it's separate from the thunderbird and your extension code needs to call out and make sure it is running.

2) Make it easy to create a yahoo pop account directly in thunderbird. Fortunately we have plenty of easy hooks for adding various ISPs dynamically to thunderbird thanks to the work already done on mozilla mail.

This means:
* Add a folder pane extra item with a yahoo logo on it. When the user clicks on it, we bring up a partially filled in new account wizard that has all the grungy stuff already filled in.
* An addition to the account wizard called 'Yahoo Mail' or something like that for creating new yahoo mail accounts.

I'm going to start another post which describes the thunderbird integration in more detail.

I don't want this posting to get too long =).
Thunderbirds are Go!

mscott

User avatar
 
Posts: 2516
Joined: April 2nd, 2003, 4:10 pm
Location: Thunderbird Research Center, CA
June 14th, 2003, 2:01 pm

Post Posted June 14th, 2003, 2:01 pm

We want to do the following

1) You need to create an RDF file which describes the new server. See the example template here:
http://lxr.mozilla.org/mozilla/source/m ... e/ispdata/
read the README file and look t nswebmail.rdf as a goood example of how to fill this out (note the nswebmail is an imap example, make sure you use pop).

This RDF file is used by the account wizard for creating new accounts. Note that you can pre-fill fields in it like the name of the server (which would refer to the local host server you are running or you invoked already). If the user brings up the account wizard and your RDF file has been installed by your extension, they'll see an option such as 'Yahoo Account'.

Your half way there just by adding this single RDF file! Can't get any easier than that =).

The next step is to add visibility to the folder pane such that the user can easily see that they can create a yahoo account after installing the extensions. Fortunately, this too is a well documented approach that the architecture supports.
This is called adding a fake account to the folder pane. The user clicks on the fake account, up comes the account wizard pre-populated with all of the information specified in your RDF file. The user just adds their user name and password and you are done.

Your extension is going to have to overlay a XUL and a CSS file into thunderbird to implement the fake account.

To learn more about how to do this, read:
http://www.mozilla.org/mailnews/arch/fakeaccounts.html

Just to summarize, I really think this should be a simple and small extension to add.

You need to add an RDF file which describes the ISP. You need to add a XUL / CSS overlay to drop in the fake account in the folder pane. That's it as far as interacting with thunderbird goes. No python scripts are needed (I think you mentioned that you were looking at writing something in python in one of your earlier posts).

Your only big decision is: are you going to re-write YahooPops / Mr. Postman so you have your own code that screen scraps and acts as a locah host server? Or are you going to just bundle one of these products inside the extension and just invoke it when you detect that thunderbird has started up? I'd certainly vote for the later approach. Why re-invent the wheel?

For a first pass, I'd focus on getting the overlay and RDF file going since that should be really easy. See that everything looks and gets created correctly. Then step 2, test it using YahooPops or Mr. Postman. Make sure things look ok.

I'd even suggest posting an extension that just does the things I've talked about here to the UI. Tell the user, this extension runs with YahooPops or Mr. Postman and to please launch those on your on.

Once that is up there and folks can start using it, then look at trying to bundle one of these apps directly or look into re-writing them inside your extension.

In any case, get an extension out first that does all this easy ISP UI stuff and will make the experiene of using YahooPops or Mr. Postman better for thunderbird users.

Crawl, walk, run. =)

Good luck,

-Scott
Thunderbirds are Go!

perlhack

User avatar
 
Posts: 174
Joined: November 25th, 2002, 3:15 pm
Location: Canada
June 14th, 2003, 5:37 pm

Post Posted June 14th, 2003, 5:37 pm

In addition to the other screen scrapers, you could also take a look at the following:

http://search.cpan.org/author/SDRABBLE/ ... hoo-0.401/

This is a Perl module with a number of useful functions; the Synopsis includes a brief example of usage. Of course, this would require perl be installed on the user's machine (or this module be compiled for the target platform)

mscott

User avatar
 
Posts: 2516
Joined: April 2nd, 2003, 4:10 pm
Location: Thunderbird Research Center, CA
June 18th, 2003, 11:22 am

Post Posted June 18th, 2003, 11:22 am

I don't know if Mark has lost interest in doing this, if so, I hope someone will still work on this extension. I think I did a pretty good job describing how a contributor should add this feature into the framework. Let me know if I can clarify anything.

-Scott
Thunderbirds are Go!

fabian

User avatar
 
Posts: 2
Joined: June 18th, 2003, 3:45 pm
Location: Belgium
June 18th, 2003, 3:50 pm

Post Posted June 18th, 2003, 3:50 pm

Apparently Hotpop (www.boolean.ca/hotpop) is the only program allowing SMTP as well as POP from hotmail. MrPostman allows POP from hotmail AND yahoo!, tho.

Hotmail works with thunderbird using Hotpop. I tried to do the overlay as you described (I think I got the RDF right), but I can't figure out the overlay stuff. The link you gave only leads to a bug and that bug only leads to a patch that only says there is a pref to see the accounts. However it doesn't say what I have to put in my overlay and css.

Can you shed some light?

Thanks,

-Fabian.

mscott

User avatar
 
Posts: 2516
Joined: April 2nd, 2003, 4:10 pm
Location: Thunderbird Research Center, CA
June 18th, 2003, 9:26 pm

Post Posted June 18th, 2003, 9:26 pm

fabian wrote:Apparently Hotpop (www.boolean.ca/hotpop) is the only program allowing SMTP as well as POP from hotmail. MrPostman allows POP from hotmail AND yahoo!, tho.

Hotmail works with thunderbird using Hotpop. I tried to do the overlay as you described (I think I got the RDF right), but I can't figure out the overlay stuff. The link you gave only leads to a bug and that bug only leads to a patch that only says there is a pref to see the accounts. However it doesn't say what I have to put in my overlay and css.

Can you shed some light?

Thanks,

-Fabian.


Thanks for the interest Fabian. I have some example templates I have to sanitize and then I will add them to the fake account document. Might take me a couple days to get it done though. I have some other thunderbird stuff to do first for some other folks.

Btw, if you did your RDF stuff right, you should be able to just drop it in \thunderbird\defaults\ispdata\

When you bring up the account wizard you should see a new radio button for the isp data in your rdf file. Go through the wizard and make sure the right fields are automatically filled in and that the account looks like it gets set up ok.
Thunderbirds are Go!

jedbro

User avatar
 
Posts: 1899
Joined: November 10th, 2002, 12:35 pm
Location: Mexico / Boulder Co.
June 18th, 2003, 10:30 pm

Post Posted June 18th, 2003, 10:30 pm

Fabian, please keep us posted on your progress, this is definitally something I would like
and was planning to make into an extension, but unfortunatly I'm off on vacation in a few days for a little over a month... can work on it when I get back. But I'm sure someone else would have something by then.

Keep me posted and I can even help you out.

fabian

User avatar
 
Posts: 2
Joined: June 18th, 2003, 3:45 pm
Location: Belgium
June 18th, 2003, 11:54 pm

Post Posted June 18th, 2003, 11:54 pm

I created a new folder in defaults/ called ispdata and dropped hotmail.rdf in there, but it didn't d anything to the account manager or account wizard.
The rdf file I used can be found at
http://guisset.tripod.com/mozilla/thund ... otmail.rdf (be careful the server doesn't send the correct mime-type); if anyone sees a bug let me know.
(btw I didn't say I would do it, i'm in exams and will be off for holydays soon as well)

mimecine
 
Posts: 6
Joined: June 19th, 2003, 6:58 am
June 19th, 2003, 7:07 am

Post Posted June 19th, 2003, 7:07 am

If I can get some time over I'd like to give a shot at HTTPMail which is used by hotmail (Outlook Express uses it). Basically it is a protocol over WebDAV, which I guess already is supported by the codebase (Calendar uses it). Even more interesting would be to couple this with a IMAP->HHTMail Apache module for use by other ISP's.

Features of HTTPMail is similar to IMAP plus the ability to replace smtp (great for AOL users for example), all being secured by means of the regular http security mechanisms.

I have been thinking/fantazising about this couple for at least two years now, but never gotten the time or courage to start it. If there is anyone else out there interested in mentoring/whipping/helping me on this I would be more than happy.

thasmin
 
Posts: 4
Joined: June 27th, 2003, 3:31 pm
June 27th, 2003, 3:34 pm

Post Posted June 27th, 2003, 3:34 pm

I'm writting a HTTPMail app and have a lot of the protocol. But I don't want to write the rest of the email application and stuff, so I took a look at Thunderbird. Respond or send me an email if you still wanna work on this.

mscott

User avatar
 
Posts: 2516
Joined: April 2nd, 2003, 4:10 pm
Location: Thunderbird Research Center, CA
June 27th, 2003, 3:52 pm

Post Posted June 27th, 2003, 3:52 pm

fabian wrote:I created a new folder in defaults/ called ispdata and dropped hotmail.rdf in there, but it didn't d anything to the account manager or account wizard.
The rdf file I used can be found at
http://guisset.tripod.com/mozilla/thund ... otmail.rdf (be careful the server doesn't send the correct mime-type); if anyone sees a bug let me know.
(btw I didn't say I would do it, i'm in exams and will be off for holydays soon as well)


My bad, I meant to say, put the RDF file in
defaults\isp

NOT defaults\ispdata.

Using your example hotmail.rdf file, I placed it in defaults\isp and everything showed up just fine.
Thunderbirds are Go!

AceMarkE
 
Posts: 21
Joined: November 12th, 2002, 6:08 pm
June 28th, 2003, 1:30 am

Post Posted June 28th, 2003, 1:30 am

I'm still interested in working on this, I've just been otherwise occupied the last week or two.

I think we oughta try to get a bit more discussion going, since it seems there are indeed several people interested in working on this. As far as I can tell, the majority of the problem (doing the screen-scraping and POP3 functionality) has been solved several times and some of those implementations are open-source, so I'm thinking we oughta be able to figure out some way to integrate things.

For the record, I was thinking of altering the Account Creation wizard to handle webmail accounts, which brought up a pointer towards overlays.

Anyway, I'd say stick in another reply in this thread if you're definitely interested in pursuing these, and we can start working out what needs to be done.

Mark Erikson

mimecine
 
Posts: 6
Joined: June 19th, 2003, 6:58 am
June 28th, 2003, 7:17 pm

Post Posted June 28th, 2003, 7:17 pm

thasmin wrote:I'm writting a HTTPMail app and have a lot of the protocol. But I don't want to write the rest of the email application and stuff, so I took a look at Thunderbird. Respond or send me an email if you still wanna work on this.


I'd definetly like to talk more on this. How far have you gotten with the protocol stuff? I might help out gluing it in to thunderbird?

eonics

User avatar
 
Posts: 56
Joined: June 25th, 2003, 12:49 pm
Location: Sweden
June 29th, 2003, 6:39 am

Post Posted June 29th, 2003, 6:39 am

When it comes to Hotmail it really does not make sense to use web page scraping since the HTTPMail protocol is well defined and there are several implementations available already.

Doing a search for HTTPMail at SF.net gives the following

http://sourceforge.net/search/?type_of_ ... s=httpmail
Marklar: "You marklars must leave."
Missionary: "But you will all burn forever in eternal hellfire!"
Marklar: "Yes, that's nice, thank you for stopping by."

Return to Thunderbird Features


Who is online

Users browsing this forum: No registered users and 0 guests