Connect Email (IMAP / Other email)
This guide walks you through connecting a mailbox to Pinchy using standard IMAP (for reading) and SMTP (for sending) — the protocol almost every email provider supports. Use this when your provider isn't Gmail or Microsoft 365: Fastmail, iCloud, GMX, Zoho, a company mail server, or anything you self-host.
Unlike Google and Microsoft, there's no OAuth app to register first. You connect a mailbox directly with its server settings and a password — one step, no separate "app" to manage.
Prerequisites
Section titled “Prerequisites”- You're logged in as an admin in Pinchy
- Your email address
- An app-specific password, if your provider supports one
You'll also need your IMAP and SMTP server hostnames and ports — but Pinchy tries to fill these in for you automatically, so you often don't need to look them up.
Connect the account in Pinchy
Section titled “Connect the account in Pinchy”-
Open the Add Integration wizard
In Pinchy, go to Settings → Integrations, click Add Integration, then select IMAP / Other email.
-
Enter your details
Three fields are all most mailboxes need:
- Your name (optional) — shown to recipients when an agent sends email from this mailbox (
Clemens Helm <clemens@example.com>instead of a bare address). - Email address — when you tab away from this field, Pinchy looks up your provider's server settings automatically (via its built-in provider list and your domain's DNS records).
- Password — use an app-specific password if your provider requires one (see the caution above).
- Your name (optional) — shown to recipients when an agent sends email from this mailbox (
-
Check the server settings
If Pinchy found your provider's settings, they appear as a one-line summary — you don't need to touch them. Click Edit server settings if you want to inspect or change them.
If your provider wasn't recognized, the server fields open up pre-filled with a best guess. Verify them against your provider's documentation:
- IMAP host and IMAP port — usually port
993 - SMTP host and SMTP port — usually port
465or587 - Username — pre-filled with your email address, which is what almost every provider expects
- Security — leave on
Automatic (TLS); Pinchy picks implicit TLS or STARTTLS based on the port.Nonedisables encryption entirely and is only for special setups like a local Proton Mail Bridge.
Your provider's help pages usually list these under "IMAP/SMTP settings" or "set up a mail client." Search for
<your provider> IMAP settingsif you're not sure. - IMAP host and IMAP port — usually port
-
Test & Save
Click Test & Save. Pinchy logs in to both the IMAP and SMTP servers and, if both succeed, saves the connection in one step — a broken connection can't end up saved and silently unusable.
If the test fails, the server settings open up with a specific failure reason — wrong credentials, unreachable host, or a TLS mismatch — so you can correct them and try again.
The mailbox then appears in the Integrations list, named after its email address (rename it anytime from the list), ready to grant to agents.
Reading messages across folders
Section titled “Reading messages across folders”Grant agent email permissions
Section titled “Grant agent email permissions”A connection alone doesn't give any agent access. You must explicitly grant permissions per agent — the same model used for Gmail and Microsoft 365.
-
Open the agent you want to connect to email
-
Click the gear icon to open Agent Settings
-
Select the Permissions tab
-
In the Email section, select the connected account and check the operations this agent may perform:
- Read messages — list, read, and search emails
- Create drafts — create draft emails (saved but not sent)
- Send messages — send emails immediately (cannot be undone)
-
Click Save & Restart and confirm. Permission changes restart the agent runtime, so active chats are briefly disconnected.
Test it
Section titled “Test it”Open the agent's chat and try a few queries:
- "Show me my latest unread emails"
- "Search for emails from max@example.com about invoices"
- "Draft a reply to the last email saying we'll process it today"
- "How many unread emails do I have?"
Available tools
Section titled “Available tools”When email permissions are granted, the agent gets access to these tools — the same set used for Gmail and Microsoft 365:
| Tool | Permission required | Description |
|---|---|---|
email_list | Read | List emails from a folder (INBOX, SENT, DRAFTS, TRASH, SPAM; defaults to INBOX). Supports filtering by read status. |
email_read | Read | Read the full content of a specific email by ID. Lists any attachments with their IDs. Looks up the message in INBOX (see the limitation above). |
email_get_attachment | Read | Download an email attachment into the agent's workspace. Looks up the message in INBOX (see the limitation above). |
email_search | Read | Search emails using structured fields: from, to, subject, text, unread, sinceDays, folder, limit (e.g. { from: "user@example.com", subject: "invoice", sinceDays: 7 }). |
email_draft | Draft | Create a draft email. Saved directly to the mailbox's Drafts folder over IMAP. |
email_send | Send | Send an email immediately over SMTP. Can also send replies with replyTo. |
Troubleshooting
Section titled “Troubleshooting”"Authentication failed — check the username and password"
The most common cause is using your regular account password instead of an app-specific password on a provider that requires one. Generate an app password in your provider's account settings and use that instead.
"Could not connect to the server — check the host and port"
The IMAP or SMTP host is unreachable — a typo in the hostname, a firewall blocking the port, or a provider that uses non-standard ports. Double-check the values against your provider's documented IMAP/SMTP settings.
"Could not establish a secure connection — check the security setting"
The Security setting doesn't match what the server expects. Try TLS for port 993 (IMAP) or 465 (SMTP submission), and STARTTLS for port 587.
"Connection timed out — check the host and port"
The server didn't respond in time — usually a network issue or an incorrect host/port combination.
"Blocked: this host resolves to a private network address"
See Mail servers on your own network below.
Mail servers on your own network
Section titled “Mail servers on your own network”The connection test reports exactly why an attempt failed — refused, timed out, TLS error, wrong password. That's what makes it useful for fixing a mailbox, and it's also what would make it useful for mapping the network Pinchy runs in. So we only probe hosts that resolve to a public address.
If your mail server genuinely lives on your own network — an on-premise Exchange or Dovecot box on 10.x, 172.16–31.x, 192.168.x, or an IPv6 unique-local range — set the environment variable on the Pinchy container and restart it:
ALLOW_PRIVATE_MAIL_HOSTS=1Loopback and link-local addresses stay blocked either way — 127.0.0.1, ::1, 169.254.169.254 and fd00:ec2::254, the cloud metadata endpoints. No mail server lives there, so there's nothing to trade off.
The same check runs when the connection is saved, not only when it's tested, so a blocked host can't be stored and quietly reconnected to later by an inbox sweep.
Ports, TLS & cloud firewalls
Section titled “Ports, TLS & cloud firewalls”Pinchy runs the connection test from the exact server that will send your mail — so if the SMTP leg times out or gets refused, that's real evidence about what this server can reach, not a guess. We use it: on a connection timeout or refusal, we also probe the standard SMTP ports (465, 587, 25) directly from the container, and if a different port is reachable, we show a banner with a one-click "Switch & retry" button for it. Click it and we update the SMTP port and security setting for you and re-run the test — nothing switches silently.
Why cloud hosts block SMTP ports
Section titled “Why cloud hosts block SMTP ports”Cloud providers block outbound mail ports by default on new servers — it's an anti-spam measure, not a Pinchy limitation. The exact ports blocked vary by provider:
| Provider | Blocked outbound | Open | Unblocking |
|---|---|---|---|
| Hetzner | 25, 465 | 587 | Usually opens automatically after ~1 month of account age, or via a support ticket |
| DigitalOcean | 25, 465, 587 | none by default | Open a support ticket requesting outbound mail ports be unblocked |
| AWS / GCP / Azure | 25 | 465, 587 | Port 25 stays blocked by policy; use 465 or 587 instead |
Port 587 (STARTTLS submission) is the safest default for a new cloud server — it's the one port most providers leave open. Port 465 (implicit TLS) is the next most likely to work. Port 25 (unencrypted SMTP relay) is blocked almost everywhere and isn't worth troubleshooting for outbound mail.
Testing reachability yourself
Section titled “Testing reachability yourself”You can check the same thing Pinchy's probe checks, directly from the server (or a shell on the same host):
# Raw TCP reachability (no TLS, no auth) — mirrors what Pinchy's probe doesnc -vz smtp.example.com 587
# Full TLS handshake against an implicit-TLS port (465)openssl s_client -connect smtp.example.com:465nc reporting "succeeded" (or openssl reaching a certificate dump instead of hanging) means the port is reachable from this server. A hang followed by nothing means it's filtered — usually the host's outbound firewall, not your mail provider.
Requesting an unblock
Section titled “Requesting an unblock”If every standard port is blocked (Pinchy's "all outbound SMTP ports appear blocked" banner), the fix has to happen at the host level:
- Hetzner: open a support ticket asking to unblock outbound SMTP for your server/project. New accounts are usually auto-unblocked after roughly a month of account age.
- DigitalOcean: open a support ticket from the control panel requesting outbound mail ports be enabled for your account.
- AWS / GCP / Azure: port 25 is blocked by long-standing policy and generally isn't unblocked on request — use port 465 or 587 instead, which these providers leave open.
What's next
Section titled “What's next”- Connect Email — overview and comparing Gmail, Microsoft 365, and IMAP
- Integrations — how connections and permissions work
- Agent Permissions — the full allow-list model