A Rubyesque interface to Gmail. Connect to Gmail via IMAP and manipulate emails and labels. Send email with your Gmail account via SMTP. Includes full support for parsing and generating MIME messages.
If I use search options which are not 'ascii-8bit' encoded, server response is:
[1] pry(main)> mailbox.inbox.emails(gm: 'Привет из Питера!')
Encoding::CompatibilityError: incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string)
String#force_encoding can be used, but in this case Gmail must be aware of original encoding. Otherwise it response with Net::IMAP::BadResponseError: Could not parse command
If I use search options which are not 'ascii-8bit' encoded, server response is:
String#force_encoding can be used, but in this case Gmail must be aware of original encoding. Otherwise it response with
Net::IMAP::BadResponseError: Could not parse command
So I patched Mailbox#emails (https://github.com/dcparker/ruby-gmail/compare/master...ehlyzov:master#diff-41778eca41b3a50379aa723a35b177db) but I don't sure if
opts
is a good place for charset configuration. Maybe it is better to create the mailbox attribute. What do you think?Anyway, with this change following code looks clumsy, but it works:
Probably it would be better to make this default behaviour, can't imagine any drawbacks.