Fixing Outlook 2007 to work with the Wordpress Postie plugin

by Klaus Graefensteiner 2. February 2010 11:03

Introduction

I ran into a problem posting emails to my Wordpress blog http://spamparty.com using the WordPress Postie plugin. Any images that I added to my emails didn’t get posted, but got converted into a file named winmail.dat.

image

Figure 1: Email from Microsoft Outlook 2007 to my Wordpress bog via Postie

The Problem

Pictures that are attached to my emails didn’t get posted, but the email text got converted into a blog post. Here is the Postie output form the admin page. Pay special attention the lines 14 and 18. They are the key to solving this mystery.

This is the postie plugin
time:1265153326
Revision: 160758
Last Changed Date: 2009-09-18 11:29:43 -0400 (Fri, 18 Sep 2009)
Connecting to pop3.mydomain.com:110 (pop3))
Mission complete, message 1 deleted.
memory at start of e-mail processing:19779424
Confirming Access For myemail@mydomain.com
Message Id is :<000d01caa45f$5fd121b0$1f736510$@com>
Email has following attachments:
the id is 56
primary= multipart, secondary = mixed
primary= text, secondary = plain
primary= application, secondary = ms-tnef
wrote to temp file
Array
(
[name] => winmail.dat
[tmp_name] => D:\temp\TMP\posBC91.tmp
[size] => 184751
[error] =>
)
finished postie_handle_upload
Array
(
[error] => File type does not meet security guidelines. Try another.
)
file=
the content is Here is another wisdom provided by a spammer:
Found your position on del.icio.us today and really likable it.. i
bookmarked it and faculty be bet to checkout it out any statesman later.
#img0# 
#img1#
tags: Delicious, Statesman 
the subject is [Misunderstanding][Testing] Resending email makes for a good movie, right after calling GetSubject
Working on Misunderstanding
Working on Testing
Post Author: 1
Date: 2010-02-02 15:28:06
Category: 3
Category: 4
Ping Status: open
Comment Status: open
Subject: [Testing] Resending email makes for a good movie (via postie)
Postname: testing-resending-email-makes-for-a-good-movie
Post Id: 56
Posted content:
________________________________________
Bookmark this category Here is another wisdom provided by a spammer: Found your position on del.icio.us today and really likable it.. i bookmarked it and faculty be bet to checkout it out any statesman late
r. winmail.dat #img1#
________________________________________
Memory used: 21052824
Warning: mail() [function.mail]: SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html. in D:\Hosting\5476879\html\spamparty\wp-content\plugins\postie\postie-functions.php on line 1547
memory at end of e-mail processing:20842296

The Solution

According to several sources on the internet Microsoft Outlook packages email metadata and file attachments as one file called winmail.dat using the MS-TNEF MIME type. In order to avoid this anomaly you need to set the text format to plain text in the editor:

image

Figure 2: Setting the text format Plain Text under Options

Microsoft says that Html would also work, but not in my case. Only Plain Text is working.

References

Here are some links that describe the problem in more detail:
http://support.microsoft.com/kb/290809
http://www.dwheeler.com/essays/microsoft-outlook-tnef.html

I also found an Open Source PHP library that can unpack winmail.dat files.
http://tud.at/php/tnef/

It would be a cool enhancement for Postie to support this Microsoft Outlook anomaly out of the box.

 

Ausblick

Another workaround would be to use Mozilla Thunderbird instead of Outlook. In this case go to the download page:
http://www.mozillamessaging.com/en-US/thunderbird/

Tags: , , , , , ,

Email | Wordpress | PlugIn

About Klaus Graefensteiner

I like the programming of machines.

Add to Google Reader or Homepage

LinkedIn FacebookTwitter View Klaus Graefensteiner's profile on Technorati
Klaus Graefensteiner

Klaus Graefensteiner
works as developer in Test at Rockwell Automation and is founder of the PowerShell Unit Testing Framework PSUnit. More...

Administration

About

Powered by:
BlogEngine.Net
Version: 1.5.0.7

License:
Creative Commons License

Copyright:
© Copyright 2009, Klaus Graefensteiner.

Disclaimer:
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Theme design:
This blog theme was designed and is copyrighted 2009 by Klaus Graefensteiner

Rendertime:
Page rendered at 9/9/2010 7:07:54 PM (PST Pacific Standard Time UTC DST -7)