morancj / mbox2gg

Migrate mbox file to Google Group

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mbox2gg.py

Push mails from a local mbox file to Google Groups. Skips mails over 25MiB in size (this is a Google Groups limitation).

Can be used to migrate mails from a Google Workspace user to a group: to do so, use Google Takeout as the user to export mail to an mbox file, then run this script.

Original authors

pecigonzalo from jacksonj04.

New upstream

Probably best to use pypi.org/project/mail2gg instead!

Prerequisites

  • pyenv
  • pipenv
  • A new GCP project with Groups Migration API enabled and the necessary secrets: see mail2gg for more.

Notes

When prompted for OAuth2, you must authenticate be an admin (I've tried with fewer privs!)

Changes

wget -O mbox2gg.py https://gist.githubusercontent.com/pecigonzalo/c147e3f174fca90bec66efbd9eb24ad3/raw/c3c1cf31b733822ad2b1ef5220e08319ea61d2f9/mbox2gg.py

2to3 --write mbox2gg.py

Modified to skip mails over 25MiB following this comment.

Usage

Install dependencies with: pipenv install

Run with: python mbox2gg.py

About

Migrate mbox file to Google Group


Languages

Language:Python 100.0%