Skip to content
Arbinel

E-mail quota

The e-mail quota limits how many notification e-mails Arbinel sends on behalf of each user or organization per calendar month. It protects the instance’s mail provider quota and sender reputation from a single owner, so that activation and password reset mails keep reaching everyone. Read Quotas first, because e-mail limits are ordinary quota rules, and E-mail counts for how Arbinel counts mails.

Write e-mail limits as rules on the mail:all subject, with the limit as a plain number of e-mails.

curl -X POST -H "Authorization: token $TOKEN" -H "Content-Type: application/json" \
  https://forge.example.com/api/v1/admin/quota/groups \
  -d '{"name": "free", "rules": [{"name": "E-mail notifications", "limit": 2000, "subjects": ["mail:all"]}]}'

To add the rule to a group that already exists, create the rule with POST /api/v1/admin/quota/rules and add it with PUT /api/v1/admin/quota/groups/{group}/rules/{rule}.

  • mail:all has a unit of its own, e-mails. A rule cannot mix it with size:, time: or egress:all subjects, and a group with only e-mail rules does not affect storage, CI time or downloads.
  • There is no instance-wide fallback. An owner whose groups have no mail:all rule has no e-mail limit.
  • Across groups, the most generous rule wins, as for every quota. To exempt one owner, add them to a group with a mail:all rule of -1 next to their other groups.
  • Usage resets when a new UTC month starts.

mail:all counts the e-mails of these kinds that Arbinel sent this month, for the owner each one counts for:

Kind Counts for
Issue and pull request notifications The owner of the repository
Release notifications The owner of the repository
Collaborator and transfer notifications The owner of the repository
Failed Actions runs The owner of the repository
Team invitations The organization

These kinds never count and are always sent, even when the owner is over their limit:

  • account and security mails, such as activation, password resets and security notices,
  • notices to the instance admins,
  • quota warnings.

Before Arbinel sends a notification of a counted kind, it checks the owner’s mail:all rules. Once the owner has reached the limit, Arbinel drops the mail instead of sending it, and logs how many it dropped. A dropped mail is not counted and is not sent later. The web notifications in the inbox are not affected.

Arbinel checks each owner once per batch of the mail queue and only reads the e-mail counts, so the check stays cheap. If Arbinel cannot read the owner’s rules or counts, it sends the mail.

While [quota] ENABLED is false, Arbinel sends every mail.

Arbinel mails the owner when they reach 80% and 100% of a mail:all rule, once each per month. The mail goes to the user, or to every member of an organization’s Owners team, and links to the owner’s Usage page. It is a quota warning, so it is always sent and never counts.

The E-mails sent section of the owner’s Usage page shows each mail:all rule with the e-mails counted, the limit and the date the usage resets. A rule at its limit is marked Limit reached.

A fixed billing product can raise mail:all. Its AMOUNT is a plain number of e-mails per unit, which is added to the limit every month.

[billing.product.mail-10k]
CREEM_PRODUCT_ID = prod_xxx
NAME = 10,000 notification e-mails
SUBJECTS = mail:all
AMOUNT = 10000
MAX_UNITS = 10

The Add-ons tab shows the amount as “10,000 e-mails”. Quota grants on mail:all also add a plain number of e-mails.