Module: OnlyofficeIredmailHelper::MessageMethods

Included in:
IredMailHelper
Defined in:
lib/onlyoffice_iredmail_helper/message_methods.rb

Overview

Methods to work with messages

Instance Method Summary collapse

Instance Method Details

#mark_message_as_seen(message_id, close_connection: true) ⇒ nil

Mark message as seen

Parameters:

  • message_id (Integer)

    message to mark

  • close_connection (True, False) (defaults to: true)

    should connection be closed

Returns:

  • (nil)


10
11
12
13
14
15
# File 'lib/onlyoffice_iredmail_helper/message_methods.rb', line 10

def mark_message_as_seen(message_id, close_connection: true)
  
  @imap.select('INBOX')
  @imap.store(message_id, '+FLAGS', [:Seen])
  close if close_connection
end