{"id":50999656,"url":"https://github.com/btafoya/go-mailtester","last_synced_at":"2026-06-20T13:03:50.256Z","repository":{"id":359218501,"uuid":"1244992868","full_name":"btafoya/go-mailtester","owner":"btafoya","description":"Go CLI tool for testing SMTP and IMAP servers — connection, TLS, auth, and delivery diagnostics","archived":false,"fork":false,"pushed_at":"2026-05-20T22:20:07.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-21T04:04:34.871Z","etag":null,"topics":["cli","diagnostics","email","go","golang","imap","mail-server","smtp","starttls","testing","tls"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/btafoya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-20T20:00:21.000Z","updated_at":"2026-05-20T22:20:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/btafoya/go-mailtester","commit_stats":null,"previous_names":["btafoya/go-mailtester"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/btafoya/go-mailtester","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btafoya%2Fgo-mailtester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btafoya%2Fgo-mailtester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btafoya%2Fgo-mailtester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btafoya%2Fgo-mailtester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/btafoya","download_url":"https://codeload.github.com/btafoya/go-mailtester/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btafoya%2Fgo-mailtester/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34570542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","diagnostics","email","go","golang","imap","mail-server","smtp","starttls","testing","tls"],"created_at":"2026-06-20T13:03:49.637Z","updated_at":"2026-06-20T13:03:50.250Z","avatar_url":"https://github.com/btafoya.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-mailtester\n\n![Go](https://img.shields.io/badge/Go-1.23+-00ADD8?logo=go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/btafoya/go-mailtester)](https://goreportcard.com/report/github.com/btafoya/go-mailtester)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\nTired of guessing why your emails aren't sending? **go-mailtester** is a Go CLI tool that diagnoses SMTP and IMAP servers layer by layer, so you know exactly what's broken.\n\nFor SMTP, it tests everything from raw TCP connections up through STARTTLS negotiation, implicit TLS, authentication, and actually sending messages. For IMAP, it checks connections, TLS, authentication, mailbox listing, status, and message fetching.\n\nBuilt on top of the excellent [`github.com/emersion/go-smtp`](https://github.com/emersion/go-smtp) and [`github.com/emersion/go-imap`](https://github.com/emersion/go-imap) libraries.\n\n## Install\n\nThe fastest way to get started:\n\n```bash\ngo install github.com/btafoya/go-mailtester/cmd/mailtester@latest\n```\n\nOr if you prefer to build from source:\n\n```bash\ngit clone https://github.com/btafoya/go-mailtester.git\ncd go-mailtester\ngo build ./cmd/mailtester\n```\n\n### AI Agent Skill\n\nYou can also install go-mailtester as a skill for Claude Code or other compatible agents:\n\n```bash\nnpx skills add btafoya/go-mailtester\n```\n\nPrivacy-conscious? Disable telemetry:\n\n```bash\nDISABLE_TELEMETRY=1 npx skills add btafoya/go-mailtester\n```\n\nAfter installing, just invoke `/mailtester` or let it trigger automatically when you're debugging email issues.\n\n## Quick Start\n\n**Check if a server is reachable:**\n\n```bash\nmailtester -host smtp.gmail.com -port 587 -mode connection\n```\n\n**Run the full SMTP diagnostic suite:**\n\n```bash\nmailtester -host smtp.gmail.com -port 587 -starttls \\\n  -from me@example.com -to you@example.net \\\n  -user me -pass secret -mode all\n```\n\n**Test implicit TLS (port 465):**\n\n```bash\nmailtester -host smtp.gmail.com -port 465 -tls \\\n  -from me@example.com -to you@example.net \\\n  -user me -pass secret -mode send\n```\n\n**Check IMAP connectivity:**\n\n```bash\nmailtester -host imap.gmail.com -port 993 -tls -mode imap-connection\n```\n\n**Run the full IMAP diagnostic suite:**\n\n```bash\nmailtester -host imap.gmail.com -port 993 -tls \\\n  -user me -pass secret -mode imap-all\n```\n\n## Test Modes\n\nUse `-mode` to pick which layer you want to exercise. The default is `all` (SMTP tests only) — use `imap-all` for IMAP.\n\n| Mode | What it tests |\n|------|---------------|\n| `connection` | TCP connectivity, EHLO, and server extension discovery (STARTTLS, AUTH, SIZE, etc.) |\n| `starttls` | Plaintext dial → check STARTTLS extension → upgrade to TLS → inspect TLS state |\n| `ssl` | Implicit TLS (port 465): `tls.Dial` → inspect TLS state → EHLO → optional auth |\n| `auth` | Dial with selected security, EHLO, then authenticate with PLAIN or LOGIN |\n| `send` | Full manual pipeline: `MAIL FROM` → `RCPT TO` → `DATA` → message body → `QUIT` |\n| `sendmail` | High-level `smtp.SendMail()` convenience function |\n| `sendmailtls` | High-level `smtp.SendMailTLS()` convenience function (implicit TLS) |\n| `raw` | Raw `net/textproto` SMTP session, bypassing the library entirely |\n| `imap-connection` | Plaintext IMAP dial + greeting + capability listing |\n| `imap-starttls` | IMAP STARTTLS upgrade + capability listing |\n| `imap-ssl` | Implicit TLS IMAP (port 993) + greeting + capabilities + optional auth |\n| `imap-auth` | IMAP connection + authenticate with PLAIN or LOGIN |\n| `imap-list` | List all mailboxes |\n| `imap-status` | Select a mailbox and report message count, UIDNext, UIDValidity |\n| `imap-fetch` | Fetch the first message envelope and flags |\n| `all` | Sequentially runs all SMTP tests |\n| `imap-all` | Sequentially runs all IMAP tests |\n\n## Flags\n\n```\n-host        SMTP/IMAP server hostname (default: localhost)\n-port        SMTP/IMAP server port (default: 25)\n-from        Sender email address\n-to          Recipient(s), comma-separated\n-subject     Email subject (default: \"SMTP Test\")\n-body        Email body (default: \"This is a test email from go-mailtester.\")\n-user        SMTP/IMAP username\n-pass        SMTP/IMAP password\n-auth        Auth mechanism: plain, login, none (default: plain)\n-tls         Use implicit TLS (port 465 for SMTP, 993 for IMAP)\n-starttls    Use STARTTLS\n-skip-verify Skip TLS certificate verification\n-timeout     Connection timeout (default: 30s)\n-helo        EHLO/HELO hostname (default: go-mailtester)\n-mode        Test mode (default: all)\n-mailbox     IMAP mailbox to test (default: INBOX)\n```\n\n## Examples\n\n**Test connectivity only:**\n```bash\nmailtester -host smtp.example.com -port 25 -mode connection\n```\n\n**Test STARTTLS negotiation:**\n```bash\nmailtester -host smtp.example.com -port 587 -mode starttls\n```\n\n**Test authentication:**\n```bash\nmailtester -host smtp.example.com -port 587 -starttls \\\n  -user alice -pass secret -mode auth\n```\n\n**Send a single test email via STARTTLS:**\n```bash\nmailtester -host smtp.example.com -port 587 -starttls \\\n  -from alice@example.com -to bob@example.net \\\n  -user alice -pass secret -mode send\n```\n\n**Send via implicit TLS (port 465):**\n```bash\nmailtester -host smtp.example.com -port 465 -tls \\\n  -from alice@example.com -to bob@example.net \\\n  -user alice -pass secret -mode send\n```\n\n**Use LOGIN auth instead of PLAIN:**\n```bash\nmailtester -host smtp.example.com -port 587 -starttls -auth login \\\n  -from alice@example.com -to bob@example.net \\\n  -user alice -pass secret -mode send\n```\n\n**Skip certificate verification (self-signed certs):**\n```bash\nmailtester -host mail.local -port 465 -tls -skip-verify \\\n  -from test@local -to admin@local -mode connection\n```\n\n**Custom timeout:**\n```bash\nmailtester -host slow.server.com -timeout 60s -mode connection\n```\n\n**Raw SMTP session (see server responses line-by-line):**\n```bash\nmailtester -host smtp.example.com -port 25 -mode raw\n```\n\n**Test IMAP connectivity:**\n```bash\nmailtester -host imap.example.com -port 993 -tls -mode imap-connection\n```\n\n**Test IMAP STARTTLS:**\n```bash\nmailtester -host imap.example.com -port 143 -mode imap-starttls\n```\n\n**Test IMAP authentication:**\n```bash\nmailtester -host imap.example.com -port 993 -tls \\\n  -user alice -pass secret -mode imap-auth\n```\n\n**List IMAP mailboxes:**\n```bash\nmailtester -host imap.example.com -port 993 -tls \\\n  -user alice -pass secret -mode imap-list\n```\n\n**Check IMAP mailbox status:**\n```bash\nmailtester -host imap.example.com -port 993 -tls \\\n  -user alice -pass secret -mode imap-status -mailbox INBOX\n```\n\n**Fetch first IMAP message:**\n```bash\nmailtester -host imap.example.com -port 993 -tls \\\n  -user alice -pass secret -mode imap-fetch -mailbox INBOX\n```\n\n**Full IMAP diagnostic suite:**\n```bash\nmailtester -host imap.example.com -port 993 -tls \\\n  -user alice -pass secret -mode imap-all\n```\n\n## Dependencies\n\n- [`github.com/emersion/go-smtp`](https://github.com/emersion/go-smtp)\n- [`github.com/emersion/go-imap`](https://github.com/emersion/go-imap)\n- [`github.com/emersion/go-sasl`](https://github.com/emersion/go-sasl) (transitive)\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtafoya%2Fgo-mailtester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbtafoya%2Fgo-mailtester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtafoya%2Fgo-mailtester/lists"}