It's Alive! #
This is my new CGI project. I've decided that Sonar is functionally complete, and adding features on wouldn't have been quite as fun and instructive as working on something else.
Grendel is a web-based POP3 mail client. Although it might look a lot like Hotmail, you still need a separate account somewhere else to use it, it does no hosting of its own. The idea is that you are able to check your mail from anywhere you have a web browser, whereas before you would need to telnet in (if your ISP allows you to do so), or set up a mail client, but then you'd be leaving your settings and downloading your messages on a computer which wasn't yours. Additionally (and even more importantly to me), it allows you to get to your mail when access to the Internet is otherwise limited because of a proxy server.
Obviously this idea isn't new, Hotmail allows you to check an external POP3 account, and there are many free and commercial CGI scripts which are specifically designed to do this. But doing my own thing would allow me 1) to learn more about networking (which I've been meaning to do) and 2) customize it exactly to my needs (that is, make it look a lot like the Netscape mail reader).
I've found (a while ago actually) a simple script which displays a list of messages which you check off, and then they are all displayed for you to read. I've been using this script until now to read my mail when I have to go through a proxy (I switch to my ISP account when I want to download it locally), but it doesn't do all that I need it to do. I want a frames-based interface so that I can go between the messages easily, and I want the messages cleaned up, which means 1) not showing all the headers 2) making links so that they are clickable 3) not stripping out anything that begins with a < (which Netscape treats as the beginning of an HTML tag).
So far I have a working model of what I'm planning to do. I've implemented the frames based interface, as well as the basic header and link filtering within the body of the message. Parsing the headers was something that was very easy to do with Perl. The format of the headers is "<Header name>: <Header contents>". Perl has a split command which allows you to divide up a string based on a certain symbol (in this case I used ": "). Then I stored the split results in an associative array (which is somewhat like an array except the indices can be strings), so now I can access the various headers by using something like this: $headers{'From'}.
Since at the moment Grendel can only check my mail (the user info is stored in a file, but it's not modifiable at the moment), I can't just link to it to show how it works, so here is a screenshot of what it looks like. On the right there's the old mail interface I used:
The big things that are left now are handling of the author's email address (that is, separating the name from the email address, and turning it into a hyperlink), handling the date (I want to convert them all to JST, or whatever is set in the user settings file), displaying threads graphically and sorting of the inbox based on the various fields (these last two will require a reworking of the way in which I store the messages, right now they're just an array of strings).
And in case there is confusion about the name, there's a very simple reason behind it. A while ago (actually, there's some signs of revival with the Mozilla project) Netscape had a project to reimplement Navigator in Java. Although it never really got off the ground, the mail client was mostly complete. The codename of the mail client part was Grendel, and since I'm mimicking the Netscape mail client too, then I thought the name would be appropriate.
Post a Comment