• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 853
  • Last Modified:

How to set up a mailserver based on MySQL.

Hi there,

I want to set up a mailserver witch is based on a MySQL database.
Here is what the requirements is for the mailserver:

Catch All functionallity
Forward functionallity
Alias functionallity

And if possible, would it be greate to have a administration interface with it.

What will you perfer, and how do I install it?
0
medions
Asked:
medions
  • 4
  • 2
  • 2
  • +2
4 Solutions
 
medionsAuthor Commented:
Ups, there has to be Antivirus and SPAM filter intergrated in it...
0
 
jlevieCommented:
Do you mean that the mail server will authenticate against a MySQL DB or that the MySQL DB will be the mail store? The first is possible, when using the right IMAP/POP server, but I know of no mail servers that will store messages in a MySQL DB.
0
 
medionsAuthor Commented:
Sorry, that's my mistake, I ment that the MySQL DB is going to authenticate against the MySQL DB!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
gheistCommented:
I hope you meant that mailserver is going to authenticate against config tables found on MySQL server

Do you have userbase found already in some form - like Actibe Directory, Windows PDC, some passwd file or something like that???
Anyaway - exim or postfix and be set to use MySQL database as source for config files
You need some huge storage for user mailboxes
And some kind of mailbox server (courier, dovecot or cyrus will do for both POP3 and IMAP4) that points to same mailbox storage using same format andauthenticates against same MySQL database.
I'd suggest using (Open)LDAP for user database instead os MySQL, since it will serve as address book for your users (there are no limitations of MySQL usage, and LDAP may be a bit harder to manage when you are good at SQL)

For antivirus - there is free ClamAV and Amavis as wrapper for commercial scanners
For spam protection - there is spamassassin

I use exim and postfix for SMTP and dovecot and courier for imap.
About installation - sure you can find package for your system (what is it - please post uname -a or at least give idea of what would it be)
0
 
medionsAuthor Commented:
Hi gheist,

Right now I'm on low bound...
I have heard a lot about PostFix, and I have allsow tryed to work with it, but I have never installed it. EXIM sounds exciting, what can that do that PostFix can't, and what can PostFix do that EXIM can't do?

It has to work on a MySQL so LDAP is not on speak.

What I'm asking for is a 100% guide to how I install it on my FreeBSD 5.1.
0
 
gheistCommented:
"I have allsow tryed to work with it, but I have never installed"
cd /usr/ports/mail/postfix ; make WITH_MYSQL=yes install
0
 
GnsCommented:
Another popular spam/virus scanning system is MailScanner (http://www.mailscanner.info) with MailWatch for admin interface (http://mailwatch.sourceforge.net/)... This relies on MailScanner logging to a MySQL database... So then you'd get to use your database for both logging and authentication:-).
MailScanner can do "archiving" of all mails that pass through it in a very nice way. There's a lot of info on how to install and configure on the mailscanner page... perhaps look at http://www.sng.ecs.soton.ac.uk/mailscanner/install/postfix.shtml as an example? (I run this with Postfix, though a slightly older variant with dual MTAs, not using the HOLD feature... Still very sweet;).

-- Glenn
0
 
medionsAuthor Commented:
Okay, thanks alot, I will try some of this.
Be patent, I will turn back when I have tryed a bit of each...
0
 
jlevieCommented:
If the goal is to use MySQL for authentication you probably also want to use an IMAP/POP client that doesn't require Unix accounts, such as Cyrus. Cyrus, like Sendmail & Postfix, use SASL for authentication and it is possible to set up a SASL plugin that uses an RDB (like MySQL) as the backend data source. I've not set one of these up,  mostly because going to an RDB is too much of a performance hit as compared to using a Berkeley DB for the backend (which is a native SASL method).

I'm curious as to why you'd want to go this way. There are other ways of managing a mail server that don't introduce so much added complexity.
0
 
mini-itxCommented:
I've installed several times exactly what you are looking for. I would highly recommend postfix with postfixadmin (postfixadmin is a web gui). This is all php/mysql driven. Very powerful. Supports multiple domains.

Basically you can do it with this by installing in this order:
  -apache13 from ports
  -mysql40-server from ports
  -mod_php4 from ports (with mysql and imap options)
  -postfixadmin from source (so you can get the SQL table definitions)
  -postfix from ports (select mysql from install menu)
  -courier-imap from ports (pass it the WITH_MYSQL=yes flag)
 
Excellent how to guide at  http://www.high5.net/howto/  on how to install postfixadmin with mysql table definitions.

You will love it! It is very powerful and works great. Being that postfixadmin is PHP driven, you can easily configure anything you want. The fields are very obvious on the tables. It is awesome.

Enjoy.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 4
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now