Qmail

Qmail is a fast popular Mail Transfer Agent (MTA). It is one of the top MTA's in the world today.

Pre-installation
As only one MTA can be installed at the same time on a system, you might be required to unmerge all other installed MTAs like, , ,.

The package manager will report a block when another MTA is still installed. You can resolve this block by manually unmerging the old mail server. For example you can remove ssmtp (which might have been installed as the default when a program requested a mail server to be installed) with this command:

Installation
netqmail has several USE flags that may be desired for certain bigger setups. As this article aims at installing and configuring a basic netqmail setup, we'll add qmail plugin support with qmail-spp and ucspi-tcp support.

Configuration
We'll be using vpopmail to handle virtual domain managent, so we need to tell qmail to use vpopmail

We'd also like to update the memory used by qmail to 32MB from 16MB

Fully Qualified Domain Name (FQDN)
Though not entirely related, for a MTA to function properly, it is imperative that its hostname is set up correctly. Under Gentoo /etc/conf.d/hostname and /etc/conf.d/net are the files responsible for this. In this example, the mail server is named foo on the domain example.com.

Verifying that the FQDN is setup properly for the domain.

Creating Properly Signed Certificates
move the the qmail control directory

Upgrade the Cert Info to create a 2048bit key

Update the Cert Info with information pertinent to you. CN is your fully qualified domain name ie. foo.domain.com

create the pem files and key

Get the contents of the request pem file:

Send req.pem to your CA(ie godaddy/Starfield, Versign, etc.) to obtain signed_req.pem and do:

vpopmail will handle virtual domains, adding delete mail accounts, storing password etc. vpopmail uses mysql in this setup, so if you don't have it running please install it. Let's install and setup vpopmail

Create the vpopmail database

Edit /etc/vpopmail.conf and update the mysql password for the vpopmail user:

Run the init scripts and setup supervisor links for qmail:

Finally we'll add dovecot to talk to our email clients.

add vpopmail uid info to the default dovecot config

edit dovecot ssl configs to pass our ssl certificate to email clients when the login to get mail securely

edit the dovecot auth configs

comment these two vpopmail lines }}

start dovecot and add to the default runlevel

start and add netqmail to the default run level