Title: Re: Date sent?
On or near 7/22/04 6:59 PM, Jim Colgate at [EMAIL PROTECTED] observed:

> So I guess that assuming the
> internet is moving at near real time, then the time received by your mail
> server would be the most meaningful in terms of sorting mail. Of course that
> depends on the server ensuring that its clock is accurate.

At this point, the script Barry posted recently becomes quite relevant. It adjusts the Received time field in Entourage to be that of the most recent Received header for the message, which would be your mail server, instead of the time you downloaded the message. One could set up a rule that runs on all incoming messages and runs this script, then allows subsequent rules (which can't be done in Entourage 2001 or X, I believe, only in 2004).

Barry's script:

-- Correct the date v1.0 25th June 2002
-- (Modified 22/7/2004 to set Time Received to First Received Header date)
-- a script for Microsoft Entourage by Barry Wainwright
-- Resets the date of messages to the date of the first received header
-- useful for messages with badly formatted (or just plain wrong) dates

tell application "Microsoft Entourage"
    set theMessages to current messages
    if theMessages is {} then
        display dialog "No messages selected!" buttons {"Stop"} default button 1 with icon stop
        return -99
    end if
    repeat with theMess in theMessages
        set theHeaders to the headers of theMess
        set AppleScript's text item delimiters to {return & space}
        set theHeaders to text items of theHeaders
        set AppleScript's text item delimiters to {space}
        set theHeaders to theHeaders as string
        set AppleScript's text item delimiters to {return & tab}
        set theHeaders to text items of theHeaders
        set AppleScript's text item delimiters to {space}
        set theHeaders to theHeaders as string
        set theHeaders to the paragraphs of theHeaders
        set receivedHeader to ""
        repeat with aHeader in theHeaders
            if aHeader starts with "Received:" then copy contents of aHeader to receivedHeader
            exit repeat
        end repeat
        set AppleScript's text item delimiters to {";"}
        set theDate to (last text item of receivedHeader)
        set time received of theMess to date theDate
    end repeat
end tell

Reply via email to