Skip to content

How to Fix Postfix Mailbox Full Error

DodaTech Updated 2026-06-24 2 min read

In this tutorial, you'll learn about How to Fix Postfix Mailbox Full Error. We cover key concepts, practical examples, and best practices.

Postfix returns mailbox is full or quota exceeded when delivering mail to local users — the mailbox has reached its storage limit or the disk where mail is stored is full.

The Problem

Jun 24 10:00:00 mail postfix/local[1234]: 9A1B2C3D4E5F:
to=<user@example.com>, relay=local, delay=0.5,
status=bounced (mailbox is full)

Step-by-Step Fix

Step 1: Check disk space

df -h /var/mail
df -h /var/spool/mail

Step 2: Check user mailbox size

sudo du -sh /var/mail/user
# Or for maildir format
sudo du -sh /home/user/Maildir/

Step 3: Clear the mailbox

# Move old emails to archive
sudo mv /var/mail/user /var/mail/user.old

# Or truncate (backup first!)
# Create a new empty mailbox
sudo touch /var/mail/user
sudo chown user:mail /var/mail/user

Step 4: Set mailbox size limits

# /etc/postfix/main.cf
mailbox_size_limit = 512000000    # 512 MB
virtual_mailbox_limit = 512000000
message_size_limit = 25600000     # 25 MB

Step 5: Configure quota warnings

# Install quota tools
sudo apt-get install quota

# Send warning when 90% full
sudo quota -w 90%

Step 6: Set up automatic cleanup

# Create a cron job to clean old emails
0 3 * * * find /var/mail -name "cur/*" -mtime +180 -delete

Prevention Tips

  • Set realistic mailbox_size_limit values in main.cf
  • Monitor disk usage on mail partitions with alerts at 80%
  • Use Maildir format for easier per-user quota management
  • Archive old emails automatically with cron

Common Mistakes with mailbox full

  1. Non-exhaustive pattern matches that compile with warnings then crash at runtime
  2. Misunderstanding that String is [Char] with poor performance for large text operations
  3. Using foldl instead of foldl' causing stack overflow on large lists

These mistakes appear frequently in real-world POSTFIX code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### What is the difference between mailbox_size_limit and virtual_mailbox_limit?

mailbox_size_limit applies to local Unix mailboxes in mbox format. virtual_mailbox_limit applies to virtual mailboxes in Maildir format. Set both to the same value if you use both local and virtual mailboxes.

How do I check a user's current mailbox usage?

For mbox format: ls -lh /var/mail/username. For Maildir format: du -sh /home/username/Maildir/. Compare the size to the configured limits in main.cf to determine if the quota is exceeded.

Can Postfix automatically delete old emails?

Postfix does not delete emails from mailboxes. Use external tools like find -delete, doveadm expunge, or maildirmake for quota enforcement. Set up a cron job to archive or delete emails older than a configurable threshold.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro