Sent Items From iPad or iPhone are Shown Garbled if View in Entourage

Sent Items From iPad or iPhone are Shown Garbled if View in Entourage

Issue: Sent items from iPad or iPhone are shown garbled if view in entourage

Affects: iPad and 4G iPhone; entourage 2004 and 2008 on exchange 2003

Solutions to the issue:

Exchange users with new iPhones are re-discovering an old bug where messages sent through ActiveSync for mobile devices do not appear properly in both Entourage 2004 and Entourage 2008. The messages sometimes look like a mix of HTML, E-mail headers and what is left of the original message or they look like an unintelligible jumble of letters and numbers. The recipient and the subject are also empty.

ActiveSync is munging the headers of the mail messages. Notice in the above screenshot that the mail message includes X-MimeOLE, Received, MIME-Version and other lines of information you normally wouldn’t see. These are the headers, or the envelope of your mail message. They are suppose to be in a specific format so that mail applications can translate them and make the message presentable but ActiveSync is doing something to the message you send. The headers are now appearing in the body of the message, which is not normal.

Why isn’t Outlook for Windows susceptible to this problem? Most likely it has simply been programmed to realize these two headers are bogus and to continue reading the rest of the headers properly.

The best solution is to run a script on the sent folder that will clean up the messages.

  1. open the apple script application and copy the following code. Save the script as Fixed_Sent_Items

http://files.macscripter.net/ScriptBuilders/Entourage/fix%20iphone%20sent%20mail.scpt.zip

”tell application “Microsoft Entourage”
set theProcessedItemsCounter to 0
set theFaildItemsCounter to 0
set theExchangeAccount to item 1 of every Exchange account
set theSentbox to sent items folder of theExchangeAccount
set theSentMessages to current messages
set tmpfolderpath to (path to temporary items folder from user domain) as Unicode text

repeat with theMessage in theSentMessages
set theSource to source of theMessage

set theheader to headers of theMessage
if theheader contains “Subject” then
–return — do not continue if this is a properly formatted message
else
try
set sourceMacPath to (tmpfolderpath & “entourage-message-” &
theProcessedItemsCounter)
set sourcePosixPath to POSIX path of sourceMacPath
set fd to open for access sourceMacPath with write permission
set eof of fd to 0
write theSource to fd
close access fd

— translate mac to unix line endings
set targetPosixPath to (sourcePosixPath & “.unix”)
do shell script “tr ‘\\r’ ‘\\n’ < ” & sourcePosixPath & ” > ” & targetPosixPath

— get rid of the malformed headers
set fixedMessagePath to (sourcePosixPath & “.fixed”)
do shell script “sed -e ‘1,/^$/d’ ” & targetPosixPath & ” > ” & fixedMessagePath

— read in the corrected message
tell application “Finder”
set fd to POSIX file fixedMessagePath as alias
set newSource to (read fd)
end tell
set theEntourageMessage to make new outgoing message with properties {source:newSource}
move theEntourageMessage to theSentbox
set properties of theEntourageMessage to {color:{0, 0, 0}, priority:normal, read status:read, delivery status:sent, replied to:false, redirected:false, forwarded:false, connection action:keep on server, flagged:false}

— clean up
do shell script “rm ” & sourcePosixPath
do shell script “rm ” & targetPosixPath
do shell script “rm ” & fixedMessagePath
delete theMessage

set theProcessedItemsCounter to theProcessedItemsCounter + 1

on error
set theFaildItemsCounter to theFaildItemsCounter + 1
end try

end if
end repeat

— give feedback
if the theFaildItemsCounter > 0 then
set theText to theFaildItemsCounter & ” messages failed to process”
as text
display dialog theText buttons {“OK”} default button “OK”
end if
end tell ”

  1. Copy that script file in Documents/Microsoft User Data/Entourage Script Menu Items

  1. Open entourage and create a rule for your exchange (Tools; Rules; mail (Exchange))
  2. Name if Fixed_Sent_Items and use the following criteria:

If

Folder is “Sent Items”

Specific Header > Subject > Does not exist

Then

Run AppleScript “Fix_Sent_Items”

  1. Make sure to enable it

now all the emails going to the sent items will be checked and update if needed.

If you want to run the rules on the current sent items, click right on the sent items folder and select rules. Click on the Fix_Sent_Items rule to update your sent folder

mm
Steve Boullianne, Multiple post-graduate degrees, Mind/Body/Spirit enthusiast, & a member of Mensa. Loves Skiing, Scuba, and Food. Steve’s First job out of college was programming satellites for AT&T. Founded IPSOFACTO in 1996, Y2K boom, e-Commerce super success, 2.1 boom. Steve is ready to Mediate high quality for all life, our one planet, and human kindness. Loves to dance and tell jokes. Steve believes that Excellent Communication is key to human success (and failure). Steve has 3 sons who are his STARS. They will carry the world into a brilliant future. Since 1996, Steve has been a volunteer drug and alcoholism counselor in the Bay Area. The power of the Great Spirit is in you. Steve is a good friend to have.