开发者

Imap folder only returning a subset of emails with it

开发者 https://www.devze.com 2023-02-17 14:17 出处:网络
The following script only return 1000 messages within from the sent folder when the actual number of sent messages is in the 3000+

The following script only return 1000 messages within from the sent folder when the actual number of sent messages is in the 3000+

How can I get the rest of the messages?

username = ask("Enter your username:  ") { |q| q.echo = true }
password = ask("Enter your password:  ") { |q| q.echo = "*" }
look_in_folder = "[Gmail]/Sent Mail"
save_to_folder = "/Users/penang/Desktop"

puts 'Starting...'
imap = Net::IMAP.new('imap.gmail.com', '993',开发者_如何学运维 true)

puts "Logging in as #{username} ..."

imap.login(username, password)

imap.examine(look_in_folder)

mails = imap.uid_search(["FROM", "me"])
puts "Found #{mails.count} mail(s) in folder '#{look_in_folder}'"


There is a solution

Go to Settings > Labs within Gmail and Enable Advanced IMAP Controls

Imap folder only returning a subset of emails with it

You should now be able to change the folder size limits in Settings > Forwarding and POP/IMAP

Advanced IMAP Controls Enabled:

Imap folder only returning a subset of emails with it

Advanced IMAP Controls Disabled (default):

Imap folder only returning a subset of emails with it


The answer is that there is not anything you can do, it has nothing to do with your script or Net::IMAP. Google is not giving you more than 1000 mails for any folder via IMAP, and there are numerous complaints about this online (IE http://www.google.com/support/forum/p/gmail/thread?tid=2636f734144eeb28&hl=en)

0

精彩评论

暂无评论...
验证码 换一张
取 消