cd /news/ai-tools/mars-mail-auto-reply-service · home › topics › ai-tools › article
[ARTICLE · art-174736] src=github.com ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

Mars: Mail Auto Reply Service

An open-source Go terminal UI and CLI called MARS lets users author, manage and run AI-generated MARC (Mail Auto Reply Configuration) rules over IMAP/POP3 and SMTP, using OpenRouter OAuth2 PKCE and SQLite state tracking. MARS sends a plain-language handling strategy to a chosen OpenRouter model via structured tool calling to produce a YAML `.marc` rule file with name, keywords, exclude_keywords, match_mode and auto_reply_message fields, which the user must confirm or reject before it touches the mailbox. The tool tracks per-MARC `last_uid`/`uid_validity` cursors in `~/.mars/mars.db`, caches fetched mail in a separate `~/.mars/cache.db`, retries transient network failures with configurable exponential backoff, and requires Go 1.22+ with CGO disabled since all dependencies are pure Go.

key takeaway

MARS generates `.marc` YAML rules via OpenRouter tool calling and requires explicit user confirmation before activation, tracking per-MARC `last_uid`/`uid_validity` cursors in SQLite so incremental IMAP/POP3 sync only fetches new mail.

read4 min views9 publishedNov 23, 2026
Mars: Mail Auto Reply Service
Image: Michielbdejong (auto-discovered)

An open-source Go TUI and CLI for authoring, managing, and running AI-generated MARC (Mail Auto Reply Configuration) rules over IMAP/POP3 and SMTP with OpenRouter OAuth2 and SQLite state tracking.

MARS automates repetitive inbox triage and context-aware email responses without forcing you to maintain brittle mail filter syntax by hand.

You describe how you want a category of email handled in plain language; MARS sends that strategy to your chosen OpenRouter model with structured tool calling to produce a .marc rule file (name, keywords, exclude_keywords, match_mode, and auto_reply_message). You review and confirm or reject the generated configuration before it ever touches your mailbox.

Once active, MARS polls your inbox incrementally via IMAP or POP3, tracks the last fetched message cursor in SQLite so it never redownloads your entire mailbox, retries transient network failures with exponential backoff, and dispatches replies via SMTP—all inside an interactive terminal UI with a live bottom progress bar or headlessly from the CLI.

  • Support & SLA Triage : Acknowledge bug reports, billing questions, or onboarding requests with ticket links and expected response windows.

  • Out-of-Office & Sabbatical Rules : Send tailored auto-replies depending on topic (e.g., urgent production incidents vs. routine scheduling).

  • Partnership, Press & Sponsorship Routing : Automatically direct media or vendor inquiries to the right intake form or contact.

  • Closed Listings & Waitlists : Politely notify late applicants for closed roles, full cohorts, or expired RFPs without manual inbox cleanup.

  • Cold Outreach Filtering : Decline unsolicited staffing, agency, or sales pitches automatically while excluding newsletters and automated notifications.

  • OpenRouter OAuth2 PKCE & Model Search : Starts with an OpenRouter OAuth2 PKCE flow (or API key setup), followed by an interactive model picker with live search.

  • Tool-Called MARC Authoring : Generates.marc configurations via OpenRouter function/tool calling (generate_marc ) with explicit user confirmation or rejection.

  • Per-MARC UID Tracking & SQLite Message Cache (~/.mars/) :

    • ~/.mars/config.json — OpenRouter credentials, active model, IMAP/POP3, SMTP, and retry/backoff settings.
    • ~/.mars/marcs/*.marc — Human-readable YAML rule files.
    • ~/.mars/mars.db — SQLite database indexing all MARC files,per-MARClast_uid /uid_validity cursors, and reply deduplication logs.
    • ~/.mars/cache.db — Separate SQLite message cache storing fetched emails locally for instant offline rule evaluation and zero redundant mailbox re-downloads.
  • Incremental Sync & Exponential Backoff : Trackslast_uid /UIDL per mailbox so subsequent runs only inspect new mail, with configurablemax_retries ,initial_backoff_ms ,max_backoff_ms , and multiplier.

  • TUI Progress Status Bar & CLI Mode : Visual progress bar at the bottom of the TUI during mail fetches, plus full CLI subcommands for cron jobs and servers.

Requires Go 1.22+ (100% pure Go — no C compiler, gcc, or libc6-dev required).

CGO_ENABLED=0 go mod tidy
CGO_ENABLED=0 go build -o mars ./cmd/mars

./mars

Or use the included Makefile (CGO_ENABLED=0 is set automatically):

make tidy && make run
make test

Note for Linux environments without C headers (libc6-dev): Always pass CGO_ENABLED=0 (or run go env -w CGO_ENABLED=0). Every dependency in MARS ( modernc.org/sqlite, go-imap/v2, go-pop3, bubbletea, cobra) is pure Go and requires zero CGO.

./mars auth

./mars marc generate "Acknowledge support and billing emails with a 24-hour SLA notice"

./mars marc list

./mars marc delete support-and-billing-triage

./mars status

./mars sync
version: 1
name: Support & Billing Triage
slug: support-and-billing-triage
enabled: true
match_mode: any
keywords:
  - support
  - billing
  - invoice
  - bug report
exclude_keywords:
  - unsubscribe
  - mailer-daemon
reply_subject_prefix: "Re: "
auto_reply_message: |
  Thanks for reaching out. We have received your message and routed it to our
  triage queue. Typical response time is within 1 business day.
cooldown_hours: 168
Makefile                       Pure-Go (CGO_ENABLED=0) tidy/build/run/test targets
cmd/mars/main.go               Cobra CLI + Bubble Tea launcher
internal/
  auth/openrouter.go           OpenRouter OAuth2 PKCE local callback server
  config/config.go             ~/.mars/config.json & retry policy management
  mail/fetcher.go              Incremental IMAP/POP3 fetcher, SMTP sender, exponential backoff
  marc/marc.go                 .marc YAML reader/writer & keyword matcher
  openrouter/client.go         Model catalog listing & tool-called MARC generation
  store/sqlite.go              Pure-Go modernc.org/sqlite ~/.mars/mars.db index & cursors
  tui/app.go                   Bubble Tea TUI screens & bottom fetch progress bar

Released under the MIT License.

── more in #ai-tools 4 stories · sorted by recency
── more on @mars 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/mars-mail-auto-reply…] indexed:0 read:4min 2026-11-23 · —