Mailbox Operations (qwenpawmail-mcp)
Use qwenpawmail-mcp to connect or register a mailbox and perform email operations.
Supported Providers
The managed QwenPaw mailbox workflow supports these nine mail domains:
| Provider |
Domains |
Login credential |
| NetEase |
163.com, 126.com, yeah.net |
16-character authorization code |
| Tencent |
qq.com, foxmail.com |
16-character authorization code |
| Sina |
sina.com, sina.cn |
16-character authorization code |
| Alibaba |
aliyun.com |
Mailbox login password; existing accounts only |
| Google |
gmail.com |
16-character app password after enabling 2-Step Verification |
Enterprise mailboxes, custom domains, and Microsoft mailboxes are not supported by the current managed workflow. Do not try enterprise provider overrides or custom IMAP/SMTP hosts. Ask the user to choose one of the supported personal domains instead.
create_mailbox provides built-in registration guidance only for 163.com, 126.com, yeah.net, qq.com, and foxmail.com. Other supported domains require their official registration flow. New aliyun.com registration is unavailable; only existing accounts can be connected.
Invocation Rule
For any email operation, use this skill as the entry point. Do not invent another email workflow or bypass qwenpawmail-mcp with raw IMAP/SMTP commands.
Credential and Configuration Model
agent.json contains only public mailbox configuration. Its expected mail shape is:
{
"mail": {
"is_new_account": false,
"credential": {
"name": "myaccount",
"domain": "163.com",
"provider": ""
},
"push": {
"mode": "off",
"rules": [],
"poll_interval_seconds": 120,
"access_control_enabled": false
}
}
}
The sensitive fields auth_code, password, and phone_number are intentionally absent from agent.json and redacted from Agent API responses. The provider credential represented by auth_code is stored encrypted after it is configured. Registration passwords and phone numbers are entered only on the provider page and are not stored by the current QwenPaw workflow. The absence of auth_code from public configuration does not mean that the user did not configure it.
QwenPaw resolves the encrypted provider credential into the managed DriverCard only at runtime. Never read, decrypt, print, copy, or modify credentials.yaml, and never search files or logs for a secret. Use the workflows below.
Workflow: Connect or Create the Mailbox Account
Step 1 — Read public mailbox state
Read mail.is_new_account, mail.credential.name, and mail.credential.domain from agent.json. Treat provider as empty for every currently supported personal domain.
If mail is missing, ask the user to configure Email Management in the QwenPaw Agent Settings UI before continuing.
Step 2a — is_new_account is false: manage an existing mailbox
- Call
check_auth directly. The managed DriverCard already receives the stored email credential through a runtime credential reference; do not look it up in agent.json and do not call set_credentials merely because secret fields are absent.
- If
check_auth succeeds, perform the requested mailbox operation.
- If credentials are missing or invalid, ask the user to edit this agent in QwenPaw, choose Manage your personal mailbox, enter the mailbox credential again, and save. Retry
check_auth after the agent reloads.
- If the user explicitly supplies an email and credential in the current conversation,
set_credentials may be used as a temporary session-only override, followed by check_auth. It does not update the encrypted QwenPaw configuration and is lost when the MCP process restarts.
For temporary set_credentials, pass the full email and the provider-specific credential in the auth_code parameter. For aliyun.com, that parameter contains the login password; for the other supported domains, it contains the 16-character authorization code or app password.
Step 2b — is_new_account is true: register a dedicated mailbox
Use the public username and domain from agent.json. If the username is blank, let create_mailbox generate one or agree on one with the user.
Registration passwords and phone numbers are entered on the provider page and are deliberately unavailable to the Agent. Do not try to recover them from files. The optional credential field in the QwenPaw dedicated-mailbox form is only for the final provider authorization code, app password, or mailbox login password after registration. Use one of these paths:
Preferred path — visible browser registration
- For NetEase or Tencent domains, call
create_mailbox(domain, username) first to validate the username and obtain current provider guidance.
- Open the provider's official registration page in a visible browser.
- When the page requests a password, phone number, CAPTCHA, SMS code, or other identity verification, ask the user to enter it directly in the visible browser. If the user explicitly provides a value for this task, use it only for the current registration and never persist or repeat it.
- Keep the browser open while waiting for user action, then continue after confirmation.
Official registration entry points:
| Domain |
Registration entry |
Notes |
163.com, 126.com, yeah.net |
https://zc.reg.163.com/regInitialized |
Shared NetEase flow; phone verification required |
qq.com, foxmail.com |
https://ssl.zc.qq.com/v3/index-chs.html |
QQ registration; phone verification required |
sina.com |
https://mail.sina.com.cn/register/weixin.php |
WeChat-authorized registration |
sina.cn |
https://mail.sina.cn/register/regmail.php |
Phone/SMS registration |
gmail.com |
https://accounts.google.com/signup |
Enable 2-Step Verification, then create an app password |
aliyun.com |
Unavailable |
New personal registrations are closed; use an existing account |
Consider registration successful only after a clear success message or successful inbox access. If the final username differs from the requested one, report the reason and final address.
Fallback path — user-completed registration
For NetEase or Tencent domains, call create_mailbox(domain, username) and relay its alternatives, registration URL, and steps. Ask the user to complete all password, phone, CAPTCHA, and SMS steps in their own browser.
For Sina or Gmail, direct the user to the official entry above. For aliyun.com, explain that a new account cannot be registered and ask the user to choose another supported domain.
Step 3 — After successful registration
- Do not write an authorization code, password, or phone number into
agent.json.
- Ask the user to edit the agent in the QwenPaw Agent Settings UI and keep Provision a dedicated mailbox selected. Enter the final mailbox name and the optional provider credential shown for that domain, then save. The field accepts a 16-character authorization code/app password for NetEase, Tencent, Sina, or Gmail, and a login password for a provider that uses one. QwenPaw will automatically set
is_new_account to false, store the secret in encrypted form, synchronize the managed DriverCard, and reload the agent.
- After reload, call
check_auth. Do not run other mail tools until it succeeds.
- Read
CONTACTS.md before contact-dependent work.
Available Tools
Read-Only Tools
| Tool |
Purpose |
list_folders |
List all mailbox folders |
list_messages |
List message envelopes in a folder with pagination |
get_message |
Fetch one message by folder and UID |
get_attachment |
Get an attachment by filename or index |
search_messages |
Search by keyword, sender, or date range |
check_auth |
Verify fresh IMAP and SMTP logins using the current runtime credential |
create_mailbox |
Return registration guidance for supported NetEase/Tencent domains |
list_threads |
List conversation threads with incremental sync |
search_threads |
Search conversation threads |
get_thread |
Get all messages in one thread |
get_mailbox_stats |
Get recent mailbox statistics |
Write Tools
| Tool |
Purpose |
send_message |
Send a plain-text email with to/cc/bcc |
reply_message |
Reply with proper threading headers |
forward_message |
Forward a message as an RFC 822 attachment |
mark_messages |
Mark messages read/unread/flagged/unflagged |
move_message |
Move a message to another folder |
create_folder |
Create a mailbox folder |
set_credentials |
Set a temporary in-memory credential for this MCP process |
clear_credentials |
Clear the temporary override and fall back to injected startup credentials |
update_thread |
Add or remove custom thread labels |
Destructive Tools
| Tool |
Purpose |
delete_message |
Permanently delete one message |
delete_thread |
Move a whole thread to trash |
Safety and Reliability Notes
- Never guess or expose an authorization code, password, phone number, CAPTCHA, or SMS code.
- Never interpret redacted secret fields as empty credentials; verify with
check_auth.
- Never place secrets in
agent.json, DriverCard YAML, CONTACTS.md, logs, or chat summaries.
- Confirm with the user before
delete_message or delete_thread.
- Message UIDs are folder-scoped and can change. Refresh with
list_messages or search_messages immediately before acting.
- After any runtime or UI credential change, call
check_auth first.
- Update
CONTACTS.md when the user wants newly discovered contact information retained, but never store credentials there.
View full license text (Apache-2.0)
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to the Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
Copyright 2025 The QwenPaw Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.