firstname.lastname@example.org (Byung-Hee HWANG "(황병희, 黃炳熙)") writes:
my mailbox is Google Apps (Gmail). it is now full (almost 98%). most
messages are trash folder. just i did try to remove all trash messages
permantly on the web. but web browser was freeze. so i thank a
while. yes i have to ruby script!!! i like ruby but just i am newbie
level. so please advise any comments about empty trash gmail with
ruby. currently i use ruby 2.5 on ubuntu 18.04, hardware is chromebook [arm64].
just i installed ruby gem 'gmail' by `sudo gem install gmail'. install is
success. then i wrote as code:
# -*- coding: utf-8 -*-
gmail = Gmail.connect('MY_GMAIL_ID', 'MY_GMAIL_PASSWORD')
gmail.mailbox('[Gmail]/Trash').emails.each do |email|
but i did failed. see as belows: (error messages)
Traceback (most recent call last):
11: from ./1.rb:10:in `<main>'
10: from /var/lib/gems/2.5.0/gems/gmail-0.7.1/lib/gmail/client/base.rb:159:in `mailbox'
9: from /var/lib/gems/2.5.0/gems/gmail-0.7.1/lib/gmail/client/base.rb:159:in `synchronize'
8: from /var/lib/gems/2.5.0/gems/gmail-0.7.1/lib/gmail/client/base.rb:162:in `block in mailbox'
7: from /var/lib/gems/2.5.0/gems/gmail-0.7.1/lib/gmail/client/base.rb:222:in `switch_to_mailbox'
6: from /usr/lib/ruby/2.5.0/net/imap.rb:457:in `select'
5: from /usr/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
4: from /usr/lib/ruby/2.5.0/net/imap.rb:459:in `block in select'
3: from /usr/lib/ruby/2.5.0/net/imap.rb:1253:in `send_command'
2: from /usr/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
1: from /usr/lib/ruby/2.5.0/net/imap.rb:1271:in `block in send_command'
/usr/lib/ruby/2.5.0/net/imap.rb:1217:in `get_tagged_response': Unknown Mailbox: [Gmail]/Trash (Failure) (Net::IMAP::NoResponseError)
thanks in advance,
^고맙습니다 _地平天成_ 감사합니다_^))//