Name:		Gmail 
Author: 	k_wayne@linuxpower.org
Description:	A light, functional email client for Gnome.
Website:	http://gmail.linuxpower.org

Why another email client?
-------------------------

Gmail is an unusual mail client. It uses an SQL database to hold the mail storage. This gives it some speed and stability advantages, and also some new features. In particular, it allows you to view your mail based on queries (vfolders), and not on sorting it into particular folders. Read on for more info.

Gmail has been in (slow) development for over 2 years. In that time some other SQL based email systems have emerged. Gmail's unique feature is it's ability to cache the vfolder queries in a very fast way, called the 'Matched Index'. This allows constantly fast (under on second) responses to all vfolder queries.

The author of the program, and many others, use gmail in a stable way for day to day use of their email.

Installing Gmail and Mysql Server:
----------------------------------

How to get gmail working with mysqld?  Well install all the mysql RPM's or compile it yourself. On my test system I have installed:
MySQL-3.22.27-1.i386.rpm
MySQL-client-3.22.27-1.i386.rpm
MySQL-devel-3.22.27-1.i386.rpm

Check out http://www.mysql.org or the gmail web site. 

After these rpms are installed, you should be able to do the usual:
./configure
make
make install (as root)

then run 'gmail'.

You might want to run it from a terminal to watch any debugging output to stdout..

You don't have to know much about using mysql. The gmail druid will setup a user account with local access to the gmail database. 

It is a goal of gmail that you will be able to get away with as little mysql knowledge as possible. I want gmail to make it very easy for you, other than installing the rpms. If you have any mysql problems, please report them to me.

Background - What is a vfolder?
-------------------------------

What is a vfolder? Imagine all your email is just in one big mailbox.. Then a vfolder is just a special 'view' (or query) on that one big mailbox. An example vfolder could be: All outgoing messages, or all messages on the gnome-list. etc. The beauty is that the same message can appear in different vfolders, because it's all in the one big store anyway. So it makes it easier to find messages. For more information, see the comments by the Gnome leader Miguel De Icaza in miguel.txt. (in the gmail tarball).

Observation: is it really the job of the email client to handle data storage? Isn't that the job of dedicated database systems? I wanted to have a vfolder system but I don't want to do all the hard work of data storage, especially when dedicated software exists to do this already. 

Idea: why not just plug gmail into an sql database and base volders on sql queries? Can have a GUI to create the basic and popular ones, but leave the option for the user to input their own sql queries.. Could even have common suggestions, or stuff like "Make filter"....

If the database was on the net you would effectively have an IMAP system you could access with any gmail client remotely, the database only sends the fields you ask for (though we'd need to split attachments into the database to avoid downloading them if we don't want). This would be like IMAP but alot more powerful as it has an SQL query system.


Current Gmail Database Design:
------------------------------

See the HACKING file for this info.

SQL Vfolder queries:
--------------------

UPDATE: Better info on doing this is in the gmail online help.

Vfolders are done by using sql queries. SQL seems hard, but it's not really. Soon gmail will have a gui vfolder builder, so you won't need to learn SQL. But in the meantime here is a quick intro.

NOTE: You do not actually have to build a full SQL query. You just have to tell gmail the conditions for matching. Gmail does the rest. This actually makes it easier for the user. You just need to add conditions for matching.

All incoming messages  - direction = "Incoming"
Outbox        - direction = "Outgoing"
Unread Msg's  - readstatus = "Unread"

To view all the messages intended for a particular email address:
tofield LIKE "%email_address_here%"

If possible, match on the subject header or fromfield, it is much faster:
subject LIKE "%[glx-dev]%" AND direction = "Incoming"

These SQL queries are very powerful.
