0

I have used Google Takeout to export a specific folder/label of my Gmail into a .mbox file. Now, I need to convert it to a .pst format to import it into Microsoft Outlook.

Given the confidential nature of the information, I prefer not to use proprietary freemium software or online services for the conversion. I'm specifically looking for Free, libre, and Open-Source Software (FLOSS) to install on my Windows OS to perform this task.

Alternatively, I'm open to writing a script (preferably in Python or PowerShell) to achieve the conversion (I have tried pypff and Gmail's Python API so far to no avail). One approach could be to use an email client like Mozilla Thunderbird to process the .mbox file and export the emails in a format that Outlook can import (e.g., here).

The primary goal is to import the filtered set of emails from Gmail (e.g., the .mbox file) into MS Outlook. I would greatly appreciate any suggestions on FLOSS tools or script-based solutions.

1 Answer 1

2

IMAP can be used as the universal exchange protocol:

  1. Install Linux (WSL will do).
  2. Install the Dovecot IMAP server on Linux. (Postfix or other SMTP server is not needed.)
  3. Copy your mbox file to /var/spool/mail/myuser. (Dovecot's default is to use Linux system user accounts; it'll expect the mail file to be owned by 'myuser' as well.)
  4. Configure Outlook to connect to the IMAP server, using your Linux username and password.
  5. Drag and drop all messages from the IMAP "Inbox" folder into a local PST folder of your proprietary, non-FLOSS email app.

If you still have the messages on Gmail, you can simplify the process by connecting Outlook directly to Gmail's IMAP service. Gmail represents each label as an IMAP folder, so you can Ctrl-A all messages belonging to that label and drag them into a local PST folder.

3
  • Please consider that I do not want to import the entirety of my Gmail into MS Outlook but to import a specific folder/label that I have created based on a search/filter into a particular folder in Outlook.
    – Foad
    Commented May 31 at 9:44
  • sorry, I just realized that I hadn't read your post carefully. I will try this and will let you know.
    – Foad
    Commented May 31 at 9:48
  • 1
    If I understand correctly, by adding my Gmail account directly to my desktop MS Outlook, I should be able to drag and drop emails from a specific Gmail folder to a corresponding folder in Outlook. This would allow me to avoid installing additional software in the Windows Subsystem for Linux (WSL). Right?
    – Foad
    Commented May 31 at 11:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .