By now your Debian Squeeze server should be installed correctly. Now it's time to install the necessary Debian packages to make it an actual mail server.
To get a clean system with all security updates installed you may want to run:
Debian Squeeze 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*'
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. 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-pop3d dovecot-imapd
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
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 with "yes", enter the MySQL "root" user's password and think of a new password used for PHPMyAdmin to connect to its database. As a web server to be used select "apache2".
And finally the console-based mutt email client lets you read mail from mailboxes directly from the hard disk. It will be helpful for testing the configuration. And it's even a very powerful IMAP email if you like using the console. Maybe you'll start to like it, too. You should install it at least for testing:
apt-get install mutt
Now all basic packages are installed and it's time to prepare the database in the next chapter.