Is import of mails from Outlook possible ??

Having trouble installing serendipity?
JonasBang
Regular
Posts: 66
Joined: Mon Apr 23, 2007 10:57 pm
Location: Copenhagen, Denmark
Contact:

Is import of mails from Outlook possible ??

Post by JonasBang »

I have been running a kind of blog for almost 10 years now. Very manually. I have a mail list in Outlook, and each day I send out my little 'blog' on mail to the people on the mail list.

Now, I wanna convert to a real blog, and have started a domain for this.

I'm considering to use Serendipity, but, I want my approx. 2000 emails to be imported as individual blog-entries. They should be imported in such a way, so that it looks as if they have been there from the creation date, ie. the original date/time stamp from the email must be used.

Is this at all possible ??

Br,
Jonas
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Is import of mails from Outlook possible ??

Post by garvinhicking »

Hi!

I suppose this is possible. If you were using Thunderbird, I know that it supports to save your emails as Unix "mbox" mailbox files. Those could be parsed and imported into serendipity with a small script.

If Outlook can export mails as parsable plaintext with the original dates, it can be imported without too much work.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Could it be done with the popfetcher plugin? Just email all the entries to the blog account, and in they come?
Judebert
---
Website | Wishlist | PayPal
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi judebert!

That was my first idea, but Jonas said it's important that the original timestamp could be preserved, and I believe when you forward a message or send it again, it gets a new timestamp...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
JonasBang
Regular
Posts: 66
Joined: Mon Apr 23, 2007 10:57 pm
Location: Copenhagen, Denmark
Contact:

Post by JonasBang »

Yes, the original timestamps are very important, the final result must look like all posts have been posted in this blog from day one.

My friend made that script to extract from Outlook, so I can ask him to modify output format.
So, which format would be the best to be able to easily import to Serendipity ?? MySQL, XML, TXT, HTML, other ??

Edit: I can see you wrote 'plaintext' earlier, any rules on the format ?? E.g. how the section the timestamp and the text and the different entries apart ??

Br,
Jonas
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

The easist format would be MySQL, followed by XML. TXT or HTML would be harder formats to distinct subject, entry body and timestamp.

Plaintext could also be imported, but would be more work on the import script.

A format like this would be cool when using XML:

Code: Select all

<entries>
  <entry>
    <subject>Your Mails subject</subject>
    <timestamp>2006-01-01 13:13</timestamp>
    <body>Your mail content.</body>
  </entry>

  <entry>
    <subject>Your Mails subject</subject>
    <timestamp>2006-01-01 13:13</timestamp>
    <body>Your mail content.</body>
  </entry>

  ...
</entries>
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
JonasBang
Regular
Posts: 66
Joined: Mon Apr 23, 2007 10:57 pm
Location: Copenhagen, Denmark
Contact:

Post by JonasBang »

Great thanks, I'll start working on this now :D

/Jonas
JonasBang
Regular
Posts: 66
Joined: Mon Apr 23, 2007 10:57 pm
Location: Copenhagen, Denmark
Contact:

Post by JonasBang »

Found this : http://membled.com/work/apps/outlook_text_to_mbox/

Looks interesting, any comments ??

/Jonas
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Indeed that looks promising. Sadly (or, more: Luckily!) I don't use or have outlook, so I can't help you with that.

Having mails in mbox format is already a step into the right direction, you can then use that text file to convert to XML. However if you get outlook to export mails to CSV, you can already use that as a starting point to convert CSV to XML...

Reggards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
JonasBang
Regular
Posts: 66
Joined: Mon Apr 23, 2007 10:57 pm
Location: Copenhagen, Denmark
Contact:

Post by JonasBang »

So, what you say is, that I should aim to get this converted to XML format, then there is no problem getting it imported into Serendipity ??

/Jonas
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

What I'm trying to say is:

If you can get Outlook to export files to CSV format, that is a much easier starting point to convert to XML.

Once you have CSV, you can write a PHP converter that puts this into the desired XML format quite easily. And once you have the XML format, I can write you an importer for that in a few minutes, yes.

I could also write the importer to use CSV instead of XML directly, but that would be more work for me to do, because CSV is a bit uglier to parse than XML because of its special escaping and special characters.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
JonasBang
Regular
Posts: 66
Joined: Mon Apr 23, 2007 10:57 pm
Location: Copenhagen, Denmark
Contact:

Post by JonasBang »

Great, I'll try to get this into XML format.

I'm struggling with a backup server and some hosting, so if this post is silent for some time it is not because I have dropped the project, I'm just attending other things for a while.

/Jonas
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Sure, no problem. I'll still be around, so just raise a hand when you get through.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
JonasBang
Regular
Posts: 66
Joined: Mon Apr 23, 2007 10:57 pm
Location: Copenhagen, Denmark
Contact:

Post by JonasBang »

garvinhicking wrote:Hi!

A format like this would be cool when using XML:

Code: Select all

<entries>
  <entry>
    <subject>Your Mails subject</subject>
    <timestamp>2006-01-01 13:13</timestamp>
    <body>Your mail content.</body>
  </entry>

  <entry>
    <subject>Your Mails subject</subject>
    <timestamp>2006-01-01 13:13</timestamp>
    <body>Your mail content.</body>
  </entry>

  ...
</entries>
I found out that the Outlook can't export in a format I need - the timestamp is not exported !! wtf !!

Anyway, I have a friend who can make me a script, which dump the whole Outlook folder into xml.

He now need to know the exact format. You have proposed a format, at which I have some questions :

- When I check my xml dump of the entries in my database currently, the timestamp is adjusted with the -7 I have set. How to handle it so that the timestamp remains correct when imported ??

- What about other options which it is possible to set, will those be set when we import the entries into the database, or should they be stated already in the xml file ?? E.g. like Author, Category, Allow comments, etc. They all need to be the same, so is it easier to import it from the xml file, or set them during the process of importing ??

So basically, please state the optimal xml format which I should use in order for you to be able to easily help with importing this into the database.

Br,
Jonas
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
I found out that the Outlook can't export in a format I need - the timestamp is not exported !! wtf !!
Wow. That sucks big time.
Anyway, I have a friend who can make me a script, which dump the whole Outlook folder into xml.
Great!
- When I check my xml dump of the entries in my database currently, the timestamp is adjusted with the -7 I have set. How to handle it so that the timestamp remains correct when imported ??
Just ensure the timestamp of the XML output is in this format:

2006-01-01 13:13 -0700

or

2006-01-01 13:13 GMT

then the importer can try to import the timestamps properly.
- What about other options which it is possible to set, will those be set when we import the entries into the database, or should they be stated already in the xml file ?? E.g. like Author, Category, Allow comments, etc. They all need to be the same, so is it easier to import it from the xml file, or set them during the process of importing ??
All options you want to import must be mentioned in the XML file. If you want to preserver the author, I suggest to indicate that usiing a line like

<from>you@bla.de</from>

Then you need to just make sure that you create a s9y author having that email address, and I can make the importer look up the author name.

The same applies to category. Just put:

<category>CategoryName</category>

and sensure you've created a s9y category with exactly that name, and the importer can do that.

For allow comments etc. I'd suggest to just stick to the defaults of Serendpity. If they should differ, you need to add a XML info statement for each option you want to import.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply