Preliminary design for libmailcheck- comments appreciated



Those of you who have been following the thread "Re: biff utility" on 
gnome-list know that I seem to have volunteered myself to coordinate 
the writing of a mail checking library for gnome-libs, hopefully to 
be CORBA-ized by those who know more about that subject than I.

Anyway, I've done some preliminary thinking about what such a library 
might look like, and came up with the following, on which I'd 
appreciate comments.  I'll admit up front that I have been known to 
design overly-ambitious interfaces which need to be scaled down to be 
actually feasible, so feel free to bring me back to earth.

Basically, I think the library should store a collection of mailbox 
sets, each of which would be a possibly heterogenous set of 
mailboxes.  Each set could then individually be checked for new mail, 
or all the sets could be checked.

The function interface would probably look something like this:

int  gnome_mailcheck_create_set();
void gnome_mailcheck_register_mbox(char* fname, int set);
void gnome_mailcheck_register_mh(char* path, int set);
bool gnome_mailcheck_check_set(int set);
bool gnome_mailcheck_check_all();

Obviously, there would be corresponding delete/unregister calls for 
each of the create/register calls.  In addition, a 
register/unregister pair would be added for each new mailbox type we 
support (perhaps POP3 or IMAP, or a different local format).

Internally, there would probably be a set of gnome_mailcheck_check_* 
routines, one for each mailbox type, which check_set() and 
check_all() would call to do the actual checks...

How does that sound?  Too complex?  

My biggest questions are in the area of storing the information about 
the sets/mailboxes.  Among them:

* Can I just dynamically allocate memory for data structures, say 
linked lists?

* How do I keep different users' information separate?  Does CORBA 
affect this?

* While I think sets are a good idea (imagine, for example, one set 
of user-defined "high priority" folders and another set of "other" 
folders, or one set of "local" and another of POP3/IMAP remote 
folders, which one might check less frequently to reduce network 
load), how can multiple applications (in a CORBA setting, say) know 
to use the same set ID?  Or would the user have to configure this in 
each application?  (Not ideal...)

Comments would be appreciated...  If the design sounds reasonable, 
I'll see if I can code something up later in the week (after I clear 
one or two class-related projects off my TODO list).  (The obvious 
starting point would be to copy the code from the mailcheck applet as 
a starting point for gnome_mailcheck_check_mbox().)

-Russell



-- 
Russell Steinthal
<rms39@columbia.edu>		Columbia College Class of 1999
<steintr@avnet.org>		System Administrator, AV-Network





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]