Database based mail server

I wasn't sure where to post this so I chose the General forum. I'm looking to replace an Exchange server with an open source solution. It should use a database (preferably MySQL) to store its mail. It'll need some sort of antivirus solution for the SMTP protocol as well as the ability to scan the database for viruses (hopefully in real time) and a spam filter. In addition, it will have to have a web-based mail interface (PHP?) and I'd prefer not to have to write one myself. Does such a solution exist or am I dreaming?

Thanks! :)

If you want a groupware server to replace Exchange, with shared e-mail, shared contacts, shared calendars, etc, then have a look at Zimbra. There's an open-source version that uses custom code to glue together Postfix, Amavisd-new, ClamAV, SpamAssassin, Cyrus IMAP, OpenLDAP, MySQL, and a custom AJAX web interface. It's really quite slick, and scalable.

Of all the ones we've tried (Merak, OpenXchange, Scalix, FirstClass, Kolab, and a few others), it's the best combination of easy-of-use, ease-of-administration, features, and compatibility. It's also one of the few that uses all open standards for accessing the data (SMTP, IMAP, SOAP, REST, LDAP, CalDAV, WebDAV, iCal, HTTP, and so on).

There's also a very easy upgrade path to their Network Edition, which includes over-the-air sync for blackberries and activesync clients, and a connector for full outlook compat (makes the zimbra server look like an exchange server).

The only downside is that they don't officially support FreeBSD.
A ... long ... time ago I implemented my mail system on dbmail, with a Postfix front end.

Also a ... long ... time ago I moved to something more conventional based on maildir, postfix etc. To be honest I can't recall why we moved off of it, other than it was something of a technology reach at the time and I wanted something a little bit more mainstream to maintain.

I see the project is still alive and active so perhaps it is worth a shot. Looks like they never did write a client for it, instead relying on IMAP or pop3 clients.

Truth be told I keep musing about writing a web based MUA in Python but somehow other priorities keep showing up and we still run Squirrelmail.
I believe we had this issue on on at one point. I'm not sure if it's the same phoenix that was a mod there. They didn't let me use my nickname there so I had to choose something else.
I'm the phoenix on the following forums: dualboot (member), daemonforums (admin), bsdforums (mod), freebsd forums (mod), bsdnexus (member), osnews (member).

When that nick isn't available, I also go by phoenix_rizzen (slashdot). That's the problem with using such a great nick ... sometimes it's already taken (like on the zimbra forums).

Back to the main topic: have you looked into any of the suggestions yet? Or are you still wanting more suggestions?
I'm really liking dbmail so far. I have it working with postfix. I'm using imapsync to pull some mailboxes from Exchange to it now for testing.
I found dbmail to be cool enough; at the time I built a mini "ISP" solution using it. Certainly it was easy enough to code up a solution when most or all of the moving parts are in a database.

It was a proof of concept which we never scaled big. If indeed it does grow big, you'll have to think seriously about backup.

In the end I preferred the flexibility that a good-ol-file system gives so the dbmail-backed solution got shelved.
When you think of the fact zfs supports a petabyte filesystem, I don't think it makes any sense to go with dbmail. Also, keep in mind, exchange drop-ins are quirky - even the good ones (Zimbra, Kerio) Users are used to the whole shared calendaring/contacts thing; if you can train them to use other resources like a shared addressbook in csv format that Thunderbird/Outlook can pick up for example and a calendar like on a network share or something, you can save yourself a lot of administrative overhead and hassle. My most recent MTA was just postfix, dovecot, mysql, and amavis.