gauteh / lieer

Fast email-fetching and sending and two-way tag synchronization between notmuch and GMail
http://lieer.gaute.vetsj.com
Other
494 stars 60 forks source link

Is there a way to start the first sync using the emails downloaded with google takeout? #256

Closed gmjain closed 7 months ago

gmjain commented 8 months ago

I have a lot of emails (I suspect, everyone does) and the first sync takes a long time with the api limits. One way I can imagine reducing this is by using an existing state from google takeout for gmail. It gives you mbox format emails but it's trivial to convert those to maildir.

I see that lieer uses the historyId from the gmail api. I want to understand if lieer would automatically pick the maildir with already existing emails in them and what would be the steps to do this.

If this functionality does not exist, I would like to implement it with some guidance. :-)

gauteh commented 8 months ago

The file names have to match the ones expected by lieer, then you do a full metadata sync but you don't have to download all the message content. That should make a significant difference.

gmjain commented 8 months ago

Is there a set expectation for the filenames outside of the general maildir format?

Also, I didn't quite get it. Does it do it today already or does it need to be implemented? I'm confused because from the code, it seems like it just does a full_sync if the historyId does not exist but from your comment, it seems like it does..

gauteh commented 8 months ago

It needs to do a full sync, but it does not have to download the messages. Only the metadata like tags/labels. That information is probably not in your maildir/mbox already.