gmailgem / gmail

A Rubyesque interface to Gmail, with all the tools you'll need.
Other
397 stars 119 forks source link

Faster archiving methods #234

Closed github0013 closed 6 years ago

github0013 commented 8 years ago

mailbox('[Gmail]/All Mail') can be deadly slow when you have full of emails. This will fix that by

  1. create a temp folder (label)
  2. put the target email in it
  3. archive it or unarchive it
  4. delete the temp folder
github0013 commented 8 years ago

found better way rather than creating dummy folders around. https://support.google.com/mail/answer/7190?hl=en

#find is still slow, but I think this is a better approach.

johnnyshields commented 7 years ago

I don't think Base is the right class to implement the find method. It seems Mailbox has a very similar method, can you consider that approach.

github0013 commented 7 years ago

@johnnyshields

Mailbox seems to be the right place, but I think it's tied to a Gmail's label as a mailbox. It's in Base#findbecause it uses rfc822msgid over all labels. https://github.com/github0013/gmail-1/commit/d4d201eb60c36341433ec56c8b092eb347df95bf#diff-0fe1a6da51e462184e7052479dfb126aR195