MailSteward

MailSteward™

Contents:
Links:
Export a Tab or Comma Delimited Text File, a MailSteward Database File, an Mbox File, or an SQL File:

Any list of stored or retrieved email can be exported to a tab or comma delimited text file, or to a new MailSteward database file, or to an "mbox" format file that can then be imported into most email clients, or to an SQL file that can be imported into a MySQL database. Just click on the Export drop-down button and select the desired export format. A tab or comma delimited text file can then be imported into FileMaker or Benton or other database and spreadsheet applications. A MailSteward database file can then be accessed by MailSteward by specifying it in the MailSteward Settings. An mbox file can then be imported back into OS X Mail or Microsoft Entourage or other email clients, or MailSteward itself. An SQL file can be imported into MySQL. If the tab or comma delimited text file option is chosen, attachments and tags are not exported. Only the plain text portion of the email is exported. If the MailSteward database file option or the SQL option is chosen, then everything will be exported, including any attachments and tags and copies of the email raw source. In the case of the mbox format, everything will be exported except for tags. The standard mbox email format does not include the concept of tags.



There are a couple of things to be aware of when exporting an SQL file. In order to import email containing large attachments into MySQL, the MySQL maximum allowed packet size needs to be set large enough to accommodate the attachment blobs. This can be done by adding these lines to the /etc/my.cnf file:

[mysqld]
max_allowed_packet=200M

You can set this size as large as you like. MySQL will only allocate the extra memory when it is needed. The other thing to be aware of is that binary attachments are stored in the original binary format in MailSteward. The SQL generated by MailSteward will also cause the binary attachments to be stored in MySQL as binary blobs. The name chosen for the exported SQL file will be used as the database name.

Here are the SQL statements used to create the MySQL database and the email and attachments and origemail tables:

CREATE DATABASE IF NOT EXISTS [databasename];
USE [databasename];

CREATE TABLE IF NOT EXISTS email (id INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,from_fld VARCHAR(256) NOT NULL,to_fld VARCHAR(256) NOT NULL,subj_fld MEDIUMTEXT NOT NULL,date_fld datetime NOT NULL,mailbox VARCHAR(127) NOT NULL,mailto VARCHAR(127) NOT NULL,body_fld LONGTEXT NOT NULL,numAttach INTEGER NOT NULL DEFAULT 0,attachNames MEDIUMTEXT NOT NULL,attachText MEDIUMTEXT NOT NULL,headings MEDIUMTEXT NOT NULL,INDEX dateIndex (date_fld));

CREATE TABLE IF NOT EXISTS attachments (id INT NOT NULL,type_fld VARCHAR(127) NOT NULL,filename_fld VARCHAR(127) NOT NULL,encode_fld INT default 0,attach_fld LONGBLOB NOT NULL,INDEX idIndex (id));

CREATE TABLE IF NOT EXISTS origemail (id INTEGER PRIMARY KEY,orig_fld LONGBLOB NOT NULL);

CREATE TABLE IF NOT EXISTS tags (id INTEGER PRIMARY KEY,cat_fld VARCHAR(127) NOT NULL,key_fld VARCHAR(127) NOT NULL DEFAULT '',priority_fld INT DEFAULT 0,notes_fld MEDIUMTEXT NOT NULL);


TM & Copyright © 2004-2008 pubblog.com. All rights reserved.