Installing packages

There is a newer issue of thie ISPmail guide available if you are using Debian Jessie!

By now your Debian Wheezy server should be readily installed. Now it’s time to install the necessary Debian packages to make it an actual mail server.

It is a good idea to install all missing security updates first:

apt-get update

apt-get upgrade

Debian Wheezy does not install the SSH server by default. So to spare you an extra walk to the server room I suggest:

apt-get install ssh

Then let’s install Postfix with MySQL backend support:

apt-get install postfix postfix-mysql

When you get asked for the mail server configuration type please choose “Internet site”. Enter your own mail server name (the fully qualified domain name).

As by default Debian installs exim as a mail service you should remove its remains:

apt-get –purge remove ‘exim4*’

A very useful tool is SWAKS (the SWiss Army Knife for Smtp):

apt-get install swaks

You also need a MySQL server:

apt-get install mysql-server

Note: You can run MySQL server on the same system as your actual mail service – but don’t have to. The mail server can communicate with the MySQL server via TCP networking. Maybe you even have a MySQL server in your network already that you can use.

During the installation you will get asked for the password of a newly created “root” user. This is not your system’s “root” login but a special administrative user used to access the MySQL server. Choose a secure password you want and write it down. (Use “pwgen -s 25 1” or “apg -m 25 -a 1 -n 1” to get good passwords. The commands are available once you “apt-get install pwgen apg”.)

And another warning: during the installation a MySQL user account called “debian-sys-maint” will be created with a random password. The password is stored in the /etc/mysql/debian.cnf file. Do not touch this file or change the user’s password in the database or you won’t be able to stop or start the MySQL service any more.

You will want to offer POP3 and IMAP services to your users so you need to install Dovecot’s services:

apt-get install dovecot-mysql dovecot-pop3d dovecot-imapd dovecot-managesieved

If you intend to offer a webmail service I can recommend the Roundcube package. Previous versions of the tutorial recommended Squirrelmail but honestly Roundcube is way more comfortable. Type:

apt-get install roundcube roundcube-plugins

This will also install an Apache server and PHP packages. You will get asked if you want to maintain the RoundCube package using “dbconfig-common”. Basically this means that Debian will set up the database for you and in future releases upgrade the database. I suggest you say “Yes” here. The database type is “MySQL”. When asked for the “database’s administrative user’s password” enter the password you entered for the MySQL “root” user when you installed the MySQL server. Then you will have to think of a safe password that RoundCube will use to access its database and enter that twice.

If you believe you are not a MySQL ninja on the command line then I suggest you install the PHPMyAdmin software which allows you to manage your MySQL database in the web browser:

apt-get install phpmyadmin

Again you are asked if you want to manage the phpmyadmin database using “dbconfig-common”. Answer “yes”, enter the MySQL “root” user’s password. You will get asked for a “MySQL application password for phpmyadmin”. Just leave the field empty and continue – a password will be generated automatically. As a web server to be used select “apache2”.

Now all basic packages are installed and it’s time to prepare the database in the next chapter.

