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, High school drop-out. College drop-out. A go-go dancer in Amsterdam. LOVED computers, programmed satellites for AT&T. Founded IPSOFACTO in 1996, Y2K boom, Dot-Com boom, 2.0 boom. Likes his smallish company and human relationships; not into big anonymous IT. Loves to tell jokes. Loves and Hates technology; pick up the phone, ok? Thinks on line hook up sites have saved the world from AIDS and DateRape. Thinks his kids are better collaborators and world leaders thanks to video games. Is still a hip-hop dancer; is NOT a Brony. Loves San Francisco; Hates the homeless crisis. Tells young people to buy real estate, as soon as possible. Don’t rent. Hopes his final years are spent handing out blankets, food, clothes, and medical supplies.