Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

IMAP and SMTP for Apple Mail, Thunderbird and phones

Use any mail app with the mailbox that zele domain setup hosts in your Cloudflare account. It is off until you turn it on for an address:
zele domain imap enable hello@example.com
The command prints everything the mail app asks for. The app password is shown once, so copy it now.
┌──────────────────────────────────────────────────────┐ │ Mail app settings │ │ │ │ Email hello@example.com │ │ Username hello@example.com │ │ Password amca-4ia6-7mzu-sfct-d2x4-h6tn-fxxh-irkw │ │ │ │ Incoming IMAP mail.zele.sh port 993 SSL/TLS │ │ Outgoing SMTP mail.zele.sh port 465 SSL/TLS │ └──────────────────────────────────────────────────────┘
You need a domain that is already set up. See Cloudflare mail for zele domain setup.

Add the account to a mail app

Every mail app asks for the same six values. Use the full address as the username for both servers.
SettingValue
Account typeIMAP
Usernamethe full address, hello@example.com
Passwordthe app password
Incoming servermail.zele.sh, port 993, SSL/TLS
Outgoing servermail.zele.sh, port 465, SSL/TLS
Authenticationpassword (also called "normal password")
Mail apps cannot find these servers by themselves, so pick the manual setup:
  • Apple Mail on a Mac: Mail, then Add Account, then Other Mail Account. Enter the address and the app password. When Mail asks for servers, enter mail.zele.sh for incoming and outgoing.
  • iPhone and iPad: Settings, Mail, Mail Accounts, Add Account, Other, Add Mail Account. Choose IMAP. Fill the username and password for the outgoing server too, although iOS marks them optional.
  • Thunderbird: add a mail account, enter the address and the app password, then choose Configure manually and set both servers to SSL/TLS.
The password works with or without the dashes, in upper or lower case. Typing it on a phone is fine.
Menu names change between versions of these apps. The six values stay the same.

One password per device

Create a separate app password for each device, so you can stop one device without touching the others.
zele domain password create hello@example.com --name laptop zele domain password list zele domain password delete k7qw93fd
A deleted password stops working within a minute. list shows the ID, address, label and creation date. It cannot show a password again: only a hash is stored.
An app password is much weaker than your Cloudflare login, on purpose:
  • One mailbox. It opens the mailbox of its address and nothing else on the domain.
  • One sender. It can only send mail from that address.
  • No account access. It cannot change DNS, the Worker, or anything else in Cloudflare.

How it works

Mail apps speak IMAP and SMTP. Cloudflare Workers speak HTTPS. The zele mail gateway translates between them and stores nothing.
Apple Mail ──┐ Thunderbird ──┼──> mail.zele.sh ──HTTPS──> zele-mail.<domain> phone ──┘ zele gateway Worker in your Cloudflare account IMAP 993, SMTP 465 │ no storage ├──> R2 bucket: raw .eml files ├──> Durable Object: UIDs, read and star flags └──> Email Sending: mail you send
zele domain imap enable makes three changes in your account:
  1. It adds an API to your zele-domain-mail Worker, with a rate limit and a small database (a Durable Object) for IMAP state.
  2. It connects the hostname zele-mail.<domain> to that Worker. Cloudflare creates the DNS record and the certificate.
  3. It stores the hash of the new app password in your R2 bucket.
The Worker decides everything from the app password. The gateway cannot pick a mailbox or a sender on its own.
The mail itself does not move. It stays in the same R2 bucket, in the same format the CLI reads.

What passes through zele

With mail apps turned on, your mail and the app password pass through the zele gateway when a mail app reads or sends. The gateway runs on Fly.io, which terminates TLS, so Fly's network sees this traffic too. The gateway keeps nothing after a command (a large message passes through a temporary file while it uploads), and its logs contain no passwords, subjects or message text.
Be clear about the trust: while an app password is valid, the operator of the gateway could read, delete and send mail for that mailbox. Deleting the password ends that.
Without mail apps, nothing passes through zele servers, as described in Cloudflare mail. The CLI never uses the gateway, also when mail apps are on.
If you do not want any zele server in the path, you have two choices:
  • Do not turn it on. The CLI keeps working as before.
  • Run the gateway yourself. It is open source, in the gateway/ folder of the zele repository. Your Worker accepts any gateway, because the app password is the only key. Point your mail app to your own host instead of mail.zele.sh.

Folders, flags and new mail

  • Folders are fixed: Inbox, Sent, Drafts, Archive and Trash. A mail app cannot create or rename folders.
  • Read and star flags set in a mail app are shared between all your mail apps. The CLI does not show them: it treats every stored message as read.
  • Moves are shared. A message you archive in a mail app shows in zele mail list --folder archive. A message you archive with the CLI disappears from the mail app's inbox within an hour.
  • No push yet. Mail apps check for new mail on their own timer, usually every 1 to 15 minutes. A manual refresh shows new mail in a few seconds.
  • Mail that exists when you turn this on shows as read. Only mail that arrives later shows as unread.

Sending

Mail apps send through the same Cloudflare Email Sending setup as zele mail send.
  • The From address must be the address of the app password. Other senders are refused.
  • Workers Free sends only to verified destination addresses. Sending to anyone needs Workers Paid, the same rule as for the CLI.
  • A message has at most 25 MiB, and 50 recipients per submission.
  • If Cloudflare takes only some recipients, a notice mail in your inbox names the others. The mail app itself shows no error in that case.
  • The mail app saves its own copy in Sent. You see it in zele mail list --folder sent too.
Cloudflare replaces the Message-ID of outgoing mail. Some mail apps then show a reply outside the thread of your sent message.
A message is never sent twice. If the result of a send is unknown, the mail app shows an error and the same message is not sent again. Write a new message in that case.

Turn it off

zele domain imap disable example.com --force
This removes the zele-mail.<domain> hostname and deletes every app password of the domain. Mail apps stop working at once. Stored mail and the CLI are not affected.
zele domain remove <domain> does the same as part of removing the domain. zele domain status <domain> shows an imap line with the current state.

Problems

ProblemWhat to do
"Authentication failed" in the mail appCheck that the username is the full address. Create a new password with zele domain password create.
It fails in the first minute after enablingThe new hostname zele-mail.<domain> needs a moment. Try again.
Repeated wrong passwords become slowThe gateway delays logins after failures from the same network, up to 30 seconds, for 15 minutes.
Sending fails with a plan or recipient errorWorkers Free sends only to verified addresses. Check zele domain status <domain>.
The mail app cannot create a folderFolders are fixed. Use Archive.
Sync stops on a very large mailboxWorkers Free allows 100,000 requests and 5 million database rows read per day. Use Workers Paid.