导入邮箱
收件箱 0
| 邮箱地址 | 验证码 / 内容 | 主题与发件人 | 最后收信 | 操作 |
|---|
还没有导入邮箱
在上方粘贴邮箱地址或上传文件开始使用| 邮箱地址 | 验证码 / 内容 | 主题与发件人 | 最后收信 | 操作 |
|---|
还没有导入邮箱
在上方粘贴邮箱地址或上传文件开始使用
所有接口均为 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= 取邮件完整正文
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);
})();
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'])
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 或地址格式 |
.txt 文件(每行一个)前缀@域名 填到需要收验证码的网站本服务采用白名单模式:只有已登记的邮箱才能收信。管理员在 管理后台批量创建,用户再导入使用。
导入时若邮箱不存在,会明确提示「N 个邮箱不存在」,不会静默创建。
提取采用加权规则,命中平台特定格式或带关键词时优先。对普通营销邮件不会误报:
2026 不是验证码)#202-8891234 这类带连字符的长串如果没提取出来,列表会直接显示邮件原文摘要,点「原文」看全文。
该邮箱未在数据库登记。让管理员在管理后台创建后再导入。
确认对方网站已提交邮箱。若对方拒绝 @banzhuan.net.cn 域名的邮件,则收不到。
该邮件不含数字验证码,列表会显示原文,可点「原文」查看。
请求太频繁,等待 1 分钟再试。