How to uninstall emailmail server?

7,244

Solution 1

Start with

dpkg --get-selections

or

dpkg --get-selections | grep -v deinstall

for a shorter list, which shows you what is installed. Look through the list, work out the major packages you don't need (like exim, postfix, mailx, bsd-mailx, etc.) and then,

apt-get remove exim mailx ......

Solution 2

Check which daemon is active on port 25:

sudo lsof -i :25 


> COMMAND PID        USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
> exim4   944 Debian-exim    3u  IPv4  19380      0t0  TCP localhost:smtp (LISTEN)
> exim4   944 Debian-exim    4u  IPv6  19381      0t0  TCP localhost:smtp (LISTEN)

now, you have to remove exim4 service:

sudo apt-get remove exim4-base

Solution 3

I'm assuming you're using postfix since it's the default mail server for Debian (I think). You should be able to remove this by using:

apt-get remove postfix

If it's not the postfix package just substitute the name of the package that was installed.

Share:
7,244

Related videos on Youtube

powtac
Author by

powtac

  Twitter XING Profile LinkedIn Profile Stack Overflow CV

Updated on September 18, 2022

Comments

  • powtac
    powtac almost 2 years

    Mail was accidentally installed on my debian server and I want to remove all mta, mail related software. I do not know what exactly was installed, how can I find out and uninstall this stuff? I don't want to see this "you have mail" when I log in.

  • powtac
    powtac about 12 years
    Do you see any mail related packages in this list? gist.github.com/2889285
  • EightBitTony
    EightBitTony about 12 years
    That's probably because you have content in /var/spool/mail/userid. If you don't care about mail, just delete your file from there.