gmailgem / gmail

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

Unable to move emails from Spam to Inbox #265

Closed mauricioklein closed 4 years ago

mauricioklein commented 6 years ago

👉Gem version: 0.7.1 👈

Seems like the gem doesn't allow to move emails from Spam folder to Inbox:

gmail.label('[Gmail]/Spam').emails.first.unspam!
# Gmail::Client::EmailNotFound Exception: Can't find message with ID CAJdi4nbWKJDny_PV+oS8w7kzqT6QZ0_-=EyV=d+EiV-txbGhOg@mail.gmail.com

Also, applying the label INBOX isn't allowed, besides being available:

gmail.labels.all
# ["INBOX", "[Gmail]", "[Gmail]/All Mail", "[Gmail]/Bin", "[Gmail]/Drafts", "[Gmail]/Important", "[Gmail]/Sent Mail", "[Gmail]/Spam", "[Gmail]/Starred"]

gmail.label('[Gmail]/Spam').emails.first.move("INBOX")
# Net::IMAP::BadResponseError Exception: Invalid Arguments: Label name is not allowed: INBOX

Archiving also isn't working properly:

gmail.label('[Gmail]/Spam').emails.first.archive!
# Gmail::Client::EmailNotFound Exception: Can't find message with ID CAJdi4nbWKJDny_PV+oS8w7kzqT6QZ0_-=EyV=d+EiV-txbGhOg@mail.gmail.com

Any idea on how to move emails from Spam to Inbox?

Thanks!

johnnyshields commented 4 years ago

As of version 0.7.0 (Aug 19, 2018) this gem is officially deprecated and will no longer be maintained. Please instead use Google's official Gmail API Ruby Client, which uses the Gmail API rather than IMAP and has significantly better performance and reliability.