import_email
Import a raw .eml message directly into a Proton Mail folder to restore backups or migrate from another provider. Accepts byte-exact base64 for non-UTF-8 exports and does not send anything.
Instructions
Import a raw RFC822 message (.eml content) into a folder via IMAP APPEND. Use to restore a backed-up message or migrate mail from another provider's export. Does not send anything — this only inserts a message directly into the mailbox. Many real .eml exports use a legacy 8-bit charset (ISO-8859-1, Windows-1252, etc.) rather than UTF-8 for their header/body text outside of MIME-encoded parts — passing that content through raw corrupts or rejects it. Use rawBase64 instead for any message not already known to be valid UTF-8.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | Full raw RFC822 message source (the .eml file content) as a UTF-8 string. Use rawBase64 instead for non-UTF-8 content. Exactly one of raw/rawBase64 is required. | |
| rawBase64 | No | Full raw RFC822 message source (the .eml file content), base64-encoded, for byte-exact import of non-UTF-8 content. Exactly one of raw/rawBase64 is required. | |
| markAsRead | No | Set the \Seen flag on import. | |
| targetFolder | No | Destination folder. Defaults to INBOX. |