Brent Baisley <[EMAIL PROTECTED]> wrote on 02/10/2005 12:21:38 PM: > I am looking to store all incoming emails into a MySQL database. I've > looked into dbmail, but can't get it to compile under Mac OSX (I posted > a message on that list). I was wondering if anyone could point me in > another direction to use MySQL as an email message store. I don't need > a webmail interface, just a way of getting messages from a mail server > to a MySQL database. Preferably as a direct transfer, but it could be a > script that runs periodically. > Currently it seems the best path is using Perl, but I would think this > has been done before, just can't find it on google. > > Thanks > -- > Brent Baisley > Systems Architect > Landover Associates, Inc. > Search & Advisory Services for Advanced Technology Environments > p: 212.759.6400/800.759.0577 > > > --
How to do what you ask depends on how I read your question. When you say "store incoming emails" does that mean that you are writing an SMTP server that will act as a mail destination or are you retrieving mail from an SMTP server via POP3 or IMAP or some other mail retrieval protocol? In either case your code ends up writing the contents of the message to a MySQL database rather than to a local file. What you need to decide is how many pieces you want to break the message into (how much metadata you want to extract from each message). Your database structure will depend on your information needs and how you intend to use the emails once you store them however I can almost guarantee that the body of each message will need to be stored in a TEXT field. You will probably run out of room faster by storing whole messages in your database than if you were storing them as files on the hard drive. Capacity control is definitely something you want to consider in your project design. You may want to store the messages (or parts of them) as files and keep just the metadata in the database, but again that goes to your intended purpose for this project. Shawn Green Database Administrator Unimin Corporation - Spruce Pine