use-email (Initial State, Not Initialized Yet)
This skill enables agents to have their own usable email. It is not configured yet. Please guide the user to complete initialization following the steps below.
Step 0: Check for Residual Files from Reinstallation
Check if a non-empty
exists in the root directory of this skill (where SKILL.md is located):
- Exists → Indicates it was configured before (skill update/reinstallation caused document rollback). Run directly:
python <skill-directory>/scripts/Init.py --rebuild-doc
to rebuild the official documentation from the existing configuration. Do not ask the user for any information again.
- Does not exist → Proceed to Step 1.
Step 1: Explain Two Concepts to the User and Collect Information
Agent Email (Required) : An exclusive email belonging only to the agent. After configuration, the agent can use it freely without user confirmation—such as autonomously registering websites, receiving verification codes, testing projects, etc. It is recommended that the user register a dedicated secondary email (e.g., QQ Mail) instead of using their commonly used email.
Information to collect:
- Agent email address (e.g., )
- Authorization code for this email (Note: This is not the login password)
If the user does not know how to obtain the authorization code, guide them according to the email type:
- QQ Mail / FOXMAIL: Web version → Settings → Account → Enable SMTP/IMAP service → Generate authorization code
- 163 / 126 Mail: Web version → Settings → POP3/SMTP/IMAP → Enable service → Set authorization code
- Gmail: Google Account → Security → First enable two-step verification → App-specific password
- Outlook/Hotmail: Microsoft Account → Security → App password
Step 2: SMTP/IMAP Server Addresses
Init.py has a built-in detection table for mainstream email domains (qq/foxmail/163/126/gmail/outlook/hotmail/live/sina/sohu/139/aliyun, etc.). No need to ask the user for domains that can be automatically identified. Only when the email domain is not in the table, ask the user for the SMTP and IMAP server addresses of the email (which can be found in the email service provider's help page).
Step 3: Ask Whether to Configure User Email (Optional)
Explain to the user: User Email is the email actually used by the user. After configuration, the agent can use it temporarily only with the user's explicit consent (e.g., helping the user register an account that needs long-term use). The agent must obtain user confirmation before each use, and shall not guess or reuse previous permissions on its own.
- User agrees to configure → Collect user email address + authorization code (following the same method as Steps 1 and 2)
- User refuses → Skip, only the agent email is sufficient to fully use this skill
Step 4: Perform Initialization
Run Init.py (replace parameters with actual values; server parameters are only required when the domain is unknown):
bash
python <skill-directory>/scripts/Init.py \
--agent-email "xxx@qq.com" \
--agent-auth-code "authorization code" \
--user-email "user@example.com" --user-auth-code "authorization code"
# When user email is not configured: --user-email false (or omit all --user-* parameters)
# For unknown domains, add: --agent-smtp "smtp.xxx.com:465" --agent-imap "imap.xxx.com:993"
The script will test SMTP/IMAP login and automatically rewrite this document into official usage instructions. Confirm initialization completion with the user after success; if it fails, inform the user of the script's error message and retry after correction.
Finally, remind the user: The authorization code is only stored locally in
and will not be uploaded.