Extract and view Outlook contacts attachment sent to Gmail

23,748

Solved! but talk about a circuituous route:

  1. in gmail, show original message
  2. save to disk (contacts-raw.txt)
  3. edit and put From [email protected] 29 Aug 2011 in first line (note absence of :), the date doesn't matter (ref)
  4. copy to linux machine and:
    1. process with formail to make it a proper mbox format (ref1, ref2)
      formail -ds <contacts-raw.txt >> contacts.mbox
    2. use mutt to bounce it to my work address (where I have Outlook 2010), use the b command for bounce (ref):
      mutt -f contacts.mbox
  5. When received in Outlook 2010 double-click on attached distribution list, save as .txt
  6. Replace embedded tabs with commas, rename contacts.csv, and now finally(!) use as originally intended.

Sheesh.


Postcript: I tried every single one of the windows and online applications listed on the Wikipedia page for the TNEF format and not one listed the distribution list buried in winmail.dat. I did find a program called WinDeveloper TNEF View which could at least see the entries, but it fared no better than a binary hexeditor like Frhed, and demanded an email (and 1 hour delay) to get a license key even for the trial.

As best I can determine the original list was sent to using the command "Forward as Outlook Contact" and considering that as I write this there are only 3 search results for that string I'd guess it's an under-utilized feature, and now I know why!

Share:
23,748

Related videos on Youtube

user1696603
Author by

user1696603

Updated on September 18, 2022

Comments

  • user1696603
    user1696603 almost 2 years

    A friend forwarded a contact list to my gmail account from Outlook (2007 or 2010, not sure which). I can see there is an attachment in gmail but when I save it to my local drive it's just a plain text file containing the text This attachment is a MAPI 1.0 embedded message and is not supported by this mail system.

    If I use gmail's "show original message" it contains in part:

    This is a multipart message in MIME format.
    
    ------=_NextPart_000_0016_01CC6656.CE12F030
    Content-Type: text/plain;
        charset="us-ascii"
    Content-Transfer-Encoding: 7bit
    
    ------=_NextPart_000_0016_01CC6656.CE12F030
    Content-Type: application/ms-tnef;
        name="winmail.dat"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment;
        filename="winmail.dat"
    
    eJ8+Ih0VAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAGAAAAElQTS5NaWNy
    b3NvZnQgTWFpbC5Ob3RlADEIAQgABQAEAAAAAAAAAAAAAQkABAACAAAAAAAAAAEDkAYASAgAACgA
    
    --8<---snip---8<--
    
    GUC/9NKH95rABgMA/g8HAAAAAwANNP0/pQ4DAA80/T+lDvAm
    
    ------=_NextPart_000_0016_01CC6656.CE12F030--
    

    How do I

    1. save the attached winmail.dat properly, and
    2. open the winmail.dat and extract the contact list?

    I'm running Windows 7 x64, but have access to an ubuntu linux vmware appliance if needed. I have Outlook 2010, but can't use it to connect directly to gmail as pop3 and imap are blocked by the corporate firewall.

    • user1696603
      user1696603 almost 13 years
      I may have accomplished #1 by dint of a) copying characters between filename="winmail.dat" and the trailing ------=_NextPart (but not including those bits) and pasting to b) webnet77.com/cgi-bin/helpers/base-64.pl, and c) saving the resulting binary file as winmail.dat.
    • user1696603
      user1696603 almost 13 years
      I've gotten partially through #2 by funneling the winmail.dat created above through Winmail Opener and saving the resulting "Untitled Attachment" to disk. I found winmail opener here (techhelp.santovec.us/decode.htm). The ms-tnef section on that page says "If the sender has included any attachments (e.g. pictures, spreadsheets, programs), they will be embedded within the TNEF attachment and not as separate attachments.".
    • user1696603
      user1696603 almost 13 years
      Looking at "Untitled Attachment" in a hex editor (Frhed) I can see that yes the contact list is actually embedded in the file. I found an address of my own (that isn't involved with this transaction), but padded with lots of other characters: [email protected]....‌​.f........+.......n.‌​...T.....
    • user1696603
      user1696603 almost 13 years
      the first bit of natural text in the "Untitled Attachment" is IPM.DistList, a little bit of searching for that confirms that I have an outlook distribution list, SO:what is in IMP.DistList.
  • user1696603
    user1696603 almost 13 years
    Thank you, but I can't use the method described in the guide. It requires the originating user to Export the contacts to file and then send that. What happened in this case is the contacts were emailed directly. I'm trying to work with what I have now rather than ask my friend to go start over from the beginning (she's frustrated enough already).
  • n00b
    n00b almost 13 years
    in any case, it seems that the winmail.dat file is not the atachment you're looking for. i'm updating the answer...
  • user1696603
    user1696603 almost 13 years
    thanks for the additional info. I've since managed to verify the info I need actually is in winmail.dat, though I've not yet managed to extract it in a usable form. (see comments on main Q).