How to use SSL for email

  • Hi all,
    I've added an SSL cert for my main control panel domain for SSL IMAPI email. I seem to be getting this error under my /var/logs/mail.log

    imapd-ssl: couriertls: /etc/imscp/imscp_services.pem: error:0906D06C:PEM routines:PEM_read_bio:no start line

    Any ideas? Cert seems fine in my main control panel.

  • Your Cert is formatted correctly?

    1. -----BEGIN CERTIFICATE-----....-----END CERTIFICATE-----

    and Is it possible that the lines are ^M-terminated (Copy from Win > Linux)

    1. vi -b /etc/apache2/domain.ssl/domain.ssl.crt/
  • @_pAt

    As he said, there was no error when he added the SSL certificate. The problem can be due to the fact that he don't use the correct hostname for the imap server in his mail client. The imap server hostname must matches with one of subject alternative names set in his SSL certificate.


    • What are the subject alternative names set in your SSL certificates?
    • What is the hostname you 're using for the imap server in your mail client?


  • Hi Nuxwin,

    Subject alternative names: and
    Hostname in mail client:

    This is the same subdomain for my control panel aceces. I've just tried https on the control panel URL and it does not resolve. Something is a miss yes.


    Edited 3 times, last by robbo007 ().

  • SSL is not enabled for the control panel. There is no switch to SSL on login page, meaning that you did something wrong. If you added the SSL certificate through customer interface, this cannot work. You must add the SSL certificate through i-MSCP installer.


  • thats most probably the problem. Can you give me the cli syntax for running the installer to only install the certs?

    perl /var/www/imscp/engine/setup/imscp-reconfigure -r ssl

    This will ask you for SSL certificate to use for the services (FTP, IMAP, SMTP) and the control panel.

    Note that this will also trigger reconfiguration of the whole as there is currently no way to operate on a specific target.