Bug Description
When connecting to 163 mailbox (NetEase) via IMAP, the connection fails with error:
Unsafe Login. Please contact kefu@188.com for help
Root Cause
163 mailbox requires IMAP ID extension (RFC 2971) to be sent after login. The client must identify itself with name, version, vendor, support-email fields.
Without sending the ID command after store.connect(), 163 treats the client as "unsafe" and blocks the connection.
Official Requirement (from 163 help center)
When using IMAP protocol, the system requires your client to provide identity information before allowing connection.
163 provides Java example:
HashMap IAM = new HashMap();
IAM.put("name","myname");
IAM.put("version","1.0.0");
IAM.put("vendor","myclient");
IAM.put("support-email","testmail@test.com");
store.connect("test@163.com", "auth_code");
store.id(IAM); // ← Must be called after connect()
Reference: https://www.ietf.org/rfc/rfc2971.txt
Expected Behavior
Hermes Agent's email platform should:
- Detect if the IMAP server supports ID extension (CAPABILITY ID)
- After successful login, automatically send
ID command with client identity
- Allow users to configure identity fields in
config.yaml or .env
Current Behavior
IMAP login succeeds, but 163 immediately blocks subsequent operations with "Unsafe Login" error. SMTP works fine (using auth code).
Environment
- Hermes Agent version: v0.13.0 (2026.5.7)
- Email provider: 163.com (NetEase)
- IMAP server: imap.163.com:993 (SSL)
- Auth method: Authorization code (not password)
Suggested Fix
In hermes_agent/platforms/email/imap_client.py (or equivalent):
import imaplib
# Add ID command support
imaplib.Commands["ID"] = "AUTH"
# After login
conn = imaplib.IMAP4_SSL("imap.163.com", 993)
conn.login(user, password)
# Send ID (required by 163)
conn._simple_command("ID", '("name" "hermes-agent" "version" "0.13.0" "vendor" "NousResearch" "support-email" "contact@nousresearch.com")')
Additional Context
Feature Request
Add a configuration option in config.yaml:
email:
imap_id:
enabled: true
name: "hermes-agent"
version: "0.13.0"
vendor: "NousResearch"
support-email: "contact@nousresearch.com"
Bug Description
When connecting to 163 mailbox (NetEase) via IMAP, the connection fails with error:
Root Cause
163 mailbox requires IMAP ID extension (RFC 2971) to be sent after login. The client must identify itself with
name,version,vendor,support-emailfields.Without sending the
IDcommand afterstore.connect(), 163 treats the client as "unsafe" and blocks the connection.Official Requirement (from 163 help center)
163 provides Java example:
Reference: https://www.ietf.org/rfc/rfc2971.txt
Expected Behavior
Hermes Agent's email platform should:
IDcommand with client identityconfig.yamlor.envCurrent Behavior
IMAP login succeeds, but 163 immediately blocks subsequent operations with "Unsafe Login" error. SMTP works fine (using auth code).
Environment
Suggested Fix
In
hermes_agent/platforms/email/imap_client.py(or equivalent):Additional Context
Feature Request
Add a configuration option in
config.yaml: