What the message looks like
552 5.2.2 <anna@example.com>: Quota exceeded (mailbox for user is full)Common causes
- The mailbox reached the quota limit set in Dovecot.
- Trash and Sent are never emptied.
- Large attachments, or a sync client uploading mail twice.
- Quota rule set too small, e.g. a default value from a template.
- Less common: the filesystem itself is full or out of inodes.
Check
- Show usage and limit of the mailbox
doveadm quota get -u anna@example.com - Show size per folder
doveadm mailbox status -u anna@example.com 'messages vsize' '*' - Show the quota configuration in Dovecot
doveconf -n | grep -A5 -E '^plugin|quota' - Check space and inodes on the mail storage
df -h /var/vmail && df -i /var/vmail
Fix
- Raise the limit in the quota rule (e.g.
quota_rule = *:storage=10G) or set it per user via userdb. - Empty Trash automatically:
doveadm expunge -u anna@example.com mailbox Trash savedbefore 30d, as a cron job for all users with-A. - Set a tolerance with
quota_grace = 10%so one large message does not bounce right away. - Warn users before they hit the limit with
quota_warning. - After changes run
doveadm quota recalc -u anna@example.com.
Typical scenario
A customer tells support that her mail to anna@example.com came back with '552 5.2.2 Quota exceeded'. Anna's mailbox has collected attachments for years and her trash was never emptied. First check the fill level with doveadm quota get -u anna@example.com and use doveadm mailbox status -u anna@example.com messages vsize '*' to see which folder takes the most space. Often it is Trash or Sent.
FAQ
What is the difference between 552 5.2.2 and 452 4.2.2?
452 is temporary: the sender retries later. 552 is permanent and the message bounces. Dovecot uses the permanent code by default.
Can the sender do anything about it?
No. The problem is the recipient's mailbox. The sender can only let them know or resend later.
Is the message lost for the sender?
Not lost, but not delivered. The sender receives the bounce and has to send the message another way or try again later. Some servers report a temporary overrun as 4xx and retry automatically.
What can I do as the sender?
Tell the recipient through another channel and avoid large attachments. You cannot work around the quota. Wait until the recipient or their administrator has made room, then send again.
How do I prevent this as an administrator?
Configure warning levels with Dovecot's quota plugin, for example at 80 and 95 percent, so users get a message in time. In addition, the trash can be emptied automatically after a fixed period (doveadm expunge via cron).