Why Developers Need CLI-First Email Access
You’re writing a script to test a new API. It sends a confirmation email. You check your inbox… and nothing shows up. Not because the API failed—but because you’re stuck waiting, switching contexts, manually scanning a UI.
Email for developers with CLI tools and scripting access isn’t about convenience. It’s about treating mail as data: structured, predictable, automatable. Think of it like git for messages—every inbox action a version-controlled event.
With CLI-first tools, you can parse incoming mail, trigger workflows, or bulk-extract attachments straight from the terminal. No browser tabs. No manual checks. Just scripts that run, verify, and return.
Key takeaways
- CLI access lets developers treat email as machine-readable data, enabling automation and integration with workflows.
- Tools with scripting access allow batch processing, message parsing, and real-time inbox checks without leaving the terminal.
- Self-hosting gives full control over DNS, encryption keys, and message storage—no vendor lock-in or black-box APIs.
How Email for Developers Actually Works with Unifiedesk
You can run email workflows with full CLI and scripting access using Unifiedesk's open-source engine. It supports JMAP and IMAP over TLS, so you can use standard tools like fetchmail, mailutils, or Python scripts with imaplib and requests. All data is stored encrypted at rest with AES-256-GCM under per-account keys—no vendor or backdoor access. Inbound mail is validated via SPF, DKIM, and DMARC; outbound mail is DKIM-signed, ensuring reliability and authenticity.
Scriptable, Reliable, and Secure
Whether you're automating alerts, syncing mail with a custom app, or building a CI/CD notification system, Unifiedesk gives you direct access via JMAP and IMAP. Both protocols are supported over TLS by default, meaning your scripts won't be routing plain text over the wire. JMAP, defined in RFC 8620, is designed for modern, efficient, and idempotent operations—perfect for scripting. IMAP remains a proven standard, backed by decades of use in tools like RFC 3501 and widely supported in open-source tooling.
Let's say you're writing a Python script to read new emails and trigger a deployment. You can use standard libraries and authenticate with OAuth2 or plain passwords—both work. No proprietary API, no locked-down format, just access to the inbox via open protocols.
Encryption and Mail Integrity
On self-hosted deployments, every message and file is encrypted at rest with AES-256-GCM under per-account keys. The encryption key is never exposed to the server or any admin—only your account holds it. This makes it fundamentally impossible for anyone, including Unifiedesk, to read plaintext data without your keys.
Inbound mail undergoes strict SPF, DKIM, and DMARC checks. This blocks spoofing attempts and reduces spam. Outbound messages are automatically DKIM-signed—so your domain reputation stays intact, and your emails are more likely to arrive in inboxes. This is a standard practice in modern email infrastructure, widely adopted by major providers like Fastmail and Proton Mail.
With self-hosting, you control everything: where data lives, who can access it, and how it’s protected. For teams that need data residency or compliance with internal policies, this is the only option that removes vendor risk entirely.
For email with CLI tools and scripting access, Unifiedesk isn’t just a backend—it’s a real, open, and predictable system. It doesn’t hide complexity. It doesn’t make you jump through hoops. It lets you work with your mail like any other data source, with real security, reliability, and control.
Script Mailbox Management with Unifiedesk’s JMAP API
You can script mailbox management for your developer email with Unifiedesk’s JMAP API—using modern, efficient JSON-based requests to retrieve unread messages, apply filters, or sync data with minimal overhead. Unlike IMAP’s full-sync burden, JMAP lets you fetch only what you need, in real time, with atomic operations and smart polling. It’s built for automation, not just mail.
Why JMAP Beats IMAP for Dev Automation
JMAP is designed for performance and modern tooling. It supports real-time updates, efficient polling, and atomic operations—meaning each action either succeeds fully or fails completely. This is crucial when scripting across multiple services or syncing state in CI/CD pipelines.
Most older protocols like IMAP require full mailbox resyncs to detect changes, wasting bandwidth and time. JMAP, specified in RFC 8621, eliminates this by allowing clients to track changes via state tokens and request only deltas. You’re not syncing everything—you’re getting updates, not a dump.
With Unifiedesk’s JMAP API, you can retrieve just the unread messages from a project inbox with a single request. No need to loop through all messages or maintain complex local states. The API returns only the data you ask for, and it’s structured in JSON—easy to parse with Python, Bash, or Node.js.
Practical Example: Fetch Unread Project Mail
Let’s say you want to check the inbox for an internal project, but only the unread messages. With JMAP, you can query the emailMessages method using a filter like {"isUnread": true, "inMailbox": "project-team"}.
You can do this with curl or a language-specific client. The response includes only those messages, with metadata and content on demand—no full sync needed. You can chain this into a script that triggers a notification, logs an alert, or updates a ticket system.
Compare this to traditional IMAP: you’d have to open a connection, sync the entire mailbox, loop through every message, and then filter locally. JMAP does that filtering server-side, with one atomic request.
Unifiedesk’s open-source engine makes this all work consistently across web, mobile, and CLI. Whether you're managing team mailboxes, integrating with internal tools, or automating audit logs, JMAP gives you direct, reliable access—without the noise.
Explore how to integrate this into your workflow: Mail, AI Assistant, or self-host your data and tooling with full control.
Set Up Your Dev-Ready Email Environment
You can start building with email for developers using CLI tools and scripting access right away: sign up for a free @unifiedesk.com mailbox (1 GB storage) to test the system, then deploy Unifiedesk self-hosted via Docker, Kubernetes, or bare metal for full control. The open-source engine gives you scriptable access, and you can generate MX, SPF, DKIM, and DMARC records live—no DNS delays—via the web admin panel or CLI. Once set up, you’re ready to automate, monitor, and integrate with confidence.
Start Small, Test Fast with a Free Mailbox
Let's get you running in under five minutes. Go to Unifiedesk's mail page and create a free @unifiedesk.com account. It gives you 1 GB of storage—enough to test CLI tools, automation scripts, and JMAP or IMAP integrations without any commitment.
This is how you verify your environment works before touching your real domain. You’re not locked in, you’re not sharing data with a third party, and you’re getting full access to the underlying engine. The real test? Can you pull messages with a script? Can you send mail via mailx or curl with full headers? If yes, you’re in control.
Scale to Full Control with Self-Hosted Deployment
Once you're ready, deploy Unifiedesk on your own infrastructure using Docker, Kubernetes, or bare metal. The full stack runs as open-source containers—no black box. This means no vendor lock-in, no hidden APIs, and full access to the codebase if you need to audit or extend it.
- Choose your deployment method: Docker for quick setup, Kubernetes for orchestration at scale, or bare metal for maximum performance and isolation.
- Set up your domain: Enter your domain in the web admin panel or CLI. Unifiedesk generates the correct MX, SPF, DKIM, and DMARC records instantly—no waiting for DNS propagation.
- Apply records: Copy and paste the generated DNS records into your domain registrar. They’re ready to work; MXToolbox can validate them in seconds.
- Test the connection: Use
imap,smtp, orjmapclients with your domain’s credentials. Scripts should authenticate, fetch, and send without issues. - Script with confidence: Access the CLI to manage users, configure filters via Sieve, set up expiring shares, or audit logs—everything exposed and scriptable.
With self-hosting, you own the data and every layer of the stack. Encryption is enforced: messages and files are encrypted at rest with AES-256-GCM under per-account keys. TLS protects transit everywhere—this is not optional, it’s hard-coded.
For more tools, explore AI assistant integration with your own OpenAI-compatible endpoint, or set up your own Unifiedesk instance to run the full workspace suite privately, on-premise. No compromises. Just control.
Real CLI Commands You Can Run Today
You can fetch unread emails, list attachments, and manage deliveries using JMAP with simple curl commands. All actions work over HTTPS with standard auth, no SDKs needed. This isn’t theory — it’s direct access to your inbox via the same API powering modern email clients. JMAP is an industry-standard protocol (defined in RFC 8621) that supports rich queries and real-time sync. Let’s get to the commands.
Fetch and Filter Messages with JMAP
- Use this
curlcommand to retrieve all unread messages:curl -X POST https://your-unifiedesk-host/api/jmap -d '{"methodCalls": [["Email/query", {"filter": {"isUnread": true}}, "c1"]]}'. Replaceyour-unifiedesk-hostwith your domain or self-hosted instance. - Include authentication headers:
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"to make it work. The token comes from your account’s API settings. - Response includes message IDs, threads, and flags — perfect for scripting. Parse the result with
jqor Python to extract only what you need.
Extract Attachments and Manage Messages
- After fetching a message’s ID, query it with:
curl -X POST https://your-unifiedesk-host/api/jmap -d '{"methodCalls": [["Email/get", {"ids": ["msg_id"], "properties": ["attachments"]}, "c2"]]}'and extract theattachmentsarray from the response. - To snooze a message, use the
Message/snoozemethod in JMAP with adelaySecondsfield. This schedules delivery to your inbox later. - Retract a recently sent email within the grace period by calling
Message/undoSendwith the message ID. The window is configurable in your email settings. - Automation tip: pair these commands with
crontabor a scheduler to batch-process emails, auto-download attachments, or clean up inbox clutter regularly.
These tools let you build custom email workflows — from auto-archiving flagged messages to syncing with your task manager via calendar or documents. The API supports full CRUD operations and is designed for integration, not just user interaction.
“JMAP enables efficient, real-time email synchronization without polling.” — IETF JMAP RFC
All features work whether you use the hosted Unifiedesk service or self-host your own instance. Data stays under your control, and encryption (AES-256-GCM at rest, TLS in transit) is active by default. You’re not just accessing email — you’re scripting against it.
Encrypt Mail and Files with Full Per-Account Keys
On self-hosted Unifiedesk deployments, every email and file is encrypted at rest using AES-256-GCM, with each account having its own unique key. Decryption only happens on your device — no third party, not even Unifiedesk, can access your data. This means your scripts can only read decrypted content when running locally with your private key, giving you full control.
How It Works: Keys Stay With You
When you send or store a message or file, it’s encrypted with your account’s key before leaving your device. That key never leaves your machine — not even to Unifiedesk’s servers. If you’re using Unifiedesk on-premise, the encryption is applied server-side too, but the key is never stored in plaintext.
Let’s say you write a script to archive emails via the CLI. It can only process data that’s already decrypted on your local device. Even if the server is compromised, attackers see only ciphertext — no readable data. This follows industry-standard principles like those described in RFC 5652, which outlines secure message encryption practices.
Scripts and Access: No Backdoors, No Escrow
Your scripts interact with encrypted data only when your device holds the decryption key. This is not optional — it’s built into the architecture. Even if you deploy Unifiedesk on a cloud VPS, no one except you can decrypt your messages or files, not even us.
Think of it like a safe you carry with you. You can write scripts that lock and unlock it — but only if you're physically present with the key. This same model applies to file sharing in Unifiedesk Drive, where share links can expire and only you control decryption access.
Want to process inbound emails with a custom CLI tool? Sure — but only if your script runs locally, where your private key is available. This isn’t friction; it’s security by design. You keep what matters — your control — in your hands.
This per-account encryption model is common in self-hosted systems, but few offer full script-level access without exposing keys. Unifiedesk’s open-source engine and JMAP support make it practical for developers who want both privacy and automation.
For more on how this fits into a full private workspace, see the self-hosting guide or explore how your team can use encrypted email, calendar, and documents — all under your control.
Use Sieve Filters to Automate Inbox Rules
With Unifiedesk’s self-hosted option, you can use Sieve filters to automate your inbox—like routing all mail from [email protected] to Inbox-ProjectX—via CLI, scripting, or automated workflows. This gives you full control over how incoming emails are handled, without relying on proprietary app logic or cloud-based rule engines.
Sieve: A Standard for Email Automation
Sieve is a mature, industry-standard protocol defined in RFC 5228. It’s designed specifically for filtering email on the server side, meaning rules apply consistently regardless of which client you use. Unlike email app rules that only run on your device, Sieve runs on your server—so rules stay active even when you’re offline.
Common use cases include sorting newsletters into folders, quarantining spam-like messages, or flagging urgent emails from specific senders. You write the rule once, deploy it to the server, and it applies every time a new email arrives.
Scripting with Sieve via CLI
On self-hosted Unifiedesk deployments, you can manage Sieve filters using standard command-line tools like sieve-compile and sieve-tools, which support reading and deploying filter scripts directly from your automation pipeline.
For example, you can write a shell script that checks the status of a project in your CI/CD system and dynamically updates the Sieve filter to redirect emails to a temporary inbox or archive them until the project is complete. When the project ends, another script reverts the filter, ensuring your inbox stays clean and context-aware.
This kind of adaptive automation is hard to replicate with hosted services that lock you into their UI. With Unifiedesk, your rules are in version-controlled files, editable via Git, and deployable through CI/CD—just like your code.
It’s also useful for temporary access: a contractor might get a filter that auto-archives messages from you after one week. No need to manually clean up later.
For details on setting up custom domains and enabling mail services on your self-hosted server, see the custom domain setup guide.
Sieve isn’t just for advanced users—it’s a proven, reliable way for developers to manage their mail flow programmatically. When you can script how your inbox behaves, you’re not just reacting to email. You’re orchestrating it.
Integrate with OpenAI-Compatible AI Assistants
You can plug Unifiedesk’s AI assistant into any OpenAI-compatible endpoint—including self-hosted models like Llama, Mistral, or Ollama—via simple API calls. By default, your AI interactions never leave your environment, and no data is used for model training or improvement. This means you keep full control over sensitive content while automating tasks like drafting replies, summarizing long email threads, or pulling metadata with a single command.
Flexible AI Integration for Every Development Workflow
Let's say you're building a script that auto-summarizes incoming project updates. You don’t need to wire in a cloud API. Just point your code to your preferred OpenAI-compatible endpoint—on-premise, in a container, or even on your local machine. Unifiedesk’s API supports standard OpenAI request formats, so your existing integrations keep working with zero changes.
This isn’t about vanity compatibility. It’s about real control. As the RFC 3339 standard reminds us, interoperability is strongest when it’s built on widely accepted protocols. Unifiedesk follows that principle: no proprietary locks, no closed systems. Your data, your rules, your code.
Automate, Secure, and Stay in Control
Imagine a script that scans your inbox every morning and generates a daily digest of urgent messages. With Unifiedesk’s AI assistant, that’s a single API call. You can also extract key dates from a meeting thread, draft a response using context from prior emails, or even tag messages with custom fields—all without touching the cloud.
Because you’re self-hosting or using a private endpoint, content stays within your infrastructure. This aligns with the principle of privacy by design, where data minimization and local processing reduce exposure. Whether you’re syncing your calendar, managing documents, or scheduling a video meeting, the AI assistant works silently behind the scenes—no logs, no tracking, no remote model learning.
For teams that need to keep code and communications internal, this is the only way to go. You’re not trading privacy for convenience. You’re rebuilding the workflow so that both are standard. To get started, visit the AI assistant page and set up your first self-hosted endpoint—no vendor lock-in, no compromises.
Secure Your Setup: From DNS to Transit
You don’t need to be a networking expert to protect your domain from spoofing and interception. Set up SPF, DKIM, and DMARC records to authorize your servers and verify email integrity—Unifiedesk generates these automatically. Enforce TLS in transit with MTA-STS, and self-hosted setups include all protections by default, reducing phishing risk and improving deliverability. Let’s walk through it.
Protect Your Domain with DNS Records
- SPF: Authorize only your designated sending servers. Unifiedesk generates a valid SPF record that prevents spoofing from unauthorized hosts.
- DNSSEC: Sign your DNS zone to prevent cache poisoning. While not mandatory, it’s a recommended best practice—see RFC 4033 for foundational guidance.
- DKIM: Sign every outbound email with a unique cryptographic key. Unifiedesk applies DKIM to all messages sent from your domain, ensuring recipients can verify authenticity.
- DMARC: Define how receivers should handle unauthenticated mail. With a policy like
rua=mailto:[email protected]andp=reject, you block spoofed emails and get reports on abuse attempts.
Enforce Encryption in Transit
- Use MTA-STS (Mail Transfer Agent Strict Transport Security) to force TLS encryption for all email delivery. This stops man-in-the-middle attacks and is now required by major providers.
- Avoid plain SMTP. Always use STARTTLS or a TLS-protected port (587/465). Unifiedesk enforces TLS by default, and self-hosted instances apply this policy consistently across all connections.
- Check your setup with tools like MxToolbox or Mail-Tester to validate SPF, DKIM, and DMARC alignment.
- For self-hosted deployments, all three records (SPF, DKIM, DMARC) are auto-configured and enforced by default—no extra steps needed.
With Unifiedesk, you gain full control over your domain’s email security. Whether you're using the cloud or running your own server, the foundation is solid: no manual config, no guesswork. For teams managing multiple domains, the custom domain setup wizard generates correct records in minutes—fully compliant with modern email standards.
“A well-configured DMARC policy is the single most effective way to stop domain-based phishing.” — ICANN, 2022
Every piece of your infrastructure—from your email to your files and AI assistant—is covered by encryption and integrity checks. You're not just sending mail—you're securing your digital presence, one record at a time.
Why This Is the Future of Developer Email
Email is no longer just a communication tool — it’s a data pipeline. When your inbox is accessible via CLI, scripts, and APIs, it becomes a reliable, consistent source of automation, not a manual bottleneck.
Unifiedesk treats email like any other system: open, scriptable, and private. With full CLI access, open-source tools, and end-to-end encryption, you control your data from inbox to archive — no vendor lock-in, no backdoor access.
What you're building isn't just mail. It’s a secure, auditable, self-hosted workflow layer — where every message, contact, and document lives on your terms. The future isn’t email with APIs. It’s email as the API.
Ready to put this into practice? Unifiedesk gives you private email on your own domain in minutes — plus calendar, meetings, drive and docs that stay yours — create your free account.
Frequently asked questions
Can I use shell scripts to check my email automatically?
Yes — Unifiedesk supports JMAP and IMAP over TLS, so you can write scripts using curl, Python, or any language to fetch and process messages.
Is my email content safe when using CLI tools?
Yes — on self-hosted deployments, all data is encrypted at rest with per-account keys. CLI tools only access decrypted content on your trusted device.
How do I set up custom domains with email for scripts?
Unifiedesk generates MX, SPF, DKIM, and DMARC records instantly — no manual DNS edits or waiting. You can automate this setup via API.
Does Unifiedesk support email filtering in scripts?
Yes — Sieve filters can be managed via CLI or JMAP. You can write scripts to update rules dynamically based on sender, subject, or content.
Can I run Unifiedesk entirely on my own server?
Yes — the full stack is self-hostable via Docker or bare metal. All code is open-source and encryption is end-to-end under your control.
What email protocols does Unifiedesk support for developers?
Unifiedesk supports JMAP (recommended), IMAP, and SMTP — all with TLS encryption. JMAP is optimized for scripting and minimal data use.
How does Unifiedesk handle file encryption in scripts?
All files in Drive are encrypted at rest with AES-256-GCM under per-account keys. Scripts can only access decrypted content if run on your device.
Can I use AI assistants to process emails via command line?
Yes — Unifiedesk’s AI assistant works with any OpenAI-compatible endpoint. You can call it from scripts to summarize messages or draft replies.
Does Unifiedesk work with automation tools like Ansible or Jenkins?
Yes — the JMAP API and open-source engine make Unifiedesk compatible with automation tools. You can script inbox checks, alert triggers, and report generation.
How do I ensure my scripts don’t leak sensitive data?
Scripts should only run on trusted devices. Use local key storage, environment variables, and avoid logging sensitive content in plain text.