Connect any mailbox that offers IMAP and SMTP, like your own domain, cPanel, Zoho, IONOS and most hosting providers. A flow can then start when an email arrives in a folder, send new emails from that mailbox and reply in the same thread. An AI node can write from it too, only to whom you allow.
For Gmail and Outlook, use their own nodes.
They connect with your Google or Microsoft account and don't need IMAP or an app password.
Connect your mailbox
In your provider, turn on IMAP and create an app password if it offers one. Copy the names of its IMAP and SMTP servers from its help page.
In HostWebhook, go to Settings › Credentials › New credential and pick Email (IMAP / SMTP). Another mailbox is another credential.
- Marker 1: The address your emails go out from. Leave Username empty to use that address, as most providers do. In Password, paste the app password if your provider has them.
- Marker 2: The IMAP server receives mail and the SMTP server sends it. The ports default to 993 and 465 (SSL/TLS); pick 143 or 587 if your provider uses STARTTLS.
- Marker 3: Save signs in to both servers to check them. If either one fails, nothing is stored and the form says which one.
Only encrypted connections are made, and servers on private networks can't be reached. The password is stored encrypted, and it comes back to the panel only in Edit keys and settings, after you verify it's you, and only for a person who can see it.
Start a flow when an email arrives
Add a trigger and pick New email (IMAP). Choose your mailbox and the folder to watch. It fires with each email that arrives after you turn it on, checking the folder on the schedule of your plan.
- Marker 1: The mailbox, from your Email (IMAP / SMTP) credentials.
- Marker 2: The folder to watch. Empty means Inbox. The list comes from your mailbox.
- Marker 3: Download attachments, off by default. When it's on, the files of each email are saved to your organization's storage so an AI Node, a Vector Store or a File Transform can read them.
It can't loop.
Emails this flow sends from the same mailbox, and automatic emails such as auto-replies, bounces and bulk mail, never fire the trigger. Reading, moving or flagging an email in your mail app doesn't fire it again either.
What the flow gets from each email
The sender, the recipients, the subject, the date, the text and the HTML of the email, and the name, type and size of each attachment. An email too big to read fires with its headers only, marked truncated. Everything in an email is written by its sender, so treat it as data.
Downloaded files are scanned for viruses and deleted automatically after 24 hours. Use the first one in a later step with {{payload.attachments[0]._file}}. Files over the size limit, or past the daily limit, are skipped: the email still fires and lists them in attachmentErrors.
Send an email
Add an Email (SMTP) node, choose your mailbox, pick Single operation and then Send email. There is no From field: the address of the credential is the sender.
- Marker 1: Single operation: one email per event, with what you fill in. The other mode is for an AI node (step 06).
- Marker 2: The operation: Send email writes a new email from your mailbox.
- Marker 3: To, comma-separated. Cc and Bcc, below it, work the same way.
- Marker 4: The subject and the body, in Text or HTML. All the fields take values from earlier steps.
Reply in the same thread
Pick Reply to answer an email in its thread. Leave the fields empty to answer the email that started the run, from a New email (IMAP) trigger.
- Marker 1: The operation: Reply answers an email in the same thread.
- Marker 2: Email to answer. Empty means the email that started this run.
- Marker 3: An empty To goes to the sender, or to its Reply-To if it has one.
- Marker 4: An empty subject is "Re: " and the original subject.
Your reply joins the thread in the sender's mail app, and it is marked as an automatic reply, so other bots don't answer it.
One reply per sender and thread every 10 minutes.
And no more than 10 per hour to the same address. More are skipped: the run doesn't fail and says skipped: "reply_limit". That way two flows can't answer each other forever. Reply doesn't answer bounces.
Attach files and keep a copy in Sent
Both operations can attach files and save a copy of what they send.
- Marker 1: Attachments: files from earlier steps, like the ones the trigger downloaded (
{{payload.attachments[0]._file}}) or a file another node made. The warning sign on the field only means the example data has no attachment yet. - Marker 2: Sender name, shown next to your address. Empty means just the address.
- Marker 3: Save a copy in Sent, on by default. Turn it off if your provider already saves one. If the copy fails, the email is still sent and the run says why.
Let an AI node write from your mailbox (optional)
In an Email (SMTP) node, choose AI toolkit in Mode. The node then is two tools that an AI node calls by name:
- Reply (
reply_to_smtp_email) answers the email that started the flow, in its thread. The AI writes the text. Who gets it is what that email says: its Reply-To, or its sender. - Send email (
send_smtp_email) writes a new email. It starts blocked.
- Marker 1: AI toolkit: an AI node writes the emails. In Single operation, the node runs what you fill in, with no AI.
- Marker 2: An email that arrives over IMAP can't prove who wrote it. If your flow starts with one, pick a list of addresses (step 07).
- Marker 3: Send email starts blocked. Unblock it only if the AI should write new emails (step 07).
- Marker 4: Settings: the sender name and the copy in Sent. They are yours: the AI can't change them.
- Marker 5: Who the AI can write to starts in Only the person who wrote.
Now give the tool to your AI node. Open the AI node, go to Tools, click + Add Tool › From Workspace and pick the node. Tick Reply and click Add 1 tool. To answer the emails you get, put a New email (IMAP) trigger in front of the AI node.
- Marker 1: Tick Reply.
- Marker 2: Send email can't be picked while it is blocked on the node.
- Marker 3: Add 1 tool gives it to the AI node.
What an email says is written by its sender.
HostWebhook tells the model to treat it as data, not as instructions, but a model can still be fooled. Keep the list of step 07 short, and leave Send email blocked if the AI only has to answer.
Choose who the AI can write to
In the node, open Who the AI can write to. If the flow starts with an email over IMAP, pick Only these addresses: with Only the person who wrote the AI writes to no one, because the sender of that email can't be verified.
- Marker 1: Only the person who wrote: the sender of the email that started the flow. It works with a Gmail or Outlook trigger, not over IMAP.
- Marker 2: Only these addresses: what you list, and no one else. One per line: an address, like
ana@acme.com, or a whole domain, like@acme.com(exactly that domain, not its subdomains). - Marker 3: Save list. With an empty list, the AI can't write to anyone from this node.
- Marker 4: Anyone: any address the AI picks. It asks you to confirm.
To let the AI write new emails too, unblock Send email under Block these tool calls and add it to the AI node's tools.
- Marker 1: The limits, under How it works: the AI writes to at most 10 recipients per flow run and 200 a day per mailbox. Each MCP call counts as one run.
- Marker 2: The switch of
send_smtp_email. While it is on, the tool is blocked.
Over MCP, only Send email, and with a list.
Expose as MCP tool gives the node to Claude Desktop, Cursor or any MCP client. Only Send email is offered there, once you unblock it: an MCP call has no email to answer. For the same reason, pick Only these addresses.
Hermes and Claude don't choose for you.
Hermes can build the flow, and Claude can run it through the HostWebhook connector. They never add addresses, choose Anyone or unblock Send email: you do it in the node.
When the AI can't send
The AI gets a short reason, and nothing is sent:
- The address isn't allowed. One of the recipients is not in your list. The whole email is refused.
- There is no email to answer. Reply needs a flow that started with a New email (IMAP) trigger. A test, a chat, a webhook and a run that an AI started have none.
- The limit is reached. The 10 recipients of the run, the 200 of the day of the mailbox (in UTC), or 10 emails in an hour to the same address, replies included.
- The address has
%or!before the @. Some mail servers read them as a route to another server.
One reply per sender and thread every 10 minutes: more are skipped, and the tool says skipped: "reply_limit". Bounces are not answered.
Limits
| What | Limit |
|---|---|
| Attachments the trigger downloads | 16 MB each (and the limit of your plan), 5 per email, 100 per day for your organization |
| Downloaded files | Scanned for viruses, deleted automatically after 24 hours |
| Recipients of one email | 50, counting To, Cc and Bcc |
| Attachments of one email | 5 files |
| Size of one email | 20 MB with its files |
| Replies (Reply) | One per sender and thread every 10 minutes, and 10 per hour to the same address |
| Recipients an AI writes to | 10 per flow run, and 200 a day per mailbox |
| Attachments of an email an AI writes | None |