MBF Knowledge Base

I'm having intermittent problems with Cpanel based emails. My users are getting bounces with the error "retry timeout exceeded".

The email log is showing the following error: /tmp directory - No space left on device. Usually, this resolves itself after x minutes.

What is causing this and how do I resolve it?

A particularly tricky problem with mail processing, delivery, and retrieval may be seen on systems that use disk quotas. Specifically, it will manifest as errors about disk space, even on a disk with plenty of free space.

This can happen because of a few different reasons. The two most popular reasons for this are:

1.) ClamAV processing causes delivery to fail.

Because mail processing with SpamAssassin and ClamAV can be temporarily very disk space intensive, it can run into disk quotas while it will appear that disk usage is still well below the limit you've imposed.

The solution to this problem is to mount the /tmp directory that clamav or clamd are configured to use on a partition separate from /home. This will allow clam to use as much space as it needs in order to decompress files and process them.

It is recommended that all installations that will use disk quotas to use an independent /home partition--that is separate from /, /tmp/, and /var directories.

 

2.) Dovecot won't allow mail retrieval if disk quota is filled.

This is caused by the inability of Dovecot to manage its index files on a "full" disk. Dovecot can be configured to place indexes in a different location from the mailbox, which resolves this problem (though it does mean users can use slightly more than their disk quota on the system, but indexes are generally pretty small, so this shouldn't be a big concern).

To configure Dovecot to use an alternate location for index files, you can set the following in the dovecot.conf:

default_mail_env = maildir:%h/Maildir:INDEX=/var/cache/dovecot/index/%u:CONTROL=/var/cache/dovecot/control/%u

Or (depending on the Dovecot version):

mail_location = maildir:%h/Maildir:INDEX=/var/cache/dovecot/index/%u:CONTROL=/var/cache/dovecot/control/%u

This will tell Dovecot to use a different filesystem for those control and index files that it is having trouble writing to. Just make sure you create /var/cache/dovecot/index and /var/cache/dovecot/control first, and make them mode 6777.

Then re-start the Dovecot server.