Cant send emails receive error - forbiddenToSend

Your question

version 0.16.25 and 0.16.26

Receive the following error for any account on the system when an attempt is made to send mail:
Server rejected DATA: 452 4.3.1 Mail system full, try again later. [forbiddenToSend]

Issue started occurring suddenly. No system changes. All was working before. Pls assist asap.

This error means a configured queue quota (message count or size limit) has been exceeded, so new messages are being rejected with 452 4.3.1 Mail system full. This usually happens when the outbound queue has built up a backlog (e.g. due to a delivery problem to some destination, DNS/connectivity issue, or a stuck/looping message) that pushed it past a configured quota, rather than an actual disk-full condition.

To resolve it:

  1. Check the message queue in the WebUI (or via stalwart-cli) to see how many messages are queued and whether a large backlog has built up, possibly stuck retrying delivery to one domain.
  2. Check Settings → MTA → Rates & Quotas → Queue Quotas for any configured messages or size limits that may now be exceeded given your current queue size.
  3. Either clear/retry the stuck messages to bring the queue back under quota, or raise the quota limits if your legitimate traffic volume has grown.

Reference: Queue Quotas

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

That 452 has nothing to do with disk space. “Mail system full” is what Stalwart returns when a queue quota is exceeded, and JMAP reports it to the client as forbiddenToSend. 0.16.25 fixed a bug where queue quotas without a match condition were never enforced, and that includes the global queue quota created on first start. So from 0.16.25 on, a quota that sat there doing nothing before is now being checked, which is why it started right after the upgrade with no config change.

Go to Settings › MTA › Rates & Quotas › Queue Quotas and look at what’s defined there, and compare it with the number and total size of messages in the queue. Your log should also have a queue.quota-exceeded event naming the quota that tripped. If the queue really is near the limit, the thing to fix is whatever is piling up in it (deliveries stuck on retry, bounces); if it’s nearly empty and the quota still trips, please post the log event and your quota list here, because that points at the quota counter itself. To get mail flowing now, raise the limits on that quota or disable it (Quotas | Stalwart).

There is nothing in the log. The log is empty.

I have had to disable the quota as you suggested but I am still not clear on the cause.

We have less that 25 users and less than 5GB of data on a 300GB disk.

Let me know if you need anything else.

Disabling it is fine as a workaround. Disk space and mailbox data don’t come into it: that quota only counts messages waiting in the outbound queue. The one Stalwart creates on first start allows 100,000 messages and 10 GB, and a server with 25 users shouldn’t get anywhere near either, so I suspect the usage counter behind the quota is off and the queue itself was never full.

What limits did that quota show before you disabled it, and how many messages are in the queue right now? If it still had the default limits and the queue is close to empty, that confirms the counter drifted, and I’ll dig into how it got there.

I am not certain how to determine queue size.

However going by the value displayed in the Dashboard under “Queued Messages” is just 5.

The current settings are the defaults Stalwart has shipped with.

Thanks, that settles it. Five queued messages against a 100,000 message limit means the counter is wrong; the queue was never full.

I found the bug in the quota check. From 0.16.25 to 0.16.27 Stalwart reads the queue quota counters as unsigned numbers, but they’re stored signed. If the counter ever drops below zero (which happens when a reservation is released twice), the check reads it as an enormous value, and every message after that fails with “Mail system full”. It went unnoticed before 0.16.25 because the default quota wasn’t being checked at all, as I mentioned earlier.

1.0 rewrote queue quota accounting. Reservations and the limit check are done atomically by the store and compared as signed values, so a counter below zero can’t block mail anymore. There won’t be a 0.16 release with the fix, so I’d keep the quota disabled on 0.16 (with 25 users you won’t miss it) and turn it back on once you’re on 1.0. Upgrading from 0.16 to 1.0 is a migration with stalwart-migrate, not an in-place update; the upgrade guide walks through it.