You can get DBMail either pre-packaged or compile it yourself from source. This page describes the different methods.
There are DBMail Debian packages available. DBMail 2.0.x is in the stable and 2.1.x in the unstable tree. The Debian packages are being maintained by Paul J Stevens.
Depending on which version you need you add the following line to /etc/apt/sources.list:
"deb http://debian.nfgd.net/debian stable main" "deb-src http://debian.nfgd.net/debian stable main"
To get DBMail version 2.1.x on debian stable follow the directions here
* Red Hat Enterprise Linux
There are RHEL rpm packages avaliable. At this moment assembled initial release of 2.2.1 and support libraries. Dbmail 2.2.1 requires gmime >= 2.1.19, libsieve >= 2.1, glib2 >= 2.10. Postgresql section of dbmail spec file wasn't tested.
Packages maintained by Alexey Marushchenko.
Site is russian-only, but here are direct links
dbmail packages - http://marush.com/2007/02/06/dbmail-222-1/
gmime packages (without mono support) - http://marush.com/2006/12/04/paketyi-dlya-dbmail-chast-1-gmime/
libsieve packages - http://marush.com/2006/12/04/paketyi-dlya-dbmail-chast-2-libsieve/
glib2 packages - http://marush.com/2006/12/04/paketyi-dlya-dbmail-chast-3-glib2/
1) Get the sources
Download a source from http://www.dbmail.org/index.php?page=download
2) Run configure & make
Run the configure script. This script uses pg_config or mysql_config (depending on --with-mysql or --with-pgsql) to detect where the libraries and include files for these databases are. e.g. when working with PostgreSQL, this is the configure command: ./configure --with-pgsql After running configure, 'make all' will build the executables. Running 'make install' will install the executables in /usr/local/sbin