Solved

How to set up a mailserver based on MySQL.

Posted on 2004-08-12
12
828 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
 
LVL 61

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 61

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now