google / import-mailbox-to-gmail

Import .mbox files into Google Workspace

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expected a single 'From' header

prestonr83 opened this issue · comments

Multiple messages fail to import with the following traceback

2017-01-13T16:50:15 (-0500) 65284 ERROR process_mbox_files (import-mailbox-to-gmail.py:233) Failed to import mbox message
Traceback (most recent call last):
  File "import-mailbox-to-gmail.py", line 226, in process_mbox_files
    media_body=media).execute(num_retries=args.num_retries)
  File "/Library/Python/2.7/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/googleapiclient/http.py", line 838, in execute
    raise HttpError(resp, content, uri=self.uri)
HttpError: <HttpError 400 when requesting https://www.googleapis.com/upload/gmail/v1/users/**********/messages/import?internalDateSource=dateHeader&neverMarkSpam=true&uploadType=multipart&processForCalendar=false&fields=id&alt=json returned "Expected a single 'From' header">

This error comes from the Gmail API, it means that there's either no From header in the affected message, or more than one - both of which aren't supported.

Closing as there was no response.