rgladwell / imap-upload

Python script for uploading a local mbox file to IMAP4 server.
Other
130 stars 30 forks source link

google takeout support #24

Closed vzaliva closed 2 years ago

vzaliva commented 3 years ago

I want to use this script to import mbox file created via Google Takeout service. They export all mail as a single mbox file. However, each message has an additional header specifying to what folder the message belongs to. E.g:

X-Gmail-Labels: Archived,Sent

It would be great if this script can handle these.

rgladwell commented 3 years ago

This would be a useful enhancement, possibly behind a CLI parameter flag.

Unfortunately, I don't have much time to dedicate to this project at the moment. If you need it sooner and have time yourself, I'd be happy to give advice and review code.

adriangibanelbtactic commented 2 years ago

In order to avoid work overlap you should know that I am working on adding this feature in our branch: https://github.com/btactic/imap-upload/tree/google_takeout .

The current implemented functionality saves the emails in the first (or last) label/folder. Not in everyone of them as you might want to.

Note: I ported and adapted functionality from https://github.com/ldidry/gmail-mbox-to-imap which was based on an older version of imap-upload.

rgladwell commented 2 years ago

Fantastic! Feel free to raise a draft PR here. I'd love to see what you're doing.

adriangibanelbtactic commented 2 years ago

My last pull request brings Google Takeout functionaly: https://github.com/rgladwell/imap-upload/pull/35 . Waiting for your feedback there.

Thank you.

rgladwell commented 2 years ago

Thanks for fixing this. Merged!

adriangibanelbtactic commented 2 years ago

Thanks for fixing this. Merged!

Thanks for your merge.

It actually doesn't deal with several folders but with one of them which can have parents in it. And, well, you might end renaming it to create_box because what I understand as 'imap folder' you call it 'imap box' because I guess it's a more traditional way of naming it.

What I mean is that even if my code is functional it can be improved a lot by python experts.