Huge files in /var/vmail/*user*/Maildir/tmp/

Discussion in 'ISPConfig 3 Priority Support' started by macguru, Nov 29, 2020.

  1. macguru

    macguru Member HowtoForge Supporter

    Hi !

    Today I had run into low disk space condition, and found that we have been badly spammed
    find / -type f -printf "%s\t%p\n" | sort -n | tail -20
    reveal a LOT of same files of *same* size like:
    134203542 /var/vmail/*user*/Maildir/tmp/1606566109.M683566P25648.mail
    I have removed them manually, since these commands don't clean this stuff.
    doveadm expunge -A mailbox "*" all
    postsuper -d ALL
    I think its a bogus archive which freeze unarchiver when Amavis try to scan its content.
    Anyone had such problem before? Is there any way to purge ALL mail tmp except
    rm -Rf /var/vmail/*/*/Maildir/tmp/
    PS. Additionally, there is huge
    140737477881856 /proc/kcore
    But I don't think its a real file.
    Last edited: Nov 29, 2020
  2. macguru

    macguru Member HowtoForge Supporter

    As a temporary solution I wrote this shell/cron script, to be run every minute.
    Hope this helps someone else.
    Feedback appreciated.

    NOW=$(date +'%Y-%m-%d %T')
    if [ ! -f $LOGFILE ]; then
        touch $LOGFILE
        echo "$NOW : log file created" >> $LOGFILE
    CURRENT=$(df / | grep / | awk '{ print $5}' | sed 's/%//g')
    if [ "$CURRENT" -gt "$THRESHOLD" ] ; then
       echo "$NOW : Deleting bogus mail temp files" >> $LOGFILE
       rm -Rf /var/vmail/*/*/Maildir/tmp/*
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Amavis has it's own temp dir and does not use the tmp dir of the Maildir as far as I know, so I doubt that this is related to Amavis.

Share This Page