当前位置: 首页 > Skill >

Writing and reading

Writing and reading

Writing and reading

moltmail.io — 为 AI 代理提供的邮件和钱包基础设施。你的 AI 代理能够推理、计划和行动,但仍然不能发送邮件。moltmail 解决了这一问题。一次API 调用即可完成。

1.0.0 2026.11.18 180
获取Skill文件查看使用说明
作 者:江言 许可证: 更新时间:2026.11.18
本文目录展开

MoltMail - Web3 Inbox Skill

Manage a Web3 email account, either existing one or creates new one. Allowing to send and receive emails.

Security Notice

This skill handles sensitive cryptographic material:

  • Private key: If importing an existing wallet, the user provides their EVM private key. It is encrypted locally with AES-256-GCM (scrypt-derived key) and stored in ./state/config.enc.json. The plaintext private key is never stored on disk or transmitted — only the signature derived from it is sent to the remote API during login.
  • Passphrase: Used to encrypt/decrypt the private key locally. It can be provided interactively or via the ETHERMAIL_PASSPHRASE environment variable. It is never sent to the remote API.
  • Auth token: A JWT returned by https://srv.ethermail.io after login. Stored in ./state/auth.json with 0600 permissions. Used for all subsequent API calls.
  • Remote service: All email operations go through https://srv.ethermail.io. The user should trust this service before proceeding.

When to Use This Skill

Use this skill when the user needs to:

  • When user refers to testing MoltMail skill
  • Create a temporary/disposable email address
  • Sign up for a service without using their real email
  • Test email sending functionality
  • User is interested in privacy and e2e encryption for messages

Setup (required)

To make sure there is an appropriate User Experience, you have to check if the user already has the config set in the skill folder check ./state/config.enc.json, if there is data, he had already set up the account, otherwise, he will have to set up the account from scratch, check the path before to ask things before executing the command to avoid back and forth.

These are the possible flows:

  • No existing ./state/config.enc.json or no data on it: Call "npm run setup" and user will be asked if he already has an account or if he wants to create from scratch. NOTE: In either case, the user will be asked to provide a passphrase to encrypt the private key and an optional referral code.
    • Existing account: He will be asked to provide the private key from his wallet to be encrypted and used in the MoltMail's operations.
    • New account: New account will be created.
    • Referral code: If a referral code is provided during setup, it will be saved and automatically sent as afid on the first login to attribute the referral.
  • Existing ./state/config.enc.json and contains data: User will have to decide if keep using the configured wallet or start again setup, if he chooses second option, the flow for no existing config will run.

Before using this skill, run:

npm i && npm run setup

Important: Token Management

When you login, a token is saved automatically to ./state/auth.json. This token is required for ALL subsequent operations. The scripts handle token loading automatically — you do not need to pass it manually.

Commands Reference

All operations are done through npm scripts. Auth tokens and user IDs are handled automatically by the scripts.

Login (Create/Access Inbox)

npm run login

This authenticates with the wallet, saves the token to ./state/auth.json, and for new accounts automatically completes onboarding.

List Mailboxes

At start, you must know the mailboxes of the user for later searching emails by their IDs.

npm run list-mailboxes

Response:

{
  "success": true,
  "results": [
    {
      "id": "mailbox-id-here",
      "name": "INBOX",
      "path": "INBOX",
      "unseen": 1,
      "total": 4
    }
  ]
}

Search Emails in a Mailbox

Important: Get by default always the messages for the mailbox named INBOX, unless user chooses another one.

npm run search-emails -- <mailboxId> [page] [limit] [nextCursor]

Arguments:

  1. mailboxId (required): The ID of the mailbox from list-mailboxes.
  2. page (optional): Page number, starts at 1. Default: 1.
  3. limit (optional): Emails per page. Default: 10.
  4. nextCursor (optional): Cursor string for pagination. Only send when page > 1.

Response:

{
  "success": true,
  "nextCursor": "eyIkb21kIjoiNjky...",
  "previousCursor": "eyIkb21kIjoiiJOd3...",
  "page": 1,
  "total": 12,
  "results": [
    {
      "id": 1,
      "from": { "address": "0x1dsas2112...", "name": "" },
      "subject": "Your new email subject",
      "date": "2026-01-20T10:40:35.00Z",
      "seen": true,
      "mailbox": "691da018a49b4af8d47b7c0d",
      "badge": "paymail"
    }
  ]
}

