AnalogJ / hatchet

Cut down spam in your Gmail Inbox
MIT License
367 stars 14 forks source link

imap: connection closed #11

Open mapero opened 1 year ago

mapero commented 1 year ago

Hi,

thanks for developing this tool. I tried to use it with my google workspace account on windows and on a docker host, but connection breaks after a few emails with the following error message:

time="2022-11-02T10:35:13Z" level=fatal msg="imap: connection closed" type=email

On the first run, it was able to reach 15% of 78500 mails. Now it stops at always the same email (0%) after a few seconds. Debug enable does not give any further information on the error.

Might this be some rate limit? I know there is a bandwith limit of 2500MB/day using imap. How you are handling this?

Thanks.

AnalogJ commented 1 year ago

honestly I'm not sure I handle that case (IMAP bandwith limit). I probably need to add a --continue or --continue-from-page setting to allow users to run the command over multiple days.

mapero commented 1 year ago

It might be also useful to not download attachments (files, images ...) when fetching the mails. This would help with the limits ;)

I am not very familar with the imap protocol, but my guess is, that you need to identify the right parts to include or exclude somehow: https://github.com/emersion/go-imap/wiki/Fetching-messages#fetching-only-a-part

Currently hatchet does not work for me, because it stops in the middle of every run, and re-run will fail even faster.

Still have to say, its a cool project. Thanks for that.