Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Setting up Linux IMAP with MySQL

Posted on 2012-03-18
7
Medium Priority
?
417 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Fine Tune your automatic Updates for Ubuntu / Debian
The new Gmail Phishing Scam going around is surprising even the savviest of users with its sophisticated techniques.
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…
In this video we show how to create a mailbox database 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 Servers >> Data…
Suggested Courses

636 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