Install SSL Certificate on Qmail Server

Here are steps to install the digital SSL certificate on Qmail server:

  1. Generate your private key and CSR if you don't have one yet. Then have the CSR signed by your trusted CA.
  2. Download the certificated files signed by your trusted CA.
  3. Combine the private key and certificates in the order as below
    1. your own private key
    2. your primary certificate (your-domain.crt)
    3. intermediate certificate
    4. root certificate
  4. Make sure that you include the beginning and end tags on each SSL Certificate. The result should look like this:

    -----BEGIN RSA PRIVATE KEY-----
    (Your Private Key: your_domain_name.key)
    -----END RSA PRIVATE KEY-----

    -----BEGIN CERTIFICATE-----
    (Your Primary SSL certificate: your_domain_name.crt)
    -----END CERTIFICATE-----

    -----BEGIN CERTIFICATE-----
    (Your Intermediate certificate: DigiCertCA.crt)
    -----END CERTIFICATE-----

    -----BEGIN CERTIFICATE-----
    (Your Root certificate: TrustedRoot.crt)
    -----END CERTIFICATE-----

  5. Install your Trustwave SSL certificate In your /var/qmail/control/ folder, you should now have the file you created in the previous step. Rename your original certificate file (usually servercert.pem) to something else - maybe servercert_old.pem. Now, take the file that you created in the previous step and rename it to servercert.pem.
  6. Make sure the file is owned by the user that qmaild runs at, and has the same user group too. And the file's permission should be set to 0600 (chmod 0600 servercert.pem).

To finish the installation, simply restart qmail. This is done on most systems by running qmail restart as root, but some other systems may require you to use /etc/init.d/qmail restart or even /etc/rc.d/init.d/qmail restart.