"Set delete policy to 'none' or 'old'. Default is 'none'.") do |d|
opts.delete = d
end
- myparser.on("--username USERNAME", "-u",
+ myparser.on("--username [USERNAME]", "-u",
"Email account to fetch. (example: \
-RareCactus@gmail.com)") do |u|
+RareCactus@gmail.com or cmccabe@company.com)") do |u|
opts.username = u
end
myparser.on("--list-folders", "-l",
opts.mailboxes << a
end
myparser.on("--server [SERVER]", "-s",
- "Email server to use") do |u|
+ "Email server to use. Example: imap.gmail.com") do |u|
opts.server = u
end
end
printf(".")
STDOUT.flush()
- if ($opts.delete != "none"):
+ if $opts.delete != "none" then
# Delete messages
imap.store(msg_seqnos, "+FLAGS", [:Deleted])
imap.expunge
#
# Copies mail from a gmail account
# You need ruby 1.9 for this
-# You need the password gem for this
#
# Problem: this appears to only download some mails (usually around 383 or
# so). One workaround is to run this multiple times. Still not sure if there
require 'net/pop'
require 'optparse'
require 'ostruct'
-require 'password'
class MyOptions
def self.parse(args)