We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5d8f5b5 + 03fbe82 commit d42558dCopy full SHA for d42558d
1 file changed
lib/gmail/mailbox.rb
@@ -51,6 +51,12 @@ def emails(key_or_opts = :all, opts={})
51
search.concat ['FROM', opts[:from]] if opts[:from]
52
search.concat ['TO', opts[:to]] if opts[:to]
53
search.concat ['SUBJECT', opts[:subject]] if opts[:subject]
54
+
55
+ # Gmail offers us to search the same way we do on the web interface
56
+ # https://developers.google.com/gmail/imap_extensions
57
+ # example: gmail.emails(gm: 'has:attachment in:unread "who is john galt"')
58
+ #
59
+ search.concat ['X-GM-RAW', opts[:gm]] if opts[:gm]
60
end
61
62
# puts "Gathering #{(aliases[key] || key).inspect} messages for mailbox '#{name}'..."
0 commit comments