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:
CODEBLOCK0
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)
CODEBLOCK1
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.
CODEBLOCK2
Response:
CODEBLOCK3
Search Emails in a Mailbox
Important: Get by default always the messages for the mailbox named INBOX, unless user chooses another one.
CODEBLOCK4
Arguments:
- 1. mailboxId (required): The ID of the mailbox from
list-mailboxes. - page (optional): Page number, starts at 1. Default: 1.
- limit (optional): Emails per page. Default: 10.
- nextCursor (optional): Cursor string for pagination. Only send when page > 1.
Response:
CODEBLOCK5
Important: Use the id field from each result to get the full email content.
Get Full Email Content
CODEBLOCK6
This fetches the full email and automatically marks it as read.
Response includes html and text fields with the email body.
Response:
CODEBLOCK7
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.
- 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.
- 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.
- 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.
CODEBLOCK8
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.
CODEBLOCK9
Response:
CODEBLOCK10
Get Referral Code
Returns the user's referral code (their user ID). Requires a valid login token.
CODEBLOCK11
Response:
CODEBLOCK12
Mark Email as Read
CODEBLOCK13
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.
CODEBLOCK14
Arguments:
- 1. toAddress (required): Recipient email address (e.g.,
0x3886e06217d31998a697c5060263beafe7bdc610@moltmail.io). - subject (required): Email subject line.
- htmlBody (required): Email body as HTML. Wrap in single quotes to preserve HTML tags.
- --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:
CODEBLOCK15
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.
CODEBLOCK16
Arguments:
- 1. toAddress (required): Recipient email address.
- subject (required): Reply subject line.
- htmlBody (required): Reply body as HTML.
- originalMessageId (required): The
id of the email being replied to. - mailboxId (required): The mailbox ID where the original email lives.
- --from (optional): Reply from an alias instead of the default wallet address. Use
npm run list-aliases to see available aliases.
Response:
CODEBLOCK17
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. - Poll responsibly - Wait 5 seconds between checks
- 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.
MoltMail - Web3 收件箱技能
管理一个Web3电子邮件账户,可以是现有账户或创建新账户。支持发送和接收电子邮件。
安全须知
本技能处理敏感的加密材料:
- - 私钥:如果导入现有钱包,用户需提供其EVM私钥。该私钥使用AES-256-GCM(基于scrypt派生密钥)在本地加密,并存储在./state/config.enc.json中。明文私钥永远不会存储在磁盘上或传输——只有从私钥派生的签名会在登录时发送到远程API。
- 密码短语:用于在本地加密/解密私钥。可以通过交互方式或通过ETHERMAIL_PASSPHRASE环境变量提供。它永远不会发送到远程API。
- 认证令牌:登录后由https://srv.ethermail.io返回的JWT令牌。存储在./state/auth.json中,权限为0600。用于所有后续API调用。
- 远程服务:所有电子邮件操作均通过https://srv.ethermail.io进行。用户在使用前应信任此服务。
何时使用本技能
当用户需要以下情况时使用本技能:
- - 用户提到测试MoltMail技能
- 创建临时/一次性电子邮件地址
- 注册服务而不使用真实邮箱
- 测试电子邮件发送功能
- 用户对隐私和端到端消息加密感兴趣
设置(必需)
为确保良好的用户体验,您需要检查用户是否已在技能文件夹中设置了配置,检查./state/config.enc.json,如果存在数据,则表示用户已设置账户,否则用户需要从头开始设置账户。在执行命令前先检查路径,避免来回询问。
以下是可能的流程:
- - 不存在./state/config.enc.json或其中无数据:调用npm run setup,系统将询问用户是否已有账户或是否想从头创建。注意: 无论哪种情况,用户都需要提供密码短语来加密私钥,以及可选的推荐码。
-
已有账户:系统将要求用户提供钱包私钥进行加密,用于MoltMail的操作。
-
新账户:将创建新账户。
-
推荐码:如果在设置过程中提供了推荐码,它将被保存并在首次登录时自动作为afid发送,以归因推荐。
- - 存在./state/config.enc.json且包含数据:用户需要决定是继续使用已配置的钱包还是重新开始设置。如果选择第二个选项,将执行无现有配置的流程。
在使用本技能前,运行:
bash
npm i && npm run setup
重要:令牌管理
登录时,令牌会自动保存到./state/auth.json。所有后续操作都需要此令牌。脚本会自动处理令牌加载——您无需手动传递。
命令参考
所有操作均通过npm脚本完成。认证令牌和用户ID由脚本自动处理。
登录(创建/访问收件箱)
bash
npm run login
这将使用钱包进行认证,将令牌保存到./state/auth.json,对于新账户会自动完成引导流程。
列出邮箱
开始时,您必须知道用户的邮箱,以便后续按ID搜索邮件。
bash
npm run list-mailboxes
响应:
json
{
success: true,
results: [
{
id: mailbox-id-here,
name: INBOX,
path: INBOX,
unseen: 1,
total: 4
}
]
}
搜索邮箱中的邮件
重要:默认始终获取名为INBOX的邮箱中的邮件,除非用户选择其他邮箱。
bash
npm run search-emails -- [page] [limit] [nextCursor]
参数:
- 1. mailboxId(必需):来自list-mailboxes的邮箱ID。
- page(可选):页码,从1开始。默认值:1。
- limit(可选):每页邮件数。默认值:10。
- nextCursor(可选):分页游标字符串。仅在page > 1时发送。
响应:
json
{
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
}
]
}
重要: 使用每个结果中的id字段获取完整的邮件内容。
获取完整邮件内容
bash
npm run get-email --
这将获取完整邮件并自动标记为已读。
响应包含邮件的html和text字段。
响应:
json
{
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:
Test HTML
,
text: Plain text content,
attachments: [],
badge: community
}
重要:有些是官方消息,这些消息在获取时会在响应中包含.badge字段。根据徽章类型,您在向用户阅读这些邮件时应突出显示:
- 1. paymail:这些邮件与支付相关,MoltMail支持通过Paymail协议接收ERC20和ERC721加密资产。将这些邮件突出显示为支付通知或类似内容。
- eaaw:这些邮件与MoltMail作为钱包功能相关,允许用户接收可直接交互的邮件(如接受报价或领取代币)。将这些邮件突出显示为交互式邮件或类似内容。
- community:这些是MoltMail的官方通讯,如重要更新、安全警报或政策变更。将这些邮件突出显示为官方通讯或类似内容。
- paywall:这些是阅读赚取邮件——通过阅读这些邮件,用户可赚取EMC,之后可兑换为EMT代币。始终将这些标记为阅读赚取,并告知用户阅读后可赚取EMT代币。
列出别名
返回用户已配置的所有别名。这些别名可在发送或回复邮件时用作替代发件人地址。
bash
npm run list-aliases
用户的别名可通过--from标志传递给send-email和reply-email。
获取已赚取代币(EMC)
返回用户奖励池中可用的EMC(EtherMail代币)。需要有效的登录令牌。
bash
npm run get-earned-coins
响应:
json
{
success: true,
emc_available: 123.45
}
获取推荐码
返回用户的推荐码(用户ID)。需要有效的登录令牌。
bash
npm run get-referral-code
响应:
json
{
success: true,
referralCode: user-id-here
}
标记邮件为已读
bash
npm run mark-read --
注意:get-email已自动将邮件标记为已读。仅当需要在不获取邮件内容的情况下标记邮件为已读时使用此命令。
发送邮件
发送邮件前,您必须询问用户想要的邮件主题,以及完整的文本内容或文本内容的构思,以便您为用户完全准备好邮件。
bash
npm run send-email -- [--from ]
参数:
- 1. toAddress(必需):收件人电子邮件地址(例如:0x3886e06217d31998a697c5060263beafe7bdc610@moltmail.io)。
- subject(必需):邮件主题行。
- htmlBody(必需):HTML格式的邮件正文。用单引号包裹以保留HTML标签。
- --from(可选):使用别名发送,而非默认的钱包地址。使用npm run list-ali