Using Service Desk with cloud-based email services (Gmail, Office 365, etc)

Version 6

    Verified Product Versions

    Service Desk 7.6Service Desk 7.7.xService Desk 7.8.xService Desk 2016.xAsset Manager 2016.xService Desk 2017.x


    Service Desk supports inbound email support via the IMAP protocol and outbound support via the SMTP protocol.  Traditionally these are used to connect to a locally hosted mail server, however you may want to use a cloud-based email provider such as Google Gmail or Microsoft Office 365.  This document covers how Service Desk can be used with these services.


    Video Walk Through

    See below for written steps, or click the Play button to watch a video going through all the steps:


    videos image.JPG


    1. Configure IMAP and SMTP access with the email provider

    Before doing anything else you must make sure that the email provider supports IMAP and SMTP connections and that the feature is enabled for your account.  For Gmail this is enabled via Settings -> Forwarding and POP/IMAP -> IMAP Access:


    gmail 1.PNG


    2. Obtain the IMAP and SMTP server information for the email provider

    For both IMAP and SMTP, Service Desk needs to know the server, port, username, and password.  For example the settings for Gmail are:


    Inbound Settings (IMAP)Outbound Settings (SMTP)
    Port: 993Port: 465
    Username: [email protected]Username: [email protected]
    Encryption required: SSLEncryption required: TLS


    3. Install stunnel to enable TLS/SSL encryption support for Outbound Mail

    Service Desk can support the SSL encryption required for the inbound mail connection however it does not currently support encryption for the outbound mail connection.  Fortunately we can use an SSL tunnel application to run on the Service Desk server to act as a proxy.  In these steps we will use an application called stunnel but any SSL tunneling application should work.  The following steps are using version 4.56 which was released March 22nd 2013.


    1. Download the stunnel installer (stunnel-4.56-installer.exe) from

    2. Run this on the Service Desk application server that hosts the Outbound Mail Service.

    3. On the Installation Option page remove Terminal Version and Desktop Shortcut:


    stunnel install 1.png


    4. A Command Prompt window will appear requesting information for creating a new server certificate.  This is required for stunnel to run although not for the features we will be using.  Fill out the information requested but don't worry too much about the values:


    stunnel install 2.png


    5. Once installation is complete open the Start Menu and select All Programs -> stunnel -> Edit stunnel.conf to launch the configuration file.

    6. Scroll down to the Example SSL server mode services section of the file and comment out the [pop3s], [imaps] and [ssmtp] sections (prefix each line with a semi-colon) as we do not need them.

    7. Scroll down to the Example SSL client mode services section and either un-comment the [gmail-smtp] section or create a new section with the relevant SMTP server details:



              client = yes

               protocol = smtp

              accept =

              connect =


    • The service name in square brackets can be anything of your choice.
    • The accept option states which IP and which port to listen on for connections, in this case it will listen on port 25 on the loopback adapter (so only the local machine can connect).
    • The connect option states which server and port to connect to and should match the details from your email provider.


    8. Save and close the stunnel.conf file.

    9. We will run stunnel as a service shortly but to start with we can run it with an interface to test the connection and see a visual log - from the Stat Menu select All Programs -> stunnel -> stunnel GUI Start.

    10. From the System Tray find the stunnel icon and double-click on it to bring up the interface - you will see a log which will display any configuration errors.


    4. Configure Service Desk and test the connections

    We are now ready to configure the mail settings within Service Desk and test both the inbound and outbound mail connections.


    1. Run the Service Desk Console from the same server hosting the mail services and stunnel.

    2. Within the Mail component create a mail mapping (if not already there) and then create a mail box with the details for your email provider.

    3. Press the Test button from the toolbar to confirm the connection details are correct and then save the page.

    4. In the Outbound Mail Settings enter the details as follows:


              Mail Server Name:

              User Name: mail provider username

              Password: mail provider password

              From Address and Reply To Address: mail provider email address

              Port Number: 25

    5. Press the Test button from the toolbar to confirm the connection details are correct and that stunnel is working and then save the page.

    6. Look in the stunnel interface to see the outbound connection logged.


    5. Run stunnel as a windows service

    1. Close the stunnel interface by right-clicking the icon in the System Tray and selecting exit.

    2. From the Start Menu select All Programs -> stunnel -> stunnel Service Install.

    3. From the Start Menu select All Programs -> stunnel -> stunnel Service Start.

    4. Re-test the Outbound Mail Settings in Console.