Sendmail & mail.local + MySQL API

I've searched this message board, and the newgroups THOROUGHLY, in search of any information towards implenting the MySQL API with C... I'm a "beginner" to the C language I suppose, and i've made a few functions in C that can be implemented into the source code of Sendmail/mail.local, so that any INCOMING mail will be INSERTED into a MySQL database, I know that the size of the tables can become insane, but i'm not worried about that.. My question now is, can anyone point me into the direction of some documentation or perhaps some insight on WHERE/HOW to place my functions into the source of Sendmail/mail.local and how to add the link to the libraries and such? Any help would be greatly appreciated...

Thanks in advance,

Corey

In the sendmail.cf file there is a configuration area that lets you specify the local mailer. This is the the part of sendmail that does the post processing of the incoming mail. I would recommend you add the functionality there by building your own version of the mailer...... for example....

Ok thanks for the reply, I have edited the sendmail.cf file's "Mlocal" + my mail program... I have my program written in C, and it delivers whatever I tell it to, to the tables within the MySQL database, however, I might be repeating myself, But could you steer me now into the direction of how to just get ALL the data into the C program from the STDIN, then I can move onto the next step... Reason is this, if I do:

scanf("%s %s %s %s",&From,&FromAddress,&To,&ToAddress);

It will only grab the "From:" (&From), "Blah@blah.com" (&FromAddress), "To:" (&To),"Blow@blow.com" (&ToAddress)..

I want to be able to stream EVERYTHING, or atleast when it comes time to get the WHOLE message into the database... Can you tell me what command or function to grab ALL of the STDIN? I tried using "gets(message)", but came up with Segmentation errors, and tried to debug it.. but i'm just coming up with a deadend..

-Corey