Koozali.org: home of the SME Server

Export IMAP mail to MySQL database

moleboy

Export IMAP mail to MySQL database
« on: May 05, 2005, 05:48:49 AM »
I need to get a copy of historical emails from SME 6.01 mail server into a MySQL database and wondered if anyone has done this before, or has any ideas about how best to do it?

Also, am I correct in thinking that the default mail server cannot be configured to use a database to store messages as opposed to Maildir files?

Any help greatly apreciated.
Cheers.

PS. I tried the PHP script at http://www.xeoman.de/code/php/xeoport/index.php but the mail server wouldn't let the PHP script connect. I'm pretty sure it was due to certification issues, but even disabling the "HTTPS required" option in the webmail tab of the server-manager didn't work.

moleboy

IMAP to MySQL revisited
« Reply #1 on: May 18, 2005, 08:09:56 PM »
After working on an IMAP issue not related to this one, I now realise that you have to connect to the mail server in such a way that the TLS/SSL certificate is not validated.

For IMAP you use the optional flag 'novalidate-cert' when using imap_open.

For the above Xeoport script, change line 13 of config.inc to read:

Code: [Select]
$mail_protocol = 'imap/notls/readonly/novalidate-cert'; /* $mail_protocol = 'pop:110'; */

Hope this helps someone in the future...[/quote]

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Export IMAP mail to MySQL database
« Reply #2 on: May 18, 2005, 09:11:50 PM »
moleboy,
What was the reason you needed to export into a database? Were you importing/exporting setting from/to a different system, or just improving the application?

Regards,

moleboy

Export IMAP mail to MySQL database
« Reply #3 on: May 30, 2005, 09:14:50 PM »
Quote from: "stuntshell"
What was the reason you needed to export into a database?


We have an IMAP folder with about 7000 messages in it that several of us have to search on a regular basis. Whilst IMAP is a wonderful thing, searching through a large amount of messages was taking a long time.

We now use Xeoport to automatically import messages from the IMAP store into a MySQL database and use a PHP script to search that instead. It's an order of magnitude quicker to find the stuff we need now  :-)

The other advantage is that if the message is for technical support or something similar, we use the PHP app. to write a reply which is sent by email, and the message and reply are also automatically made available on the web via an appropriately configured i-Bay for future reference.

Hope this answers your question!