16 thoughts on “Installing packages

  • 2013-11-26 at 07:00
    Permalink

    After installing phpmyadmin:
    cd /etc/apache2/conf.d
    ln -s /etc/phpmyadmin/apache.conf phpmyadmin
    service apache2 reload

    Reply
  • 2014-02-28 at 22:08
    Permalink

    some typos
    – By now your Debian Whgeezy
    – Debian Squeeze does not install the SSH server

    Reply
    • 2014-03-01 at 18:03
      Permalink

      Thanks, Al, for the hint. Fixed.

      Reply
  • 2014-05-10 at 22:29
    Permalink

    Hi!

    Trying to install dovecot-managesieved results in an error: Package dovecot-managesieved is not available, but is referred to by another package.

    :confused:

    Reply
  • 2014-06-03 at 09:37
    Permalink

    I thought that Debian had replaced Postfix with Exim4 as the MTA.

    Note no Postfix in the Debian tasksel for Mail Server.

    $ apt-cache show task-mail-server

    Package: task-mail-server
    Source: tasksel
    Version: 3.14.1
    Installed-Size: 21
    Maintainer: Debian Install System Team
    Architecture: all
    Depends: tasksel, exim4
    Recommends: dovecot-imapd, dovecot-pop3d, mailx, mutt, exim4-daemon-light, exim4-config, procmail, mailagent, spamassassin, sa-exim
    Description-en: Mail server
    This task selects a variety of packages useful for a general purpose mail
    server system.

    Reply
    • 2014-06-03 at 11:27
      Permalink

      By default Exim4 is capable enough for simple cases in a default setup. That doesn't mean it's the only choice. Debian hasn't replaced Postfix by Exim4.

      Reply
  • 2015-01-14 at 22:08
    Permalink

    There is also a package called postfixadmin in the debian wheezy repository.
    I installed it a few days before I found your detailed script.
    The module provides an HTTP interface for postfix.

    What is the purpose of the module with respect to your description?

    I followed a different script under “http://wiki.nefarius.at/linux/der_perfekte_mail-server” to setup
    – postfix
    – postfixadmin
    – dovecot
    – mysql
    – apache
    – dovecots sieve

    unfortunately for the old versions.
    It seems to have changed a lot in the logical interaction of the components.
    The installation didn’t work at least with the new versions, i.e. partially the functions worked. After including Dovecot nothing more was running 🙁

    tschmieder@online.de

    Reply
    • 2015-02-13 at 10:42
      Permalink

      Eek, that's bad news. I actually liked Roundcube because it integrated so well with Dovecot regarding the Sieve filter management. I don't want to promise anything but I think I'll consider adopting the package. Or is anyone aware of a similarly good webmail software?

      Reply
      • 2015-08-28 at 16:21
        Permalink

        Just so you are aware I was able to install roundcube using the guide with no issues in xUbuntu (yeah I only like the XFCE4 UI; sleek, smooth, slightly windows-esque so it makes moving users away from Winblows easy, and it is light on resources so even old slow netbooks run it rather well).

        Anyways; Ubuntu usually pulls upstream Debian changes, and as such would usually nix something like Roundcube if it were a bug related to the core of the Debian system. I think they have since squashed the issue and Roundcube is available again. This is not always the case, and if it is not then usuing any Ubuntu flavor 14.04 and probably above should give you access to Roundcube repo. If not you should be able to easily add a roundcube repo which would be easy to add to the guide and I would suspect in any case you need to most likely enable to multiverse and restricted extras repos before it would become available.

        Reply
    • 2015-03-17 at 02:31
      Permalink

      I would like to know if there is a good replacement (available in Debian, of course) for roundcube.

      Reply
    • 2015-04-27 at 22:05
      Permalink

      roundcube.com has everything you would need!

      Reply
      • 2015-05-25 at 12:57
        Permalink

        Use egroupware (www.egroupware.org) …. it’ sieve capable and much moore. It has webdav carddav caldav file manager and mysql/mariadb compliant

        It’s also available as deb package

        Reply
  • 2015-10-11 at 12:07
    Permalink

    I would not go for egroupware any more, since Stylite – the company behind most of the developers – tries to push primarily the professional edition of egw, Egroupware EPL, and the opensource version seems to be nowadays just a fig leaf …
    (Some years ago, I would agree on your recommendation, but today not anymore).
    But there are some good alternatives in my opinion with actively developed opensource versions:
    – personally my favorite is horde groupware (http://www.horde.org). It is in the Debian repository, thusnI would recommend installation via pear;
    – also an alternative is the Kolab project (http://www.kolab.org)

    But these are just my 2ct
    chhaas

    Reply
  • 2015-11-04 at 01:30
    Permalink

    Just to let you know Christoph, I was looking for some information about a standby Wheezy server I have and all the information between the text, (commands etc.) seems to have disappeared.

    Reply
    • 2015-11-04 at 09:36
      Permalink

      Sorry about that. Just found and fixed the bug in the stylesheet.

      Reply

Leave a Reply to fizeus Cancel reply

Your email address will not be published. Required fields are marked *

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close