how to pack the database?

If I delete some large emails, the database files remain the same size. Is there a way to pack the database to remove unused space?

The database compacts itself - it is an automatic process which starts when there are no other processes with higher priority running.