管理

导入邮箱

—
📭

还没有导入邮箱

在上方粘贴邮箱地址或上传文件开始使用

API 调用文档

所有接口均为 POST/GET + JSON。普通用户接口需要先建立会话, 请求头携带 X-Client-Id,并附时间戳 _ts。

一、完整调用流程

1. POST /api/session          建立会话,拿到 clientId
2. POST /api/check            (可选)校验邮箱是否存在
3. POST /api/import           导入邮箱,绑定到本会话
4. POST /api/codes            轮询取验证码
5. GET  /api/mail?id=&address=   取邮件完整正文

二、接口详情

三、完整示例

Node.js / axios

const axios = require('axios');
const BASE = 'https://mail.banzhuan.net.cn';
let cid = '';

const H = () => ({ 'Content-Type': 'application/json', 'X-Client-Id': cid });

(async () => {
  // 1. 建立会话
  const s = await axios.post(BASE + '/api/session');
  cid = s.data.clientId;
  console.log('会话:', cid);

  // 2. 校验邮箱是否存在(不创建)
  const ck = await axios.post(BASE + '/api/check', {
    addresses: ['steam@banzhuan.net.cn'],
  }, { headers: { 'Content-Type': 'application/json' } });
  console.log('存在?', ck.data.results[0].exists);

  // 3. 导入邮箱
  const im = await axios.post(BASE + '/api/import', {
    addresses: ['steam'],
    _ts: Date.now(),
    _hp: '',
  }, { headers: H() });
  console.log('导入:', im.data.imported);

  // 4. 轮询验证码
  const timer = setInterval(async () => {
    const r = await axios.post(BASE + '/api/codes', {
      all: true, _ts: Date.now(), _hp: '',
    }, { headers: H() });

    const hit = r.data.results.find(x => x.code);
    if (hit) {
      console.log('验证码:', hit.code);
      clearInterval(timer);
    } else {
      // 没提取到验证码时,body/preview 里有原文
      const mail = r.data.results.find(x => x.mailCount > 0);
      if (mail) console.log('收到邮件但无验证码,摘要:', mail.preview);
    }
  }, 5000);
})();

Python / requests

import requests, time

BASE = 'https://mail.banzhuan.net.cn'
s = requests.Session()
cid = s.post(BASE + '/api/session').json()['clientId']
H = {'X-Client-Id': cid, 'Content-Type': 'application/json'}

s.post(BASE + '/api/import', headers=H,
       json={'addresses': ['steam'], '_ts': int(time.time()*1000), '_hp': ''})

for _ in range(20):
    time.sleep(5)
    r = s.post(BASE + '/api/codes', headers=H,
               json={'all': True, '_ts': int(time.time()*1000), '_hp': ''}).json()
    for item in r['results']:
        if item['code']:
            print('验证码:', item['code'])
            raise SystemExit
        if item['mailCount']:
            print('原文:', item['preview'])

纯 cURL

BASE=https://mail.banzhuan.net.cn
TS=$(date +%s000)

# 建会话
CID=$(curl -s -X POST $BASE/api/session -c /tmp/ck | jq -r .clientId)

# 导入
curl -s -X POST $BASE/api/import -b /tmp/ck \
  -H 'Content-Type: application/json' -H "X-Client-Id: $CID" \
  -d "{\"addresses\":[\"steam\"],\"_ts\":$TS,\"_hp\":\"\"}"

# 取验证码
curl -s -X POST $BASE/api/codes -b /tmp/ck \
  -H 'Content-Type: application/json' -H "X-Client-Id: $CID" \
  -d "{\"all\":true,\"_ts\":$TS,\"_hp\":\"\"}"

四、错误码

HTTP含义处理建议
401会话失效重新 POST /api/session
403越权访问他人邮箱该邮箱未绑定到当前会话
404邮箱或邮件不存在检查地址拼写
429触发限速降低轮询频率,等待 1 分钟
400参数错误检查是否缺少 _ts 或地址格式

五、限制说明

  • 单个浏览器最多绑定 200 个邮箱
  • 邮件保留 6 小时,单邮箱最多 20 封
  • 限速:查询 120 次/分钟、导入 20 次/分钟(按会话计算)
  • 单封邮件最大 2MB
  • 只有已登记的邮箱才收信(白名单),其余返回 550

使用说明

一、开始使用

  1. 把邮箱地址粘贴到输入框,或上传 .txt 文件(每行一个)
  2. 点「校验」可先确认哪些邮箱在数据库中存在
  3. 点「导入并查询」,只有已存在的邮箱才会被绑定并显示
  4. 把 前缀@域名 填到需要收验证码的网站
  5. 收件箱会自动刷新(5 秒),有验证码就显示码,没有则显示邮件原文

二、邮箱从哪来

本服务采用白名单模式:只有已登记的邮箱才能收信。管理员在 管理后台批量创建,用户再导入使用。

导入时若邮箱不存在,会明确提示「N 个邮箱不存在」,不会静默创建。

三、验证码提取规则

提取采用加权规则,命中平台特定格式或带关键词时优先。对普通营销邮件不会误报:

  • 自动排除年份(2026 不是验证码)
  • 排除编号类:订单号、发票号、运单号、金额、日期
  • 排除 #202-8891234 这类带连字符的长串
  • 排除 7–8 位疑似银行卡号

如果没提取出来,列表会直接显示邮件原文摘要,点「原文」看全文。

四、数据与隐私

  • 邮箱归属绑定在服务端会话,A 浏览器导入的邮箱 B 看不到
  • 本地只存邮箱地址列表,邮件内容仅存服务器
  • 邮件 6 小时后自动清理
  • 限流、蜜罐、目录穿越防护均已启用

五、常见问题

导入提示「邮箱不存在」

该邮箱未在数据库登记。让管理员在管理后台创建后再导入。

一直显示「等待中」

确认对方网站已提交邮箱。若对方拒绝 @banzhuan.net.cn 域名的邮件,则收不到。

有邮件但没验证码

该邮件不含数字验证码,列表会显示原文,可点「原文」查看。

提示 429

请求太频繁,等待 1 分钟再试。