Mail Service not properly uninstalled creating huge files

Posted July 3, 2014 1.8k views

Hi, recently I faced a problem that my database was down and I couldnt really start it. I researched all the possible reasons for it until I found that I was using all the 20Gb I have. Then I figured out that the folder /var/mail was taking all the space with two files only.

As I dont use email on my server, I simply deleted one of the files and I dont think its gonna be a problem. At least nothing happened yet.

This problem was caused cos some time ago I tried installing an email application (postfix and similar) and installed some of them. The problem is that I dont really remember which ones Ive installed and which ones I uninstalled. So one of them might be still installed taking allllll the space from my droplet.

My question is: Does anyone know how to list all applications I have installed or know a way to find out which application is creating these huge files (19Gb, yeah) in /var/mail?

I’m totally newbie on linux matters, so I might have done something wrong. :(
Thanks in advance!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

If you could point to a tutorial you followed, we could tell you how to undo it.

On a Debian or Ubuntu system, you can get a list of all installed packages with:

dpkg-query -l

That’s a bit overwhelming though. You can search the output using the grep command. So you might try:

dpkg-query -l | grep mail

to search for the word “mail” in the output.

Here are a few mail related packages that you can try uninstalling:

sudo apt-get remove --purge postfix sendmail dovecot exim4

Though the most likely culprit is postfix