Email & webmail

Email archiving and retention: keep mailboxes small and compliant

Plan email retention and archiving: why mailboxes grow, archive vs backup, automatic expunge rules, exporting old mail, legal and GDPR considerations, and server-side tools.

IntermediateEmail accounts and mail servers2 min read

Mailboxes grow forever unless someone decides otherwise. Big mailboxes slow down mail apps, fill quotas and make backups and migrations painful, while some mail must be kept for legal reasons. An email retention and archiving policy solves both sides. This guide shows how to plan one.

Before you start

Find out what you are legally required to keep (for example invoices and contracts often have fixed retention periods depending on your country) and what you must not keep longer than necessary under privacy laws such as GDPR. If in doubt, ask your accountant or legal adviser.

Archive vs backup

BackupArchive
PurposeRecover from loss or damageLong-term retention and search
RetentionDays to weeks, rotatingYears, per policy
Mailbox stays…UnchangedSmaller (old mail moved out)
ExampleDaily JetBackup snapshots on MdmHostExported yearly folders, archive mailbox

Write a simple retention policy

  1. Trash and Junk: delete automatically after 30 days.
  2. General mail: keep in the mailbox for 1–2 years.
  3. Business records: move to an archive and keep for the legally required period.
  4. Personal data: delete when no longer needed.
  5. Leavers: export or convert the mailbox to a shared archive, then remove the account.

Auto-clean Trash and Junk

  • Dovecot (self-managed): schedule doveadm expunge -A mailbox Trash savedbefore 30d and the same for Junk with cron.
  • cPanel: many mail apps and Roundcube can empty Trash on logout; server-side, cPanel offers automatic deletion of old Trash/Spam for accounts in recent versions under email account settings, depending on configuration.

Archive old mail

  • Archive folders: mail apps such as Thunderbird and Outlook can move mail older than X into yearly archive folders.
  • Local export: export old folders to files (MBOX, PST) stored with your backups.
  • Separate archive mailbox: move old mail into a dedicated archive account using IMAP or imapsync.
  • Dedicated archiving services: journal copies of all mail with search and legal hold, useful for regulated businesses.

Keep quotas healthy

  • Large attachments use the most space – share files via links instead.
  • Check mailbox size in cPanel → Email → Email Accounts or with doveadm quota get -u user.
  • Warn users before quotas fill up.

GDPR and privacy

  • Keep personal data only as long as necessary for its purpose.
  • Document your retention periods.
  • Make sure archives and backups are secured and access-controlled.
  • Have a process to find and delete personal data on request where required.

FAQ: email archiving and retention

Is a backup enough for compliance?

Usually not. Backups rotate and are hard to search; retention requirements generally need a dedicated archive.

How large should a mailbox be?

Smaller is faster. Many organisations keep active mailboxes under a few gigabytes and archive the rest.

Can I recover mail deleted by an expunge rule?

Only from backups within their retention window – set rules carefully and communicate them to users.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.