Skip to content

Conversation

raunakab
Copy link
Contributor

@raunakab raunakab commented Jul 3, 2025

Description

This PR adds support for a generic email connector.

Addresses: https://linear.app/danswer/issue/DAN-2160/add-a-new-imap-connector.

How Has This Been Tested?

Unit + integration tests TODO.

@raunakab raunakab requested a review from a team as a code owner July 3, 2025 22:37
Copy link

vercel bot commented Jul 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 10:49pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

New IMAP connector implementation for email integration shows significant gaps and missing core functionality that need to be addressed before it can be production-ready.

  • Connector in backend/onyx/connectors/imap/connector.py lacks critical time range filtering despite accepting start/end parameters, which is essential for the Poll/Load connector interfaces
  • Core email processing functionality in backend/onyx/connectors/imap/__init__.py is incomplete with NotImplementedError stubs and commented-out code for email body processing
  • Email header extraction in backend/onyx/connectors/imap/models.py needs more robust error handling for missing content_type fields and mismatched field validations
  • Security improvements needed in credential handling implementation, particularly around SSL configuration and token storage
  • Limited email folder support (only 'Inbox' currently) requires expansion for full IMAP capabilities

4 files reviewed, 9 comments
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@evan-onyx evan-onyx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a bunch o nits

@raunakab raunakab enabled auto-merge July 8, 2025 22:47
@raunakab raunakab added this pull request to the merge queue Jul 8, 2025
Merged via the queue into main with commit 004e56a Jul 9, 2025
14 checks passed
@raunakab raunakab deleted the feat/imap branch July 9, 2025 01:06
AnkitTukatek pushed a commit to TukaTek/onyx that referenced this pull request Sep 23, 2025
* Implement fetching; still need to work on document parsing

* Add basic skeleton of parsing email bodies

* Add id field

* Add email body parsing

* Implement checkpointed imap-connector

* Add testing logic for basic iteration

* Add logic to get different header if "to" isn't present

- possible in mailing-list workflows

* Add ability to index specific mailboxes

* Add breaking when indexing has been fully exhausted

* Sanitize all mailbox names + add space between stripped strings after parsing

* Add multi-recipient parsing

* Change around semantic-identifier and title

* Add imap tests

* Add recipients and content assertions to tests

* Add envvars to github actions workflow file

* Remove encoding header

* Update logic to not immediately establish connection upon init of `ImapConnector`

* Add start and end datetime filtering + edit when connection is established / how login is done

* Remove content-type header

* Add note about guards

* Change default parameters to be `None` instead of `[]`

* Address comment on PR

* Implement more PR suggestions

* More PR suggestions

* Implement more PR suggestions

* Change up login/logout flow (PR suggestion)

* Move port number to be envvar

* Make globals variants in enum instead (PR suggestion)

* Fix more documentation related suggestions on PR

* Have the imap connector implement `CheckpointedConnectorWithPermSync` instead

* Add helper for loading all docs with permission syncing
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.

2 participants