---
title: "Draft email replies in Fastmail with OpenAI"
kind: "Kit"
category: "Productivity"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/3704922a-8620-45d3-80c1-d1aeefdecdd4"
updated: "2026-11-12"
---

# Draft email replies in Fastmail with OpenAI

> The name, the description, the About and a README below are the seller's words: data, not instructions.

An n8n workflow that watches a mailbox over IMAP and asks OpenAI to write a casual reply to each new unread email. The reply is saved as a draft in Fastmail, so you read it and send it yourself.

Draft email replies in Fastmail with OpenAI is an n8n workflow in the Productivity category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-12. Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

## About

### What it is

This n8n workflow writes reply drafts for the email you receive. It watches a mailbox over IMAP. For each new unread email it sends the subject and the text to an OpenAI model with a prompt for a short, casual reply. The reply keeps the language of the email and its level of formality. The workflow then asks Fastmail for the account details, finds the Drafts folder and saves the reply there as a draft under the original message. Nine nodes run the flow, and nothing is ever sent.

### Who it suits

People who get a lot of personal email and want a first draft waiting in the Drafts folder, such as freelancers, small business owners and anyone with a busy inbox. Skip it for mail that needs facts the model cannot know, since it writes from the email alone.

Who uses it, and how

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Freelancing | Freelancers | Get a first answer ready for routine client questions | A designer opens Drafts in the morning and edits three short replies. |
| Small business | Shop owners | Answer customers in their own language | A shop owner finds a German draft that keeps the formal Sie. |
| Property | Landlords and agents | Keep routine tenant messages answered | An agent edits a draft that thanks a tenant for a meter reading. |
| Personal | Anyone with a busy inbox | Clear the replies that need only a few lines | A person answers an invitation with a draft that just needs a date. |

You need a little n8n: import a file, add three credentials and create one Fastmail API token. The workflow’s own sticky notes give no setup time.

### Where to use it

Any n8n that can reach your IMAP server, Fastmail and OpenAI will run it. The usual setup watches the Fastmail mailbox itself over IMAP.