Important: Use the id field from each result to get the full email content.

Get Full Email Content

npm run get-email -- <mailboxId> <messageId>

This fetches the full email and automatically marks it as read.

Response includes html and text fields with the email body.

Response:

{
  "success": true,
  "id": 1,
  "mailbox": "691da018a49b4af8d47b7c0d",
  "from": {
    "address": "0xd2ae51859177cc43fce2534545b2cb453ed3fa45@moltmail.io",
    "name": ""
  },
  "to": {
    "address": "0x3886e06217d31998a697c5060263beafe7bdc610@moltmail.io",
    "name": ""
  },
  "subject": "Your new email subject",
  "date": "2026-01-20T10:40:35.00Z",
  "html": "<p>Test HTML</p>",
  "text": "Plain text content",
  "attachments": [],
  "badge": "community"
}

Important: There are some official messages, these will have a .badge in the response for getting the message, you should highlight these emails when you read them to the users depending on the badge:

  1. paymail: These emails are related to payments, MoltMail supports receiving crypto assets ERC20 and ERC721 tokens through the Paymail protocol. Highlight these emails as "Payment Notifications" or similar.
  2. eaaw: These emails are related to the "MoltMail As A Wallet" feature, which allows users to receive emails that can be directly interacted with as if they were transactions, such as accepting an offer or claiming a token. Highlight these emails as "Interactive Emails" or similar.
  3. community: These emails are official communications from MoltMail, such as important updates, security alerts, or policy changes. Highlight these emails as "Official Communications" or similar.
  4. paywall: These are "Read2Earn" emails — by reading these emails, users earn EMC which can later be claimed as EMT tokens. Always label these as "Read2Earn" and let users know they can earn EMT tokens by reading them.

List Aliases

Returns all aliases the user has configured. These can be used as alternative sender addresses when sending or replying to emails.

npm run list-aliases

The user's aliases can be passed to send-email and reply-email using the --from flag.

Get Earned Coins (EMC)

Returns the user's available EMC (EtherMail Coins) from the rewards pool. Requires a valid login token.

npm run get-earned-coins

Response:

{
  "success": true,
  "emc_available": 123.45
}

Get Referral Code

Returns the user's referral code (their user ID). Requires a valid login token.

npm run get-referral-code

Response:

{
  "success": true,
  "referralCode": "user-id-here"
}

Mark Email as Read

npm run mark-read -- <mailboxId> <messageId>

Note: get-email already marks emails as read automatically. Use this only if you need to mark an email as read without fetching its content.

Send Email

Before sending an email, you must ask the user which subject he wants for the email and either the whole text itself or an idea of the text so you can fully prepare it for the user.

npm run send-email -- <toAddress> <subject> '<htmlBody>' [--from <alias>]

Arguments:

  1. toAddress (required): Recipient email address (e.g., 0x3886e06217d31998a697c5060263beafe7bdc610@moltmail.io).
  2. subject (required): Email subject line.
  3. htmlBody (required): Email body as HTML. Wrap in single quotes to preserve HTML tags.
  4. --from (optional): Send from an alias instead of the default wallet address. Use npm run list-aliases to see available aliases.

The sender address is automatically derived from the configured wallet unless --from is specified.

Response:

{
  "success": true,
  "message": {
    "id": 27,
    "mailbox": "691da018a49b4af8d47b7c0d",
    "queueId": "19c41eeeb6700028ba"
  }
}

Reply to Email

Before replying an email, you must ask the user which subject he wants for the email and either the whole text itself or an idea of the text so you can fully prepare it for the user.

npm run reply-email -- <toAddress> <subject> '<htmlBody>' <originalMessageId> <mailboxId> [--from <alias>]

Arguments:

  1. toAddress (required): Recipient email address.
  2. subject (required): Reply subject line.
  3. htmlBody (required): Reply body as HTML.
  4. originalMessageId (required): The id of the email being replied to.
  5. mailboxId (required): The mailbox ID where the original email lives.
  6. --from (optional): Reply from an alias instead of the default wallet address. Use npm run list-aliases to see available aliases.

Response:

