Why are there so many files in /var/spool/postfix/maildrop

We have CentOS 7 running, and previously had postfix installed (it is currently uninstalled). After removing postfix we checked the /var/spool/postfix/maildrop, as the df -h command was reporting over 9GB of usage in that directory.

There were hundreds of thousands of files in the directory (we removed them in order to free up space).

My question is, why were there so many files here? We had a lot of crons setup in the root crontab file, but shouldn't postfix have sent the cron result email files to the root users' mailbox?


Solution 1:

It could be anyone's guess as to what was putting them there, but I would suggest reading up on maildrop here: http://www.postfix.org/QSHAPE_README.html#maildrop_queue

Also, what was the content of the message files? This should be a huge clue as to what was dropping them off to sendmail per the link above.

Solution 2:

Most of the mails in /var/spool/postfix/maildrop directory are system generated. Hence even though postfix is disabled or stopped you may have thousands of mails in it. Most of the mails (99%) are generated due to crontab. When any job is executed and the jobs cannot run normally it will send an email to root. You can set MAILTO=”” variable at the start of your crontab file. This will also disable email alert. Edit/Open your cron jobs: $ crontab -e At the top of the file, enter: MAILTO=""