If it's sendmail, have a look at /etc/aliases. In there you can define an email address for which all emails will be redirected to a script. Then write such a script which will read standard input and dump it into your database.
man aliases should tell you everything you need to know. If you want to get to know sendmail intimately there's a good O'Reilly book I believe, and also a sendmail forum on this web site.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.