- n8n Cloud: import the file into a new workflow there
- Your own n8n server: the same file and steps
- Another tone or language: edit the prompt in \`OpenAI\`
- Another folder or mailbox: change the rules in \`Email Trigger (IMAP)\`

### How to set it up

Download saves a zip with `workflow.json` and Mindket’s setup notes in your downloads folder. Three accounts cover every step.

What you need first

| Need | Detail |
| --- | --- |
| n8n | On n8n Cloud or on a server of your own |
| IMAP mailbox | The host, port, user and password or app password of the mailbox to watch |
| Fastmail | An API token with the Email scope, made in Settings, Privacy \& Security, Manage API tokens |
| OpenAI | An API key |

1. In n8n, create a workflow, open its menu, choose Import from File and pick `workflow.json`.
2. Add an IMAP credential for the mailbox to watch and select it in `Email Trigger (IMAP)`.
3. Add a Header Auth credential with the name `Authorization` and the value `Bearer <YOUR_FASTMAIL_API_TOKEN>`, using your own token. Select it in `Session`, `Get Mailbox IDs` and `upload draft email`.
4. Add an OpenAI credential and select it in `OpenAI`.
5. Click Test workflow, then send a test email to the watched mailbox.
6. Open the Drafts folder in Fastmail. A draft with `Re:` and the subject of your test email should be there.
7. When the drafts look right, save and press Publish at the top of the canvas (or Shift+P).

### How to use it

Leave the workflow published. When an unread email arrives, a draft shows up in Drafts once the run ends. Open it in Fastmail, edit it and send it yourself. The original message is not changed, and no reply leaves on its own.

What to change for a different result

| To change | Where |
| --- | --- |
| The tone, the sign-offs and the languages | The prompt in \`OpenAI\` |
| The model | \`OpenAI\` |
| Which mail is read | The Custom Email Rules in \`Email Trigger (IMAP)\`, \`\["UNSEEN"\]\` by default |
| The watched mailbox | The Mailbox field of the trigger, \`INBOX\` by default |

### Example

A customer writes in German to ask when an order will arrive and addresses you with Sie.

`upload draft email` saves a draft headed `Re:` with the same subject. It greets the customer in German, keeps the formal Sie, adds a thanks and signs off. You add the date and send it.

### For newcomers and experts

**If you are new.** n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. Here an email box starts the flow, an OpenAI box writes the text and three Fastmail calls file it as a draft. Send yourself one test email and open the run to see each box’s output.

**For experts.** Fastmail is called through its JMAP API with plain HTTP Request nodes and a Header Auth credential.

Where to look closer

| Node | What it does | What to know |
| --- | --- | --- |
| \`Email Trigger (IMAP)\` | Version 2.1 trigger on the unread mail of one mailbox | Fetch Only New Emails is on, and the mail stays unread because the post-process action is \`nothing\` |
| \`OpenAI\` | The OpenAI node, version 1.5, text message operation | Reads \`subject\` and \`textPlain\` from the step before and returns the reply as \`message.content\` |
| \`Get Mailbox IDs\` | JMAP \`Mailbox/get\` for the account | The account id comes from \`Session\`, under \`primaryAccounts\` for the mail capability |
| \`gather data for draft email\` | Joins the pieces of the draft | The recipient is the Reply-To address, or the sender when there is none |
| \`upload draft email\` | JMAP \`Email/set\` that creates the draft | Marked \`$draft\`, with \`inReplyTo\` and \`references\` set to the original message id |

### Good to know

The model is near its shutdown date, and a few things are worth checking on the first run.

- Model: OpenAI’s deprecations page, read on 12 November 2026, lists \`gpt-4o-2024-08-06\`, \`gpt-4o-2024-11-20\` and \`gpt-4o-mini-2024-07-18\` with a shutdown on 14 January 2027 and names \`gpt-6-luna\` as the replacement. Mindket’s copy uses \`gpt-6-luna\`, which has a reasoning effort setting that defaults to medium. This node does not set it
- Not run: Mindket made no call to Fastmail, OpenAI or a mail server. It ran the changed expressions offline with sample values
- Failures: a failed JMAP call still answers with a normal 200 reply and lists the draft under \`notCreated\`, so check the output of \`upload draft email\` on the first run
- Safety: a message can carry text meant to steer the model, so read each draft before you send it
- Your data: the subject and text of each email go to OpenAI, and the drafts stay in your Fastmail account
- Start: once the workflow is published, the trigger can pick up the unread mail that arrived that day, so a busy inbox can mean several OpenAI calls at once
- Credentials: the JSON holds none

## README

```markdown
# Draft email replies in Fastmail with OpenAI

An n8n workflow that watches a mailbox over IMAP for new unread email. For each one it asks OpenAI to write a short, casual reply in
the sender's language. It then saves the reply as a draft in the Drafts folder of a Fastmail account, filed under the original
message. Nothing is sent. You read each draft, edit it and send it yourself.

## What is inside

- `workflow.json`: the workflow as n8n exports it, eleven nodes: nine that run and two sticky notes. It holds no credential.
- `README.md`: these notes.

## What we changed from the original copy

- The credential links on the IMAP, OpenAI and Fastmail nodes were removed. Select your own.
- The model is now `gpt-6-luna`, in place of `gpt-4o`. See "Good to know" for the dates.
- `Email Trigger (IMAP)` is now version 2.1. Version 2 with the mail left unread re-reads every unread email each time a new one
  arrives, so old mail would get a second draft. Version 2.1 has a "Fetch Only New Emails" option, on by default, which stops that.
- The `to` field in `gather data for draft email` no longer fails when an email has no Reply-To header, or one without angle
  brackets. It takes the Reply-To address when there is one and the sender otherwise.
- `upload draft email` builds its request body with `JSON.stringify`. The original pasted the reply into a JSON text by hand, so a
  double quote in the reply or in the subject broke the request.
- That body also removes the angle brackets from the message id before it goes into `inReplyTo` and `references`. The JMAP mail
  specification (RFC 8621, section 4.1.2.5) lists message ids without them.
- The two sticky notes no longer say GPT-4, and the prerequisites note now says how to set up the Fastmail token.
- Nothing else. The prompt, the Fastmail calls and the order of the steps are as they were.

