Atmail increasingly uses disk space due to tmp files

Written by - 0 comments

Published on - Listed in Linux Mail


In the past days I've been wondering about the following graph, which shows the root partition (/) of an Atmail server:

As you can see, the disk usage continuously grew over time but I didn't know why. I especially separated user mails, logs and MySQL databases to their own mountpoint and their own LV - but something was still eating up the root partition.

After a few du's, I finally got the reponsible directory: /usr/local/atmail/webmail/tmp. This seems to be the Atmail-internal tmp folder for the uploaded mail attachments in Atmail webmail. There were many old files, which obviously were never deleted. But why the heck would these files stay in a tmp folder?

While looking for an answer, I came across this Atmail Wiki post called "Performance Improvements":

Atmail Wiki delete tmp folders

Unfortunately I do not know, how old this Wiki post is because on my current Atmail installation (6.6.0) the code looks completely different in application/modules/mail/controllers/AuthController.php:

//remove users tmp folder
//but only if not using memcache
$global = Zend_Registry::get('config')->global;
$useMemcache = (array_key_exists('cacheType', $global) && $global['cacheType'] == 'memcache');
if(!$useMemcache)
{
     $usersTmpFolder = users::getTmpFolder();
     self::removeFolderRecursive($usersTmpFolder);
}

The problem is, that the tmp files are not deleted if Memcache is activated in the Atmail settings. For whatever reason this might be...

Solution: Create a daily cronjob to delete old tmp files, e.g.:

find /usr/local/atmail/webmail/tmp -type f -mtime +7 -exec rm {} +

Update December 4th 2012:
Atmail acknowledged this bug and told me that a fix will become available in a later release of Atmail.


Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.

RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder