agentleFS
dAAAbdAAAb/agent-skills/skills/nadmail/SKILL.md

NadMail

Skill2 starsChanged 8 months agoMITView on GitHub

πŸ“¬ NadMail - Email for AI Agents based on .nad domains. Give your agent a real email (yourname@nadmail.ai). Register for services, submit forms, receive confirmations β€” without bothering your human. No CAPTCHA, no passwords, just wallet signature.

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 8 are distinctive, and 6 are very specific to this project.

  • β‰ˆ0

    Common Β· estimate

    Many files like this have a rule of this kind.

  • β‰ˆ8

    Distinctive Β· estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer Option A (env var) so no key is written to disk

    line 18
  2. Distinctive:

    If you already have a wallet, just set the env var β€” no private key stored to file:

    line 49
  3. Distinctive:

    Never: commit private keys to git

    line 94
  4. Very specific:

    Never: add ~/.nadmail/ to version control

    line 96
  5. Distinctive:

    Prefer environment variables (Option A) over file storage

    line 98
  6. Very specific:

    Make sure NADMAIL_PRIVATE_KEY is set, or

    line 251
  7. Very specific:

    Run node setup.js --managed to generate one

    line 253
  8. Very specific:

    Run node register.js again to refresh token

    line 256
  9. Distinctive:

    Check if recipient email exists

    line 259
  10. Distinctive:

    Verify token is still valid

    line 260
  11. Distinctive:

    Make sure your private key is correct

    line 264
  12. Distinctive:

    Check wallet has some ETH for signing (gas not needed for signing)

    line 265
  13. Very specific:

    Heartbeat Integration: Use inbox.js in your heartbeat checks

    line 279
  14. Very specific:

    Audit Trail: All operations logged to ~/.nadmail/audit.log

    line 282

β‰ˆ β€œCommon” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. β€œVery specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

πŸ“¬ NadMail - Email for AI Agents

Your agent can handle its own email on the Nad ecosystem. No need to bother your human.

TL;DR: Get yourname@nadmail.ai with your .nad domain. Sign with wallet, send instantly.

Security scan notes (why ClawHub may flag this)

This skill handles private keys (for SIWE signing) and can trigger on‑chain transactions (micro-buys / emo-buy). That is expected for NadMail, but it can look suspicious to automated scanners.

To reduce risk:

  • Requires Node.js >= 18
  • Prefer Option A (env var) so no key is written to disk
  • Managed wallet mode stores the private key encrypted only (AES-256-GCM); plaintext storage is not supported
  • Mnemonic is not shown by default (opt-in via --show-mnemonic) and is never written to disk
  • Emo-buy requires explicit confirmation (or --yes) and has a daily cap (default 0.5 MON/day)

Why NadMail?

  • Autonomous registration β€” Sign up for services, events, newsletters without human help
  • Form submissions β€” Your agent can receive confirmation emails directly
  • No CAPTCHA β€” Wallet signature = proof of identity
  • No passwords β€” Cryptographic auth only
  • .nad ecosystem β€” Native email service for the Nad ecosystem

NadMail gives AI agents verifiable email identities:

  • ✨ .nad domain holders β†’ yourname@nadmail.ai
  • πŸ”— Others β†’ handle@nadmail.ai or 0xwallet@nadmail.ai

Environment Variables

  • NADMAIL_PRIVATE_KEY (required for register.js, recommended: pass via env var)
  • NADMAIL_PASSWORD (optional; used to decrypt ~/.nadmail/private-key.enc without prompting)
  • NADMAIL_TOKEN (optional; overrides ~/.nadmail/token.json for send.js / inbox.js)
  • NADMAIL_EMO_DAILY_CAP (optional; default 0.5; max MON/day for emo-buy spending)
  • NADMAIL_SHOW_MNEMONIC (optional; set 1 to print mnemonic in managed setup)

πŸ” Wallet Setup (Choose One)

Option A: Environment Variable (Recommended βœ…)

If you already have a wallet, just set the env var β€” no private key stored to file:

export NADMAIL_PRIVATE_KEY="0x..."
node scripts/register.js

βœ… Safest method: private key exists only in memory.


Option B: Specify Wallet Path

Point to your existing private key file:

node scripts/register.js --wallet /path/to/your/private-key

βœ… Uses your existing wallet, no copying.


Option C: Managed Mode (Beginners)

Let the skill generate and manage a wallet for you:

node scripts/setup.js --managed
node scripts/register.js

βœ… Default: Encrypted β€” Private key protected with AES-256-GCM

  • You'll set a password during setup
  • Password required each time you use the wallet
  • Mnemonic is opt-in (--show-mnemonic) and never written to disk

Managed Wallet Storage

Managed mode always stores the private key encrypted (AES-256-GCM). Plaintext storage has been removed.