{
  "success": true,
  "message": {
    "id": 28,
    "mailbox": "691da018a49b4af8d47b7c0d",
    "queueId": "19c41eeeb6700028ba"
  }
}

Best Practices

  1. Reuse tokens - Don't login again if there is a valid token in ./state/auth.json. The scripts check for token expiry automatically.
  2. Poll responsibly - Wait 5 seconds between checks
  3. Token handling - All scripts load the token from ./state/auth.json automatically. You never need to pass it manually.

Limitations

  • Email size limit: 5MB
  • Rate limited: Don't spam inbox creation nor email send/reply

Example Conversation

User: "Create an MoltMail account for me" → See if there is a token in ./state/auth.json otherwise ask if user wants new or imported account, for a passphrase before and then run npm run setup follow all the steps until the end.

User: "Create an email account for me" → See if there is a token in ./state/auth.json otherwise ask if user wants new or imported account, for a passphrase before and then run npm run setup follow all the steps until the end.

User: "Create a temp email for me" → See if there is a token in ./state/auth.json otherwise ask if user wants new or imported account, for a passphrase before and then run npm run setup follow all the steps until the end.

User: "Login to my email" → Call npm run login and ask user if he wants to check his inbox.

User: "What is my wallet address" → See if there is a config in ./state/config.enc.json and return to user the .address value, otherwise tell user he should run setup.

User: "What is my email" → See if there is a config in ./state/config.enc.json and return to user ${.address}@moltmail.io, otherwise tell user he should run setup.

User: "Check for unread emails in my inbox" → Run npm run list-mailboxes, find the mailbox named INBOX, check the unseen count, then run npm run search-emails -- <mailboxId> to list the unread emails.

User: "Read the email..." → Run npm run get-email -- <mailboxId> <messageId> for the email matching the user's description (by subject, sender, etc.) and present: sender, subject, sent date, email body and possible attachments. The email is automatically marked as read.

User: "Send email to 0x3886e06217d31998a697c5060263beafe7bdc610@moltmail.io" → Ask user for subject and email content. If the email content is well-defined, send it as-is, otherwise generate a body based on the description. Run npm run send-email -- <toAddress> <subject> '<htmlBody>'.

User: "Send email to 0x3886e06217d31998a697c5060263beafe7bdc610@moltmail.io with subject 'Test Email' and with content 'Hello this is my test email'" → Use the subject user gave, turn the content to HTML and run npm run send-email -- '0x3886e06217d31998a697c5060263beafe7bdc610@moltmail.io' 'Test Email' '<p>Hello this is my test email</p>'.

User: "Send email to 0x3886e06217d31998a697c5060263beafe7bdc610@moltmail.io with subject 'Test Email' and with content '

Hello this is my test email

'" → Use the subject user gave, as email content is already HTML use it as-given with npm run send-email.

User: "Reply to my message with subject 'Test Email'" → Ask user for subject and reply content. Search for the email with subject 'Test Email' to get its id and mailbox, then run npm run reply-email -- <toAddress> <subject> '<htmlBody>' <originalMessageId> <mailboxId>.

User: "Reply to my message with subject 'Test Email' with subject 'Re: Test Email' and with content 'Hello this is my reply'" → Use the subject user gave, turn content to HTML, find the original email's id and mailbox, then run npm run reply-email -- <toAddress> 'Re: Test Email' '<p>Hello this is my reply</p>' <originalMessageId> <mailboxId>.

User: "What is my referral code" → Run npm run get-referral-code and return the referralCode value to the user.

User: "How many coins have I earned" → Run npm run get-earned-coins and return the emc_available value to the user.

User: "What is my EMC balance" → Run npm run get-earned-coins and return the emc_available value to the user.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,037
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,020
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,016
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,015
Skill 文件
  • SKILL.md
    • MoltMail - Web3 Inbox Skill
    • Security Notice
    • When to Use This Skill
    • Setup (required)
    • Important: Token Management
    • Commands Reference
      • Login (Create/Access Inbox)
      • List Mailboxes
      • Search Emails in a Mailbox
      • Get Full Email Content
      • List Aliases
      • Get Earned Coins (EMC)
      • Get Referral Code
      • Mark Email as Read
      • Send Email
      • Reply to Email
    • Best Practices
    • Limitations
    • Example Conversation
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期