Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix substring search of subjects in Gmail, add support for some Gmail extended IMAP #155

Merged
merged 9 commits into from
Oct 19, 2018

Conversation

zevaverbach
Copy link
Contributor

moved build_search_query to Messages, refactored to use a class attribute of IMAP_ATTRIBUTE_LOOKUP, so that the vendors package can overwrite and add entries to it for, for example, Gmail's IMAP extensions. added X-GM-RAW to GmailMessages' copy of the lookup to make partial subject searches work.

…bute of IMAP_ATTRIBUTE_LOOKUP, so that the vendors package can overwrite and add entries to it for, for example, Gmail's IMAP extensions. added X-GM-RAW to GmailMessages' copy of the lookup to make partial subject searches work.
…bute of IMAP_ATTRIBUTE_LOOKUP, so that the vendors package can overwrite and add entries to it for, for example, Gmail's IMAP extensions. added X-GM-RAW to GmailMessages' copy of the lookup to make partial subject searches work.
@zevaverbach
Copy link
Contributor Author

this resolves #123

@zevaverbach
Copy link
Contributor Author

fixing failures...

… uid_range (needed two underscores), updated and filled in query tests. made dictionary combination compatible with < 3.5.
@zevaverbach
Copy link
Contributor Author

done!

@zevaverbach
Copy link
Contributor Author

An updated description of what's been changed here, including something I didn't mention earlier:

  • queries for subject in Gmail were broken because Gmail doesn't implement 'SUBJECT' properly. This PR fixes that by using X-GM_RAW.
  • build_search_query is back where it started, in query.py, but now it accepts an imap_attribute_lookup dictionary so it knows how to build the query depending on whether it's "vanilla" IMAP or something vendor-specific.
  • As a result of the above, queries are built up by iterating through the kwargs instead of the if/else structure from before, including some small transformations for dates and quotes.
  • Tests are updated to incorporate the above.

@zevaverbach zevaverbach changed the title Vendors fix substring search of subjects in Gmail, add support for some Gmail extended IMAP Oct 18, 2018
@martinrusev martinrusev merged commit 8d7d133 into martinrusev:master Oct 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants