Ok, so I got tired of recompiling between MySQL and PostgreSQL versions of DBMail. I wrote a loadable module layer today. It's in SVN now, and it's working well for me, but it needs some tweaking.
In dbmodule.c, on line 56, I've hardcoded the path to find the database modules in "pgsql/.libs". This is so that I can run with PostgreSQL libraries right from the dbmail/ build tree. Obviously not the correct path to be giving for an installed version. I'm still working on figuring out how to pass the right path/set of paths to this function at compile time and/or run time. Ideas? And just so there's no mistake, DBMAIL SVN IS TEMPORARILY BROKEN -- if somebody's just skimming this email to get the gist in one line ;-) Aaron