Import .PST to Gmail (unknown sender) Problem

There is no easy solution to this problem currently, but there is a solution:  build your own Exchange server.

If you’ve found your way here, you probably understand the problem:  when trying to import an Outlook .PST file into gmail, instead of the original sender, “unknown sender” shows up in its place.  There are a few kludge solutions to this problem.  One article I read suggested building a Windows Server infrastructure complete with your own Exchange server as a work around.  Thanks to fast SSD’s, my patience was up to the task, but hopefully yours will not be quite as tested as mine was.

We’ll build two VM’s:  one running Windows 7 with Outlook 2010, and a second running Windows Server 2008 R2 SP1, which will serve as a DC and the Exchange box.

Exchange has changed a bit since I last used it professionally, and it is not plug and play.  Here are some tips to get you up and running quicker than I was.

Building the Exchange Server/DC

1.  If you’re using a cloned install, run SYSPREP before cloning.  Usually, you can get away with cloned machines and duplicate SID’s.  No so with Exchange.  If you don’t, here’s what you can expect when you try to launch the Exchange management console.  Not fun.

Unexpected error [0x145AAC30] executing command ‘Get-LinkedRoleGroupForLogonUser’

2.  Use the Enterprise edition of Windows Server 2008 R2 SP1.  The Standard edition won’t work.

3.  Stick with Windows Server 2008 R2 SP1 for now.  I tried the Windows 2012 RC released a couple of days ago, and it was flaky on VirtualBox.

4.  The easiest way to go is to just install Exchange and DC functionality on the same box.  There were problems getting the Exchange Management Console to start when I tried separate server installs.  This is a single-purpose install, not a production infrastructure.

5.  After you make your server a domain controller, perform Windows Update through to completion.

6.  Install the Application Server role, along with several prerequisite IIS7 roles, and the Microsoft Office 2010 Filter Packs.

Shortcut:  Paste this into PowerShell (for a Typical Exchange install — others have different requirements):


Import-Module ServerManager


Add-WindowsFeature NET-Framework,RSAT-ADDS,Web-Server,Web-Basic-Auth,Web-Windows-Auth,Web-Metabase,Web-Net-Ext,Web-Lgcy-Mgmt-Console,WAS-Process-Model,RSAT-Web-Server,Web-ISAPI-Ext,Web-Digest-Auth,Web-Dyn-Compression,NET-HTTP-Activation,Web-Asp-Net,Web-Client-Auth,Web-Dir-Browsing,Web-Http-Errors,Web-Http-Logging,Web-Http-Redirect,Web-Http-Tracing,Web-ISAPI-Filter,Web-Request-Monitor,Web-Static-Content,Web-WMI,RPC-Over-HTTP-Proxy -Restart

7.  Now, install Exchange 2010 SP2 with a Typical install.  If you do receive any error messages, read them carefully and don’t give up.

8.  Once Exchange is installed and you’ve rebooted, create a new user, and create a new mailbox for that user.

9.  Verify IMAP4 is enabled for the user in user Properties.

10.  Enable Basic authentication for IMAP4, then restart the Microsoft Exchange Server IMAP4 service using services.msc.

Congratulations.  You’ve configured the exchange server on your DC.  Now… on to the Outlook box.

Configuring Outlook

The basic idea is to use Outlook to attach to your Exchange server and copy all of your desired .PST email archives to your new mailbox.  Then, delete Outlook’s default Exchange connection in Control Panel and replace it with an IMAP connection to the Exchange server instead.  Add another IMAP connection to gmail.

Once that’s done, you can use Outlook to move the mail from your Exchange mailbox to gmail, and the “unknown sender” problem will be gone.  Here’s how I did it:

1.  Add the FQDN of the domain controller to the local HOSTS file on the Outlook box.

2.  Through Control Panel, add an Exchange connection for the account you created on the DC/Exchange box.

3.  Make an IMAP connection for your gmail account.  Use SSL for the IMAP connection and Auto for SMTP.  Here are the current gmail required settings according to Google:

Incoming Mail (IMAP) Server – requires SSL: imap.gmail.com
Use SSL: Yes
Port: 993
Outgoing Mail (SMTP) Server – requires TLS: smtp.gmail.com (use authentication)
Use Authentication: Yes
Use STARTTLS: Yes (some clients call this SSL)
Port: 465 or 587
Account Name: your full email address (including @gmail.com) Google Apps users, please enter username@your_domain.com
Email Address: your full Gmail email address (username@gmail.com) Google Apps users, please enter username@your_domain.com
Password: your Gmail password

4.  Once you have both accounts configured, you’re in business.  Copy your mail from the .PST to the Exchange mailbox in Outlook.

5.  Then, exit Outlook and remove the Exchange account connection in Control Panel.

6  Add an IMAP connection for the same Exchange account instead.  It will look something like this:

7.  Launch Outlook, and copy your mail from your exchange mailbox to the gmail folder of your choice.

8.  Verify your gmail folder, and congratulate yourself for an heroic solution to a simple problem that would make Rube Goldberg proud.

Fun?  It was kind of a PITA for me — but maybe if I had this guide to start with, it would have been ALMOST fun.  Let me know if you get it to work.

Related:  Russinovich on the Sysprep Myth.  Original work on this problem with Exchange 2003.  Another project for addressing this problem.

