Technical¶
Components¶
The add-in consists of four parts, all shipped together in the limepkg-mail-addin package:
- Flask backend — custom endpoints on the Lime CRM server that handle authentication (OAuth device code flow with JWT), email import, and serve the Outlook manifest.
- Lime Admin component — a Stencil web component rendered in Lime Admin for configuring the add-in.
- Lime CRM Web Client components — Stencil web components rendered inside the Lime CRM Web Client that handle the import form, the success screen, and the OAuth device authorization dialog.
- Outlook task pane — an Office.js add-in that runs inside Outlook and communicates with the Flask backend.
Table and Field Definitions¶
The add-in does not require any specific limetype or fields to exist. The administrator picks an existing limetype during configuration and maps email properties to its fields.
Attachments and the .eml File¶
Alongside the user's own attachments, the add-in generates an .eml copy of the full email — headers, body, inline images, and attachments bundled in one file. It appears in the attachment list like any other attachment, so the user can keep or remove it.
The attachment selector separates files into two groups: regular attachments (including the .eml file) and embedded images (images referenced in the email body via CID, such as pasted screenshots). Signature images — company logos, social media icons, and similar images detected within email signature regions — are excluded from the selector entirely. The backend identifies signature regions using HTML markers from common email clients (Outlook, Gmail, Proton Mail) and flags images found within them.
The user chooses which attachments to save. All selected attachments are saved as Document records. How they are linked to the created record depends on your chosen limetype's Document relations:
hasmanyrelation to Document — all selected Documents are linked to the record through that relation.belongstorelation to Document — a separate picker lets the user choose which saved Document fills that single-relation field. The remaining Documents are still saved but are not linked to the record through that relation.
Import Tracking¶
The import history is stored on the Outlook item itself using Office.js custom properties — not in the Lime CRM database. This means import tracking is per-mailbox: if the same email lands in multiple mailboxes, each user gets their own "already saved" status.