Mindket

Draft email replies in Fastmail with OpenAI

Newversion 1 · updated

Overview

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 . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

At a glance

Runs in
  • 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)

Platform

Connects 3 apps

How it works

Trigger

A new unread email

It starts when an unread email arrives in the mailbox it watches over IMAP, and it reads these fields:

  • The sender
  • The subject
  • The plain-text body
  • The message id
  • The Reply-To address

Actions

  1. The IMAP trigger passes on each new unread email and downloads its attachments
  2. One step keeps the sender, subject, plain text, message id and Reply-To
  3. OpenAI writes a casual reply in the language of the email, formal when the email is
  4. Fastmail returns the JMAP session and the list of mailboxes, and the Drafts folder is picked by its role
  5. One step joins the recipient, the Re: subject, the reply text and the message id
  6. A JMAP call saves the reply as a draft in Drafts, threaded under the original message

Result

A draft reply in the Drafts folder of the Fastmail account for each new unread email, ready for you to edit and send. The workflow sends nothing

Integrations

What you need before you start.

Email (IMAP)

Mail trigger

Watches a mailbox and passes on each new unread email with its sender, subject, text and message id.

NeedsThe IMAP host, port, user and password or app password

OpenAI

Language model

Writes the reply text from the subject and the body of the email with gpt-6-luna.

NeedsOpenAI API key

Fastmail

Mail host

Returns the account id and the mailboxes, and stores the reply as a draft through its JMAP API.

NeedsA Fastmail API token with the Email scope

Workflow check

Checked by Mindket on 13 Nov 2026

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

Read from the workflow’s file, not from a run.

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
IndustryWho uses itHow they use itExample
FreelancingFreelancersGet a first answer ready for routine client questionsA designer opens Drafts in the morning and edits three short replies.
Small businessShop ownersAnswer customers in their own languageA shop owner finds a German draft that keeps the formal Sie.
PropertyLandlords and agentsKeep routine tenant messages answeredAn agent edits a draft that thanks a tenant for a meter reading.
PersonalAnyone with a busy inboxClear the replies that need only a few linesA 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)

Setup

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
NeedDetail
n8nOn n8n Cloud or on a server of your own
IMAP mailboxThe host, port, user and password or app password of the mailbox to watch
FastmailAn API token with the Email scope, made in Settings, Privacy & Security, Manage API tokens
OpenAIAn 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 changeWhere
The tone, the sign-offs and the languagesThe prompt in OpenAI
The modelOpenAI
Which mail is readThe Custom Email Rules in Email Trigger (IMAP), ["UNSEEN"] by default
The watched mailboxThe 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
NodeWhat it doesWhat to know
Email Trigger (IMAP)Version 2.1 trigger on the unread mail of one mailboxFetch Only New Emails is on, and the mail stays unread because the post-process action is nothing
OpenAIThe OpenAI node, version 1.5, text message operationReads subject and textPlain from the step before and returns the reply as message.content
Get Mailbox IDsJMAP Mailbox/get for the accountThe account id comes from Session, under primaryAccounts for the mail capability
gather data for draft emailJoins the pieces of the draftThe recipient is the Reply-To address, or the sender when there is none
upload draft emailJMAP Email/set that creates the draftMarked $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 and files

README

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.
Files
NOTICE.md  637 B
README.md  5 KB
workflow.json  13 KB

3 files, 19 KB, downloaded as a zip.

What’s new

  • Version 1 · 2026-11-12

Reviews

No ratings yet

Write a review

No reviews yet.

More from Mindket

See all from Mindket

Huashu Design

alchaincyf · Skill

Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…

New29.4k

Guizang PPT Skill

op7418 · Skill

Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…

New29.8k

Claude Code Skills & Plugins

alirezarezvani · Skill

Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…

New29.8k

Similar in Productivity

See all in Productivity

Frontend Slides

zarazhangrui · Skill

Builds HTML presentations from scratch or from a PowerPoint file and shows visual style previews to pick from, for people who want web slides with no CSS or Ja…

New32.3k

IPTV

iptv-org · Kit

Collects publicly available live TV channels from many countries into playlists that any video player with live streaming can open. Made for viewers and for de…

New144k

upscaler

uwg · Kit

Holds a set of image upscaling models gathered from the OpenModelDB community, for people who want to enlarge low-resolution pictures with AI on their own comp…

New