-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat: Frappe Mail Connector #26797
Merged
Merged
feat: Frappe Mail Connector #26797
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
add-test-cases
Add test case to validate fix or enhancement
label
Jun 19, 2024
surajshetty3416
approved these changes
Jul 11, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Integrates Frappe Mail with the Email Account DocType, enabling seamless sending and receiving of emails via the Frappe Mail API.
Connect to Frappe Mail
Basic (API Key and Secret)
basic.auth.mp4
OAuth
oauth.mp4
Validate on Save
When saving the Email Account, the API credentials and mailbox (for inbound and outbound emails) are validated with the Frappe Mail site.
Outbound
The framework's Email Queue sends an HTTP request to the Frappe Mail API (outbound/send) with a JSON object containing the sender, recipient(s), and raw message. Frappe Mail parses the raw message, signs it with the mailbox domain's DKIM signature, and pushes it to an agent for delivery.
Inbound
Inbound email handling varies based on the protocol:
Frappe Mail uses Mail Sync History to keep track of pulled emails, ensuring that each pull retrieves the next set of emails.
Handling Multiple Sites/Devices
The Mail Sync History includes a Source field to differentiate between devices. When making a pull request to Frappe Mail, an
X-Site
header can be passed to identify the requesting device or source. The default source is the request IP if theX-Site
header is not provided.Failed while parsing/processing the raw message
The
EmailAccount.last_synced_at
timestamp is passed when requesting emails from Frappe Mail. This timestamp is only updated when the pull request is completed, ensuring no emails are skipped.