Class: Mail::IMAP
- Inherits:
-
Object
- Object
- Mail::IMAP
- Defined in:
- lib/kns_email_endpoint/core_extensions/imap.rb
Instance Method Summary collapse
-
#delete_messages(mailbox, messages) ⇒ Object
add a delete message so that we can delete without calling find again.
Instance Method Details
#delete_messages(mailbox, messages) ⇒ Object
add a delete message so that we can delete without calling find again
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/kns_email_endpoint/core_extensions/imap.rb', line 11 def (mailbox, ) mailbox = Net::IMAP.encode_utf7(mailbox) .each do || imap = [:connection] = [:message_id] = [:message] imap.uid_store(, "+FLAGS", [Net::IMAP::DELETED]) if .is_marked_for_delete? end start do |imap| begin imap.select(mailbox) imap.expunge rescue => e puts e. puts e.backtrace.join("\n") raise e end end end |