Complete Virtual Mail Server/System Setup and Packages

System Deployment
Since multi-system installations aren't exotic anymore, all possibility exists to do just that or to just keep everything on one box.

Optional packages
Since a webserver (apache recommended) is required for things such as webmail and postfixadmin those should be installed. Instructions can be found for Apache2 and for PHP.

Required packages
Other then apache/php as mentioned above, the following packages are required. Only install packages that you want to use of course where there is choice. E.g. don't install both mysql and postgres (unless you use them for different purposes of course, both dba's can live happily together). Some packages may be pulled in as per useflag from other packages.

Also, as packages get updated and configuration options change, please update this document where changes where needed in the specific sections.

Find below an overview of packages which will be installed and configured throughout this document.

On the webserver, these packages need to be installed:

On the mailserver, these packages will need to be installed:

Before you Start
At this point you just want to get to the good stuff. Before digging into this, the following is strongly suggested.
 * 1)  READ THIS DOCUMENT. This is a long document and there are many opportunities to go off the rails. If you take the time to become familiar with all of the steps and understand the role each of the packages play, recovery from mistakes will be much quicker.
 * 2) Not all of the packages included in this HOWTO are required to get the basic mail server working. SMTP Authorization, Web Administration Tools, SPAM filtering, etc. are not absolute necessities to offer mail services, just really good things to have. By reading through this first, you can figure out which ones you do not want or need and save yourself the work of installing them to begin with.
 * 3) Like all HOWTOs, this one pretty well assumes that everything in your system is going to be where it should be and that everything will go right at each step. In reality, things will go wrong, at which time the web will prove to be an invaluable resource in resolving whatever issues you may hit.
 * 4) A key to testing all of this is having at least one domain (and two would be better if you want to test virtual domains), with the appropriate MX records setup. There are many DNS options out there so a couple of domains and supporting DNS services shouldn't cost more then $10 for the year. This is not the time to go cheap. Invest the money and make your life a whole lot simpler.
 * 5) Pay close attention to the messages displayed after you emerge any packages. Depending on the state of your machine when you started all of this, the installation of these packages may result in the need to update some of your configuration files. You will be prompted and can use etc-update to handle the process. There are no instructions in this HOWTO covering this as what you face will be different for each machine.
 * 6) Be sure your system is up to date. Complete an  and  before starting this. A number of problems may be run into due to old applications not mixing with new utilities.

Finally, to avoid a lot of rework on this, check USE flags variables in your file before starting to compiling anything. If the wrong flags are set, you will most likely need to recompile things later to ensure the support needed to make this work is compiled in.

With the correct USE flags set, emerging just postfix will pull in most, if not all packages due to USE flags.