# ewomail **Repository Path**: jakenik/ewomail ## Basic Information - **Project Name**: ewomail - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-15 - **Last Updated**: 2026-04-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # EwoMail API 接口文档 Base URL: `http://115.190.214.161:8000/api.php` 所有接口均为 POST 请求,`Content-Type: application/json`。 --- ## 1. 获取邮件列表 ``` POST /api.php ``` **请求参数:** | 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | email | string | ✅ | 邮箱地址 | | password | string | ✅ | 邮箱密码 | | folder | string | ❌ | 文件夹,默认 `INBOX` | | limit | int | ❌ | 返回条数,默认 `10` | **示例:** ```bash curl -s -X POST http://115.190.214.161:8000/api.php \ -H 'Content-Type: application/json' \ -d '{"email":"13651010441@e.ddy.sh.cn","password":"13651010441","limit":5}' ``` **返回:** ```json { "code": 200, "msg": "success", "data": { "email": "13651010441@e.ddy.sh.cn", "folder": "INBOX", "total": 2, "count": 2, "emails": [ { "id": 2, "uid": 2, "size": 12368, "flags": "\\Seen", "subject": "WPS账号验证码", "from": "WPS云办公 ", "to": "13651010441@e.ddy.sh.cn", "cc": "", "date": "Wed, 15 Apr 2026 18:55:17 +0800", "message_id": "", "content_type": "text/html; charset=\"utf-8\"" } ] } } ``` --- ## 2. 获取邮件详情 ``` POST /api.php ``` **请求参数:** | 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | email | string | ✅ | 邮箱地址 | | password | string | ✅ | 邮箱密码 | | action | string | ✅ | 固定值 `content` | | uid | int | ⚠️ | 邮件 UID(与 id 二选一) | | id | int | ⚠️ | 邮件序号(与 uid 二选一) | **示例:** ```bash curl -s -X POST http://115.190.214.161:8000/api.php \ -H 'Content-Type: application/json' \ -d '{"email":"13651010441@e.ddy.sh.cn","password":"13651010441","action":"content","uid":2}' ``` **返回:** ```json { "code": 200, "msg": "success", "data": { "id": 2, "uid": 2, "size": 12368, "flags": "\\Seen", "subject": "WPS账号验证码", "from": "WPS云办公 ", "to": "13651010441@e.ddy.sh.cn", "cc": "", "date": "Wed, 15 Apr 2026 18:55:17 +0800", "content_type": "text/html; charset=\"utf-8\"", "body_html": "...", "body_text": "", "body_raw_base64": "UEG..." } } ``` --- ## 3. 获取原始邮件 ``` POST /api.php ``` **请求参数:** | 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | email | string | ✅ | 邮箱地址 | | password | string | ✅ | 邮箱密码 | | action | string | ✅ | 固定值 `raw` | | uid | int | ⚠️ | 邮件 UID(与 id 二选一) | | id | int | ⚠️ | 邮件序号(与 uid 二选一) | **示例:** ```bash curl -s -X POST http://115.190.214.161:8000/api.php \ -H 'Content-Type: application/json' \ -d '{"email":"13651010441@e.ddy.sh.cn","password":"13651010441","action":"raw","uid":2}' ``` **返回:** ```json { "code": 200, "msg": "success", "data": { "raw_base64": "UEG...", "size": 12368 } } ``` --- ## 4. 创建邮箱账号 ``` POST /api.php ``` **无需鉴权**,直接传 email 和 password 即可创建。 **请求参数:** | 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | email | string | ✅ | 邮箱地址(需包含已存在的域名) | | password | string | ✅ | 密码(8-20 位) | | action | string | ✅ | 固定值 `create_user` | **示例:** ```bash curl -s -X POST http://115.190.214.161:8000/api.php \ -H 'Content-Type: application/json' \ -d '{"email":"newuser@e.ddy.sh.cn","password":"MyPass1234","action":"create_user"}' ``` **成功返回:** ```json { "code": 200, "msg": "success", "data": { "id": 6, "email": "newuser@e.ddy.sh.cn", "maildir": "/ewomail/mail/vmail/e.ddy.sh.cn/n/e/w/newuser.20260415" } } ``` **错误返回:** | code | msg | 说明 | |------|-----|------| | 400 | Missing email or password | 缺少必填参数 | | 400 | Invalid email format | 邮箱格式错误 | | 400 | Password must be 8-20 characters | 密码长度不符合要求 | | 400 | Domain not found: xxx | 域名不存在 | | 400 | Email already exists | 邮箱已存在 | | 500 | Database connection failed | 数据库连接失败 | | 500 | Failed to create user | 创建用户失败 | --- ## 通用错误码 | code | 说明 | |------|------| | 200 | 成功 | | 400 | 参数错误 | | 401 | 邮箱认证失败 | | 404 | 邮件不存在 | | 500 | 服务器内部错误 |