i am new to centos linux

How can i customize the SMTP server in Centos entrprise version 4

I need to trigger the database based on the responses received in the SMTP server
Fetch the response from the SMTP server and insert into the mysql database.
I am using java programming language

how can do it
where i need to start