[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Setting up Linux IMAP with MySQL

Posted on 2012-03-18
7
Medium Priority
?
421 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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 

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

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.

Question has a verified solution.

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

Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Stellar Exchange Toolkit: this 5 in 1 toolkit comes loaded with mega-software tool. Here’s an introduction to tools’ usage and advantages:
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses
Course of the Month18 days, 11 hours left to enroll

834 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