Solved

How to set up a mailserver based on MySQL.

Posted on 2004-08-12
12
838 Views
Last Modified: 2010-04-21
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
Comment
Question by:medions
  • 4
  • 2
  • 2
  • +2
12 Comments
 

Author Comment

by:medions
ID: 11786133
Ups, there has to be Antivirus and SPAM filter intergrated in it...
0
 
LVL 40

Expert Comment

by:jlevie
ID: 11786777
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
 

Author Comment

by:medions
ID: 11786872
Sorry, that's my mistake, I ment that the MySQL DB is going to authenticate against the MySQL DB!
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
LVL 62

Accepted Solution

by:
gheist earned 125 total points
ID: 11787464
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
 

Author Comment

by:medions
ID: 11787556
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
 
LVL 62

Expert Comment

by:gheist
ID: 11790936
"I have allsow tryed to work with it, but I have never installed"
cd /usr/ports/mail/postfix ; make WITH_MYSQL=yes install
0
 
LVL 20

Assisted Solution

by:Gns
Gns earned 125 total points
ID: 11791820
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
 

Author Comment

by:medions
ID: 11793132
Okay, thanks alot, I will try some of this.
Be patent, I will turn back when I have tryed a bit of each...
0
 
LVL 40

Assisted Solution

by:jlevie
jlevie earned 125 total points
ID: 11794045
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
 

Assisted Solution

by:mini-itx
mini-itx earned 125 total points
ID: 11817130
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question