Solved

Setting up Linux IMAP with MySQL

Posted on 2012-03-18
7
368 Views
Last Modified: 2012-03-24
I have a Debian server running Postfix and Courier for IMAP.  Currently, my mail queue is /Maildir.  The problem is that we've added over 50 users to the server (company acquisition) since putting in this machine.  Users are complaining that the machine is slow.  One suggestion from someone was setting up MySQL to hold the email instead of putting the email in /Maildir.  I've been trying to find articles to set this up but it looks like the only articles I find talk about setting up a users table in MySQL, not putting email in the database itself.  I'd prefer to go to Exchange, but the cost of CALs for these users (143 total including the 50) is more money than my company wants to spend.  I'm not worried about the server hardware itself.  That is one powerhorse machine.  So I wanted to see what anyone had suggestion-wise for scaling up this system.
0
Comment
Question by:sedberg1
7 Comments
 
LVL 19

Expert Comment

by:bevhost
ID: 37736124
Eve a modest server should be able to handle many more than 50 Mailboxes,
although, I guess it depends on the size of each mailbox.

I would think that MySQL may make it even slower, but this is just a feeling as I have never tried this.

To switch to MySQL as a storage engine requires changes to the mail reader (IMAP/Courier/Dovecot) and the mail delivery agent (SMTP/Postfix/postdrop)

I would try other IMAP servers before changing mailbox format.

Have you tried Dovecot or Cyrus?

Do some googling to see if you can find some speed comparisons
eg
http://objectmix.com/imap/729546-fastest-imap-server.html
0
 
LVL 19

Expert Comment

by:bevhost
ID: 37736133
Do you have enough RAM?
Can you tweak the IMAP server for more caching?
0
 

Expert Comment

by:ajaydata
ID: 37745568
If you are running on Linux, try vmstat 1 and see whether your IO is becoming bottleneck. Most of th times  its not about number of users , it may b because of email traffic and mail size which causes lots of IO an slows don the system.

You may want to download www.xgen.in , It gives you flexibility to store mails as Normal
 File storage or in database. It also allows you to control the IMAP service user wise and alo allows you to create separate table for each user for mail storage.

Hope it helps.
0
Do email signature updates give you a headache?

Do you feel like all of your time is spent managing email signatures? Too busy to visit every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

 

Author Comment

by:sedberg1
ID: 37755267
I can't use Xgen.  It costs money.  I don't have a budget for this.

Could someone give me pointers or a link to site on how to get done what I'm trying to do?  Does anyone know how to set up MySQL as a the database engine to store emails?
0
 
LVL 19

Accepted Solution

by:
bevhost earned 500 total points
ID: 37755627
http://www.dbmail.org/
DBMail is an open-source project that enables storage of mail messages in a relational database.
Currently MySQL, PostgreSQL, Oracle, and SQLite can be used as storage backends.
Commercial development and support is also available.


Scalability
Dbmail is as scalable as the database system used for storage.
Manageability
Dbmail can be managed by updating the relational database or directory service - without shell access.
Speed
Dbmail uses very efficient, database specific queries for retrieving mail information.
Security
Dbmail doesn't require filesystem access. It's as secure as the database and directory server used.
Flexibility.
Changes in a Dbmail system (adding of users, changing passwords etc.) are effective immediately. Users can be stored in the database, or managed separately in an LDAP server such as OpenLDAP or Active Directory.


DBMail is made up of several components. A normal MTA (Postfix, SendMail, QMail, Exim) is used for accepting messages. The MTA hands the messages over to dbmail-deliver, using a pipe interface, or to dbmail-lmtpd, using LMTP (Local Mail Transport Protocol).

These programs take care of injecting the message into the database. Messages can be retreived from the database using dbmail-pop3d, using the POP3 protocol, or dbmail-imapd, using the IMAP4Rev1 protocol.

Emails are stored in the database. This includes attachments. User information is also stored in the database, so users do not need a system account on machines DBMail is running on.
0
 
LVL 3

Expert Comment

by:rickygm
ID: 37759379
Hi ,  in linux never I have seen a mail server that keeps mailboxes in a db, I believe that serious very unstable one, if you have users who have a high volume of email in their mailbox , the best thing is than it handles your file system to it

dovecot + Maildir is good for high volume of emails , and and an amount of ram memory can be your help ...

check about this

http://wiki.dovecot.org/MailboxFormat/Maildir
0
 
LVL 19

Expert Comment

by:bevhost
ID: 37759568
I think you are asking the wrong question here.
You should be asking why your imap / maildir is perfomrinc so badly rather than trying to use SQL as a storage engine.  Chances are that it won't solve your problem.
0

Featured Post

Integrate social media with email signatures

Is your company active on social media? Do you also use email signatures? Including social media icons in your email signature is a great way to get fans for free. Let all your email users know you’re on social media quickly and easily, in a single click.

Join & Write a Comment

Suggested Solutions

Microsoft has released various new features which are capable of handling various tasks. One of these tasks is ‘Migration from pop3 to Exchange Server’. Pop3 data stores various data along mailboxes like contacts, tasks, etc. So, it becomes the need…
New-MailboxSearch Powershell Command and step by step approach to Search and Extract Emails form Exchange 2013 Journaling server.
In this video we show how to create a Shared Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Sha…
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…

758 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

19 Experts available now in Live!

Get 1:1 Help Now