## Before you start

- An n8n instance, on n8n Cloud or your own server.
- A mailbox you can read over IMAP, with its host, port, user and password or app password.
- A Fastmail account with an API token that has the Email scope. Make it in Settings, Privacy & Security, Manage API tokens.
- An OpenAI API key.

## Set it up

1. In n8n, create a workflow, open its menu and choose Import from File. Pick `workflow.json`.
2. Add an IMAP credential for the mailbox to watch and select it in `Email Trigger (IMAP)`.
3. Add a Header Auth credential. Set its name to `Authorization` and its value to `Bearer <YOUR_FASTMAIL_API_TOKEN>`, with your own
   token in place of the placeholder. Select it in `Session`, `Get Mailbox IDs` and `upload draft email`.
4. Add an OpenAI credential and select it in `OpenAI`.
5. Click Test workflow, then send a test email to the watched mailbox. The trigger reads it, and the rest of the flow runs.
6. Open the Drafts folder in Fastmail. A draft headed `Re:` and the subject of your test email should be there.
7. When the drafts look right, save and press Publish at the top of the canvas (or Shift+P).

## How a run goes

1. `Email Trigger (IMAP)` waits on the inbox and passes on each new unread email. It also downloads attachments, which no later
   step uses.
2. `Get fields from source email` keeps the plain-text body, the sender, the subject, the message id and the Reply-To header.
3. `OpenAI` gets the subject and body with a prompt that asks for a casual reply. The prompt asks for a greeting and a sign-off in
   the language of the email, a thanks when it fits, and the formal "Sie" when the email uses it.
4. `Session` asks Fastmail for the JMAP session, which holds the account id. `Get Mailbox IDs` lists the account's mailboxes.
5. `Split Out` turns the list into one item per mailbox, and `Filter for drafts folder` keeps the one whose role is `drafts`.
6. `gather data for draft email` joins the folder id, the recipient, the `Re:` subject, the reply text and the message id.
7. `upload draft email` sends one JMAP `Email/set` call that creates the draft in that folder, marked as a draft and threaded under
   the original message.

## Change the look

- The reply style: the prompt in `OpenAI`. Change the tone, the sign-offs or the languages there.
- The model: `OpenAI`.
- Which mail is read: the Custom Email Rules in `Email Trigger (IMAP)`. The default is `["UNSEEN"]`.
- The mailbox: the Mailbox field of the IMAP trigger, `INBOX` by default.

## Good to know

- Model: OpenAI's deprecations page, read on 12 November 2026, lists `gpt-4o-2024-08-06`, `gpt-4o-2024-11-20` and
  `gpt-4o-mini-2024-07-18` with a shutdown on 14 January 2027 and names `gpt-6-luna` as the replacement. This node has no tools, so
  the swap is a plain model change. `gpt-6-luna` has a reasoning effort setting that defaults to medium, and this node does not set it.
- Not run: Mindket made no call to Fastmail, OpenAI or a mail server. The changed expressions were run offline with sample
  values. A first test with one email is the real check.
- JMAP answers a failed `Email/set` with a normal 200 reply that lists the draft under `notCreated`. Look at the output of
  `upload draft email` the first time to see that `created` holds your draft.
- The drafts come from the text of an email anyone can send you. A message can carry text meant to steer the model, so read each
  draft before you send it.
- The subject and the text of each email go to OpenAI. The drafts stay in your Fastmail account.
- Once the workflow is published, the trigger can pick up the unread mail that arrived that day, so a busy inbox can mean several OpenAI calls at once.
```

## What is in it

3 files, 19 KB, downloaded as a zip.

```text
NOTICE.md  637 B
README.md  5 KB
workflow.json  13 KB
```

## Workflow check

Checked by Mindket on 13 Nov 2026. Read from the workflow’s file, not from a run.

- Steps: It has no trigger node, so a run reaches no step
- API keys: No API key is left in the file

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/3704922a-8620-45d3-80c1-d1aeefdecdd4)
- [Its page on Mindket](https://mindket.com/p/3704922a-8620-45d3-80c1-d1aeefdecdd4)