10 thoughts on “Import .PST to Gmail (unknown sender) Problem

  1. Alex,
    Everythnig seem to be ok except the exchange connection I make the very first time (“Exchange connection for the account you created on the DC/Exchange box”) seems to be IMAP/POP3 so bascially I am still not able to make it work. What a royal PITA.

  2. I think an even easier solution is to use trial version of office 365 and/or exc hange online ($4 a month). Saves the hassle of VM and configuration. Still a rather annoying solution to a problem google should have addressed a long time ago.

  3. blog.joelj.org listed a similar workaround, pasting the same comment here:

    Hi there,

    Is it correct that this workaround is obsolete nowadays?
    I faced the two common gmail import issues (date stamps of import, not receival, and this nasty ‘unknown sender’ thing), and just tested a small set of those problematic mails in the following way:

    Outlook 2007: move mails from PST files to a subfolder of local folders, detach pst.
    (attached gmail account and copied them, to confirm the problem, indeed: messy dates and empty from fields @ gmail)

    Then, i installed Thunderbird (fresh install), and simply had it import mail data from outlook. After that, i already saw the correct headers in TB, and managed to upload them to gmail just fine.

    Next quest(ion): how will this trick hold when moving 8Gb of mail between Outlook and TBird 🙂

    Am i oversimplifying things (testing eight mails, not eight gb of mails), or missing obvious caveats? Let me know 🙂

  4. Did the Thunderbird process end up working? For 8GB of mail I’d recommend uploading in batches, but it seems like a good solution!

  5. Hi, completely forgot to circle back here. It worked for incoming and most sent mail. Oddly, some sent items were not ok. Think this had to do with infrastructure changes at my former employer (where the 8gb of mail accumulated over the years), as the erroneous mails (messed up sender/recipient fields) all appeared in certain datespans…

    For people willing to give this route a try; small batches on the route from outlook to thunderbird (limited it to 500mb at a time myself), as TB sometimes just fails without any hint of progress or cause.

    On the road from TB to Gmail: the copy or move process will simply fail and halt as soon as it encounters an email that is too large for Gmail. If possible, filter those out first.

    For myself, this 95% success is not enough. Will try the exchange method some day, although i’m kind of reluctant to set that all up ( no experience there)… Still hoping to run into someone who just happens to have an exchange server XD

  6. I was able to resolve the “unknown sender” issue using the pre-configured VHD of Exchange Server 2007 SP1 (evaluation version) and Virtual PC 2007 (free).

    MS Virtual PC 2007 SP1
    http://www.microsoft.com/en-us/download/details.aspx?id=24439

    MS Exchange Server 2007 SP1 VHD
    http://www.microsoft.com/en-us/download/details.aspx?id=14901

    Besides using Microsoft Outlook 2007 to move emails from PST to an Exchange mailbox (will mirror in IMAP4 mailbox), I also found it helpful to use Thunderbird to move emails from the IMAP4 mailbox to Gmail.

    Below is the short-hand detail, with many thanks to the posts and references that others provided along the way:

    Host PC Desktop -> Start -> Control Panel -> Network Connections -> Properties -> Install -> Virtual Machine Network Services
    Virtual PC -> Edit -> Settings -> Networking Settings -> Adapter 1 -> Select the desktop network connection that you just updated
    Virtual PC -> Edit -> Settings -> Shared Folders -> to copy any data or installation files on your host desktop
    Virtual PC Desktop -> Start -> Control Panel -> Network Connections -> Properties -> TCP/IP -> Obtain IP + Obtain DNS

    Exchange Management Console -> Organization Configuration -> Hub Transport -> New Accepted Domain
    Exchange Management Console -> Organization Configuration -> Hub Transport -> E-mail Address Policies -> Edit -> Add -> Select accepted domain + Set as Reply
    Exchange Management Console -> Organization Configuration -> Hub Transport -> Accepted Domains -> + Set as default

    Exchange Management Console -> Server Configuration > Client Access > POP3 and IMAP4 -> Authentication -> Plain text logon

    Administrative Tools -> Domain Controller Security Policy -> Account Policies -> Password Policy -> Set preferred requirements (Ex. Disable complexity)
    Administrative Tools -> Domain Security Policy -> Account Policies -> Password Policy -> Set preferred requirements (Ex. Disable complexity)
    Administrative Tools -> Services -> Microsoft Exchange IMAP4 -> Start + Automatic

    Exchange Management Console -> Recipient Configuration -> Mailbox -> New Mailbox -> User Mailbox -> Create mailbox for new user + Select mailbox database

    Exchange Management Console -> Organization Configuration -> Add Exchange Administrator -> Select user + Exchange Organization Administrator role

    Install Outlook on virtual hard drive (not recommended in general but works for transfer to Gmail)
    Copy PST file to virtual hard drive

    Add Exchange account (Uncheck cached Exchange mode)
    Add PST file

    Add IMAP4 account to connect to your Exchange mailbox through IMAP (see account details below)
    Add Gmail account

    user@LITWAREINC.COM
    LITWAREINC/user
    IMAP: EX07SP1.LITWAREINC.COM:993 (SSL)
    SMTP: EX07SP1.LITWAREINC.COM:587 (STARTTLS)
    Test Account Settings -> Should log onto incoming mail server but may not successfully send test e-mail message (not necessary for transfer)

    Copy from PST to Exchange mailbox (will mirror in IMAP4 mailbox)
    Copy from IMAP4 mailbox to Gmail mailbox (I tested this successfully with Outlook but used Thunderbird for the mass transfer)

    Note: My trial version expired (incorrectly) and would sometimes restart. Occassionally, I had to restart Microsoft Exchange services.
    Administrative Tools -> Services -> Microsoft Exchange Active Directory Topology Service -> Restart
    Administrative Tools -> Services -> Microsoft Exchange Information Store -> Restart

Comment