configure_email_server
Manually configure email server settings for sending and receiving emails. Specify SMTP and IMAP parameters like host, port, security, and credentials to connect email accounts.
Instructions
手动配置邮箱服务器设置(高级用户使用)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| smtpHost | No | SMTP服务器地址 | |
| smtpPort | No | SMTP端口 | |
| smtpSecure | No | 是否使用SSL | |
| imapHost | No | IMAP服务器地址 | |
| imapPort | No | IMAP端口 | |
| imapSecure | No | 是否使用SSL | |
| user | Yes | 邮箱账号 | |
| password | Yes | 邮箱密码或授权码 |
Implementation Reference
- index.js:1043-1073 (handler)The core handler function for the 'configure_email_server' tool. It destructures the input arguments and updates the corresponding environment variables for SMTP and IMAP configurations. Then it constructs a summary of the updated configuration and returns it as a text response.
async configureEmailServer(args) { const { smtpHost, smtpPort, smtpSecure, imapHost, imapPort, imapSecure, user, password } = args; // 更新环境变量 if (smtpHost) process.env.EMAIL_SMTP_HOST = smtpHost; if (smtpPort) process.env.EMAIL_SMTP_PORT = smtpPort.toString(); if (smtpSecure !== undefined) process.env.EMAIL_SMTP_SECURE = smtpSecure.toString(); if (imapHost) process.env.EMAIL_IMAP_HOST = imapHost; if (imapPort) process.env.EMAIL_IMAP_PORT = imapPort.toString(); if (imapSecure !== undefined) process.env.EMAIL_IMAP_SECURE = imapSecure.toString(); if (user) process.env.EMAIL_USER = user; if (password) process.env.EMAIL_PASSWORD = password; let configInfo = '邮箱配置已更新:\n'; configInfo += `SMTP服务器: ${process.env.EMAIL_SMTP_HOST || '未设置'}\n`; configInfo += `SMTP端口: ${process.env.EMAIL_SMTP_PORT || '未设置'}\n`; configInfo += `SMTP SSL: ${process.env.EMAIL_SMTP_SECURE || '未设置'}\n`; configInfo += `IMAP服务器: ${process.env.EMAIL_IMAP_HOST || '未设置'}\n`; configInfo += `IMAP端口: ${process.env.EMAIL_IMAP_PORT || '未设置'}\n`; configInfo += `IMAP SSL: ${process.env.EMAIL_IMAP_SECURE || '未设置'}\n`; configInfo += `用户: ${user || '未更新'}`; return { content: [ { type: 'text', text: configInfo } ] }; } - index.js:282-319 (schema)Input schema definition for the 'configure_email_server' tool, specifying properties for SMTP and IMAP server configurations, user credentials, with required fields 'user' and 'password'.
inputSchema: { type: 'object', properties: { smtpHost: { type: 'string', description: 'SMTP服务器地址' }, smtpPort: { type: 'number', description: 'SMTP端口' }, smtpSecure: { type: 'boolean', description: '是否使用SSL' }, imapHost: { type: 'string', description: 'IMAP服务器地址' }, imapPort: { type: 'number', description: 'IMAP端口' }, imapSecure: { type: 'boolean', description: '是否使用SSL' }, user: { type: 'string', description: '邮箱账号' }, password: { type: 'string', description: '邮箱密码或授权码' } }, required: ['user', 'password'] } - index.js:279-320 (registration)Tool registration in the list of available tools returned by ListToolsRequestSchema, including name, description, and input schema.
{ name: 'configure_email_server', description: '手动配置邮箱服务器设置(高级用户使用)', inputSchema: { type: 'object', properties: { smtpHost: { type: 'string', description: 'SMTP服务器地址' }, smtpPort: { type: 'number', description: 'SMTP端口' }, smtpSecure: { type: 'boolean', description: '是否使用SSL' }, imapHost: { type: 'string', description: 'IMAP服务器地址' }, imapPort: { type: 'number', description: 'IMAP端口' }, imapSecure: { type: 'boolean', description: '是否使用SSL' }, user: { type: 'string', description: '邮箱账号' }, password: { type: 'string', description: '邮箱密码或授权码' } }, required: ['user', 'password'] } }, - index.js:356-357 (registration)Dispatcher case in the CallToolRequestSchema handler that routes calls to the 'configure_email_server' handler method.
case 'configure_email_server': return await this.configureEmailServer(args);