In the endless search of fixing my email issues, trying to find the needle in the haystack, I stumbled upon this git commit:
frappe:develop
← s-aga-r:fm-connector
opened 07:18AM - 19 Jun 24 UTC
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)**
https://github.com/frappe/frappe/assets/63660334/1c1a6f6e-691f-4295-b6f4-80fae6f750b3
- **OAuth**
https://github.com/frappe/frappe/assets/63660334/2fe9a7ce-c9c9-4c1f-9395-a9346666984a
- **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.
![image](https://github.com/frappe/frappe/assets/63660334/5b831c68-d9ce-455e-b574-1bd3b2435a37)
- **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.
![image](https://github.com/frappe/frappe/assets/63660334/9933b20f-9d1c-4ae0-8186-27220f79c13e)
- **Inbound**
Inbound email handling varies based on the protocol:
- **POP**: The pulled email is removed to prevent duplicate pulls.
- **IMAP**: Unique Identifiers (UIDs) ensure only new emails are pulled. The maximum UID is maintained in the system and updated with each pull.
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 the `X-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.
Which lets me ask, what is Frappe Mail? I tried to get some more information but this naming isn’t used anywhere else. Also the domain frappemail.com is new to me.
And then there is the frappe App Email Delivery Service - Frappe Cloud Marketplace which seems like it uses mailgun to deliver the emails. And is mainly intended to send emails whereas the frappe mail connector can send and receive.
I’m a little confused right now so any information is appreciated