⚠️ Security Guidelines

  1. Never commit private keys to git
  2. Never share private keys or mnemonics publicly
  3. Never add ~/.nadmail/ to version control
  4. Private key files should be chmod 600 (owner read/write only)
  5. Prefer environment variables (Option A) over file storage

Recommended .gitignore

# NadMail - NEVER commit!
.nadmail/
**/private-key
**/private-key.enc
*.mnemonic
*.mnemonic.backup

πŸš€ Quick Start

1️⃣ Register

# Using environment variable
export NADMAIL_PRIVATE_KEY="0x..."
node scripts/register.js

# Or with custom handle
node scripts/register.js --handle yourname

2️⃣ Send Email

node scripts/send.js "friend@nadmail.ai" "Hello!" "Nice to meet you 🦞"

3️⃣ Check Inbox

node scripts/inbox.js              # List emails
node scripts/inbox.js <email_id>   # Read specific email

πŸ“¦ Scripts

ScriptPurposeNeeds Private Key
setup.jsShow help❌
setup.js --managedGenerate wallet (encrypted by default)❌
setup.js --managedGenerate wallet (encrypted, AES-256-GCM)❌
register.jsRegister email addressβœ…
send.jsSend email❌ (uses token)
inbox.jsCheck inbox❌ (uses token)

πŸ“ File Locations

~/.nadmail/
β”œβ”€β”€ private-key.enc   # Encrypted private key (default, chmod 600)
# (plaintext private-key file removed)
β”œβ”€β”€ wallet.json       # Wallet info (public address only)
β”œβ”€β”€ token.json        # Auth token (chmod 600)
# mnemonic.backup is not created (mnemonic is never written to disk)
└── audit.log         # Operation log (no sensitive data)

🎨 Get a Pretty Email

Want yourname@nadmail.ai instead of 0x...@nadmail.ai?

  1. Get a .nad domain
  2. Run: node scripts/register.js --handle yourname

πŸ”§ API Reference

Authentication Flow (SIWE)

// 1. Start auth
POST /api/auth/start
{ "address": "0x..." }
β†’ { "message": "Sign in with Ethereum..." }

// 2. Sign message with wallet
const signature = wallet.signMessage(message);

// 3. Register agent (key difference from BaseMail!)
POST /api/auth/agent-register
{
  "address": "0x...",
  "message": "...",
  "signature": "...",
  "handle": "yourname"
}
β†’ { "token": "...", "email": "yourname@nadmail.ai" }

Email Operations

EndpointMethodPurpose
/api/auth/startPOSTStart SIWE auth
/api/auth/agent-registerPOSTRegister agent with wallet signature
/api/sendPOSTSend email
/api/inboxGETList inbox
/api/inbox/:idGETRead email content

Note: Send endpoint may vary. The script tries multiple endpoints (/api/send, /api/mail/send) for compatibility.


πŸ”„ Key Differences from BaseMail

  1. Authentication endpoint: Uses /api/auth/agent-register (not /api/auth/verify)
  2. Config directory: ~/.nadmail/ (not ~/.basemail/)
  3. Environment variable: NADMAIL_PRIVATE_KEY (not BASEMAIL_PRIVATE_KEY)
  4. Email domain: @nadmail.ai (not @basemail.ai)
  5. Handle parameter: Required during registration
  6. Ecosystem: Part of the Nad ecosystem (.nad domains)

🌐 Links


πŸ“ Changelog

v1.0.0 (2026-02-09)

  • πŸŽ‰ Initial release based on BaseMail architecture
  • πŸ” SIWE authentication with agent-register endpoint
  • πŸ“§ Send and receive emails
  • πŸ”’ Encrypted private key storage
  • πŸ“Š Audit logging
  • 🦞 AI agent optimized

πŸ” Troubleshooting

Common Issues

"ζ‰ΎδΈεˆ°ιŒ’εŒ…"

  • Make sure NADMAIL_PRIVATE_KEY is set, or
  • Use --wallet /path/to/key, or
  • Run node setup.js --managed to generate one

"Token 過期"

  • Run node register.js again to refresh token

"發送倱敗"

  • Check if recipient email exists
  • Verify token is still valid
  • Try registering again if needed

"Authentication failed"

  • Make sure your private key is correct
  • Check wallet has some ETH for signing (gas not needed for signing)

Debug Mode

Set environment variable for more details:

export DEBUG=1
node scripts/send.js ...

πŸ’‘ Usage Tips

  1. Heartbeat Integration: Use inbox.js in your heartbeat checks
  2. Token Caching: Tokens are automatically cached and reused
  3. Multiple Endpoints: Send script tries multiple API endpoints for reliability
  4. Audit Trail: All operations logged to ~/.nadmail/audit.log
  5. Handle Selection: Choose a memorable handle during registration

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.