Class: IMAPFlag
- Inherits:
-
IMAPClient
- Object
- IMAPClient
- IMAPFlag
- Defined in:
- lib/imap_flag.rb
Overview
Automatically flag your messages, yo!
aka part two of my Plan for Total Email Domination.
IMAPFlag flags messages you’ve responded to, messages you’ve written and messages in response to messages you’ve written.
If you unflag a message IMAPFlag is smart and doesn’t re-flag it.
I chose these settings because I find these messages interesting but don’t want to manually flag them. Why should I do all the clicking when the computer can do it for me?
Constant Summary collapse
- AUTO_FLAG_KEYWORD =
IMAP keyword for automatically flagged messages
'IMAPFLAG_AUTO_FLAGGED'- MESSAGE_ID =
Message-Id query
'HEADER.FIELDS (MESSAGE-ID)'
Class Method Summary collapse
-
.process_args(args) ⇒ Object
Handles processing of
args.
Instance Method Summary collapse
-
#initialize(options) ⇒ IMAPFlag
constructor
Creates a new IMAPFlag from
options. -
#run ⇒ Object
Removes read, unflagged messages from all selected mailboxes…
Methods inherited from IMAPClient
#connect, #find_mailboxes, #log, #mark, run, #search
Constructor Details
#initialize(options) ⇒ IMAPFlag
Creates a new IMAPFlag from options.
Options include:
+:Email:: Email address used for sending email
and all options from IMAPClient
53 54 55 56 |
# File 'lib/imap_flag.rb', line 53 def initialize() @email = [:Email].split(/,\s*/) super end |
Class Method Details
.process_args(args) ⇒ Object
Handles processing of args.
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/imap_flag.rb', line 32 def self.process_args(args) = { :Email => [nil, 'Email address not set'] } super args, do |opts, | opts.on("-e", "--email EMAIL", "The email address you use to write email", "Default: #{options[:Email].inspect}", "Options file name: Email") do |email| [:Email] = email end end end |
Instance Method Details
#run ⇒ Object
Removes read, unflagged messages from all selected mailboxes…
61 62 63 |
# File 'lib/imap_flag.rb', line 61 def run super "Flagging messages", [:Flagged, AUTO_FLAG_KEYWORD] end |