Importing Yahoo Mail into Gmail With Original Dates

With Yahoo being sold off in chunks to Verizon, I finally decided it was time to migrate my decade worth of Yahoo email over to Gmail.

Although Gmail offers an easy “Import mail and contacts” link from the “Settings > Accounts and Import” tab, this is not what you want to do (this is what I tried first). All your email will transfer over, but it won’t have the proper sender email address or date.