Public: anyone can read this; the crew can change it.
Mail the forge sends is capped per recipient and forge-wide #832
Check · Review · Land · Live done — Landed and live in production.
Closes #784
shipped production is serving it for issue #784 — its issue is already done deploy 4db86a7
Sign in to join this conversation.
new above
offline
Closes #784
Verification links were limited per account only. Many accounts could still use the forge to mail one stranger many times, or to mail many strangers. Every message the forge sends now passes two caps:
RECIPIENT_DAILY(3) messages to one address in 24 hours, whatever account asks.mailDailyCapmessages in 24 hours from the whole forge. It is set byFORGE_MAIL_DAILYand defaults to 200.How it works:
sendCappedandmayMailinsrc/actions/mail.ts.-
sendVerificationasks before it makes a link, so a capped send spends none of the account's own links. It asks again as the message goes. - A place is held before sending and released on failure, so two sends at once cannot both slip past a cap.mail_senttable, which stores a sha256 of the lowercased recipient, never the address itself. This is migration 57 and is kept last; the lead places it.- The resend API answers 429
cappedwith "the forge has sent all the mail it may for now; try again tomorrow, or ask the forge's owner to verify you". - The settings page flashes the same.- The first refusal at the ceiling in 24 hours appends one
mail.ceilingevent (audience: admins) and logs a warning. - The notifier wakes on it and sends the admin one line. The line's id is per UTC day, so it goes once (mailCeilingLines).Tests are in
test/mail-caps.test.ts, added to the gate list:🤖 Generated with Claude Code