메일 서비스(사이트 대표·독립)·메일함·사용량·보안·전환·보존과 AriMail 도입 수정(KST 월 경계, 발신 키 오류, 도메인별 보장량, 100% 제한, 발송 큐·속도, 운영 상태, SSO) (§15~§18·§0.4)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
zzabisagent-lab
2026-10-26 11:47:45 +00:00
co-authored by Claude Fable 5.1
parent a014e3cd05
commit a1cde81332
26 changed files with 1610 additions and 37 deletions
+3 -2
View File
@@ -119,7 +119,7 @@ await t('0004 마이그레이션은 기존 만료일을 비우고 Resend 형식
for (const f of readdirSync(all).filter((x) => x < '0004')) copyFileSync(join(all, f), join(old, f));
const db = openDb(':memory:'); migrate(db, old, { quiet: true });
db.prepare("INSERT INTO messages(id,direction,folder,received_at,sent_at,created_at,updated_at,expires_at) VALUES('m1','outbound','sent','2026-09-28 06:20:26.514000+00','2026-09-28 06:20:26.514000+00','x','x','2026-10-28T06:20:26.514Z'),('m2','inbound','inbox','2026-09-28T07:00:00.000Z',NULL,'x','x','2026-10-28T07:00:00.000Z')").run();
eq(migrate(db, all, { quiet: true }), 5, '0004·0005·0006·0007·0008 적용');
eq(migrate(db, all, { quiet: true }), 6, '0004·0005·0006·0007·0008·0009 적용'); // [Ariweb Suite 변경] 0009 발송 대기열
const rows = db.prepare('SELECT id,received_at,sent_at,expires_at FROM messages ORDER BY received_at DESC').all();
eq(rows.map((r) => r.id).join(','), 'm2,m1', '정렬이 실제 시각 순서');
eq(rows[1].received_at, '2026-09-28T06:20:26.514Z', 'received_at ISO'); eq(rows[1].sent_at, '2026-09-28T06:20:26.514Z', 'sent_at ISO');
@@ -813,7 +813,8 @@ await t('0.9.0 제한: 시스템(환경)·관리자·계정별 메일함 크기,
const d4 = await saveDraft(env, { to: 'a@example.test', subject: '월간', html: '<p>x</p>' });
r = await api(env, 'mail/' + d4 + '/send', cookie, 'POST', {}); const e4 = await r.json(); eq(e4.error, 'monthly_limit_exceeded', '월간 초과'); eq(e4.limit, 5, '상한');
await writePrefs(env, { id: 'www:admin-1', mailbox: 'admin@arihakdang.com' }, { forward: { enabled: true, to: 'fw@example.test' } });
env.RESEND_FETCH = fakeResend({ received: [sample('q3')] }); const q3 = await ingestReceived(env, 'q3'); eq(q3.auto?.forward?.detail, 'limit', '자동 전달 건너뜀(월간 한도)');
// [Ariweb Suite 변경] 월간 통수 100% 에서는 새 수신도 임시 거부(skipped='monthly_limit', 보낸 서버가 재시도)합니다(Dev-Order §13.4). 예전에는 받되 자동 전달만 건너뛰었습니다.
env.RESEND_FETCH = fakeResend({ received: [sample('q3')] }); const q3 = await ingestReceived(env, 'q3'); eq(q3.skipped, 'monthly_limit', '월간 한도에서 새 수신 임시 거부');
// 현황
const st = await mailStats(env, await knownMailboxes(env), await listUsers(env));
eq(st.timezone, 'Asia/Seoul', '시간대'); ok(st.periods.month.total >= 5, '월간 합계'); ok(st.periods.day.received >= 1, '일일 수신');